From 7a9a14e200560341e59776c755a41e4868fba548 Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Fri, 7 Jan 2022 16:54:47 +0100 Subject: [PATCH 01/26] feat(php): add raw templates --- openapitools.json | 13 + templates/php/.php_cs | 23 + templates/php/.travis.yml | 9 + templates/php/ApiException.mustache | 111 ++++ templates/php/Configuration.mustache | 503 ++++++++++++++ templates/php/HeaderSelector.mustache | 99 +++ templates/php/ModelInterface.mustache | 86 +++ templates/php/ObjectSerializer.mustache | 384 +++++++++++ templates/php/README.mustache | 148 +++++ templates/php/api.mustache | 700 ++++++++++++++++++++ templates/php/api_doc.mustache | 78 +++ templates/php/api_test.mustache | 79 +++ templates/php/composer.mustache | 44 ++ templates/php/git_push.sh.mustache | 57 ++ templates/php/gitignore | 14 + templates/php/model.mustache | 48 ++ templates/php/model_doc.mustache | 10 + templates/php/model_enum.mustache | 28 + templates/php/model_generic.mustache | 454 +++++++++++++ templates/php/model_test.mustache | 87 +++ templates/php/partial_header.mustache | 18 + templates/php/php_doc_auth_partial.mustache | 23 + templates/php/phpunit.xml.mustache | 18 + 23 files changed, 3034 insertions(+) create mode 100644 templates/php/.php_cs create mode 100644 templates/php/.travis.yml create mode 100644 templates/php/ApiException.mustache create mode 100644 templates/php/Configuration.mustache create mode 100644 templates/php/HeaderSelector.mustache create mode 100644 templates/php/ModelInterface.mustache create mode 100644 templates/php/ObjectSerializer.mustache create mode 100644 templates/php/README.mustache create mode 100644 templates/php/api.mustache create mode 100644 templates/php/api_doc.mustache create mode 100644 templates/php/api_test.mustache create mode 100644 templates/php/composer.mustache create mode 100644 templates/php/git_push.sh.mustache create mode 100644 templates/php/gitignore create mode 100644 templates/php/model.mustache create mode 100644 templates/php/model_doc.mustache create mode 100644 templates/php/model_enum.mustache create mode 100644 templates/php/model_generic.mustache create mode 100644 templates/php/model_test.mustache create mode 100644 templates/php/partial_header.mustache create mode 100644 templates/php/php_doc_auth_partial.mustache create mode 100644 templates/php/phpunit.xml.mustache diff --git a/openapitools.json b/openapitools.json index 8cf8fe32b6..e270452887 100644 --- a/openapitools.json +++ b/openapitools.json @@ -129,6 +129,19 @@ "packageName": "algoliasearch-client-java-2" } + }, + "php-search": { + "generatorName": "php", + "templateDir": "#{cwd}/templates/php/", + "config": "#{cwd}/openapitools.json", + "output": "#{cwd}/clients/algoliasearch-client-php", + "apiPackage": "src", + "glob": "specs/search/spec.yml", + "gitHost": "algolia", + "gitUserId": "algolia", + "gitRepoId": "algoliasearch-client-php", + "additionalProperties": { + } } } } diff --git a/templates/php/.php_cs b/templates/php/.php_cs new file mode 100644 index 0000000000..4fbe53ec5f --- /dev/null +++ b/templates/php/.php_cs @@ -0,0 +1,23 @@ +setUsingCache(true) + ->setRules([ + '@PSR2' => true, + 'ordered_imports' => true, + 'phpdoc_order' => true, + 'array_syntax' => [ 'syntax' => 'short' ], + 'strict_comparison' => true, + 'strict_param' => true, + 'no_trailing_whitespace' => false, + 'no_trailing_whitespace_in_comment' => false, + 'braces' => false, + 'single_blank_line_at_eof' => false, + 'blank_line_after_namespace' => false, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->exclude('test') + ->exclude('tests') + ->in(__DIR__) + ); diff --git a/templates/php/.travis.yml b/templates/php/.travis.yml new file mode 100644 index 0000000000..714772ee93 --- /dev/null +++ b/templates/php/.travis.yml @@ -0,0 +1,9 @@ +language: php +# Bionic environment has preinstalled PHP from 7.1 to 7.4 +# https://docs.travis-ci.com/user/reference/bionic/#php-support +dist: bionic +php: + - 7.3 + - 7.4 +before_install: "composer install" +script: "vendor/bin/phpunit" diff --git a/templates/php/ApiException.mustache b/templates/php/ApiException.mustache new file mode 100644 index 0000000000..ade19b2653 --- /dev/null +++ b/templates/php/ApiException.mustache @@ -0,0 +1,111 @@ +partial_header}} +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace {{invokerPackage}}; + +use \Exception; + +/** + * ApiException Class Doc Comment + * + * @category Class + * @package {{invokerPackage}} + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ApiException extends Exception +{ + + /** + * The HTTP body of the server response either as Json or string. + * + * @var \stdClass|string|null + */ + protected $responseBody; + + /** + * The HTTP header of the server response. + * + * @var string[]|null + */ + protected $responseHeaders; + + /** + * The deserialized response object + * + * @var \stdClass|string|null + */ + protected $responseObject; + + /** + * Constructor + * + * @param string $message Error message + * @param int $code HTTP status code + * @param string[]|null $responseHeaders HTTP response header + * @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string + */ + public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) + { + parent::__construct($message, $code); + $this->responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return string[]|null HTTP response header + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Sets the deserialized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deserialized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/templates/php/Configuration.mustache b/templates/php/Configuration.mustache new file mode 100644 index 0000000000..408740429a --- /dev/null +++ b/templates/php/Configuration.mustache @@ -0,0 +1,503 @@ +partial_header}} +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace {{invokerPackage}}; + +/** + * Configuration Class Doc Comment + * PHP version 7.3 + * + * @category Class + * @package {{invokerPackage}} + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class Configuration +{ + /** + * @var Configuration + */ + private static $defaultConfiguration; + + /** + * Associate array to store API key(s) + * + * @var string[] + */ + protected $apiKeys = []; + + /** + * Associate array to store API prefix (e.g. Bearer) + * + * @var string[] + */ + protected $apiKeyPrefixes = []; + + /** + * Access token for OAuth/Bearer authentication + * + * @var string + */ + protected $accessToken = ''; + + /** + * Username for HTTP basic authentication + * + * @var string + */ + protected $username = ''; + + /** + * Password for HTTP basic authentication + * + * @var string + */ + protected $password = ''; + + /** + * The host + * + * @var string + */ + protected $host = '{{basePath}}'; + + /** + * User agent of the HTTP request, set to "OpenAPI-Generator/{version}/PHP" by default + * + * @var string + */ + protected $userAgent = '{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}{{^artifactVersion}}1.0.0{{/artifactVersion}}/PHP{{/httpUserAgent}}'; + + /** + * Debug switch (default set to false) + * + * @var bool + */ + protected $debug = false; + + /** + * Debug file location (log to STDOUT by default) + * + * @var string + */ + protected $debugFile = 'php://output'; + + /** + * Debug file location (log to STDOUT by default) + * + * @var string + */ + protected $tempFolderPath; + + /** + * Constructor + */ + public function __construct() + { + $this->tempFolderPath = sys_get_temp_dir(); + } + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Gets the username for HTTP basic authentication + * + * @return string Username for HTTP basic authentication + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug($debug) + { + $this->debug = $debug; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile($debugFile) + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile() + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration() + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the default configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config) + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport() + { + $report = 'PHP SDK ({{invokerPackage}}) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' The version of the OpenAPI document: {{version}}' . PHP_EOL; + {{#artifactVersion}} + $report .= ' SDK Package Version: {{.}}' . PHP_EOL; + {{/artifactVersion}} + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return null|string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } + + /** + * Returns an array of host settings + * + * @return array an array of host settings + */ + public function getHostSettings() + { + return [ + {{#servers}} + [ + "url" => "{{{url}}}", + "description" => "{{{description}}}{{^description}}No description provided{{/description}}", + {{#variables}} + {{#-first}} + "variables" => [ + {{/-first}} + "{{{name}}}" => [ + "description" => "{{{description}}}{{^description}}No description provided{{/description}}", + "default_value" => "{{{defaultValue}}}", + {{#enumValues}} + {{#-first}} + "enum_values" => [ + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + ] + {{/-last}} + {{/enumValues}} + ]{{^-last}},{{/-last}} + {{#-last}} + ] + {{/-last}} + {{/variables}} + ]{{^-last}},{{/-last}} + {{/servers}} + ]; + } + + /** + * Returns URL based on the index and variables + * + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public function getHostFromSettings($index, $variables = null) + { + if (null === $variables) { + $variables = []; + } + + $hosts = $this->getHostSettings(); + + // check array index out of bound + if ($index < 0 || $index >= sizeof($hosts)) { + throw new \InvalidArgumentException("Invalid index $index when selecting the host. Must be less than ".sizeof($hosts)); + } + + $host = $hosts[$index]; + $url = $host["url"]; + + // go through variable and assign a value + foreach ($host["variables"] ?? [] as $name => $variable) { + if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user + if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum + $url = str_replace("{".$name."}", $variables[$name], $url); + } else { + throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); + } + } else { + // use default value + $url = str_replace("{".$name."}", $variable["default_value"], $url); + } + } + + return $url; + } +} diff --git a/templates/php/HeaderSelector.mustache b/templates/php/HeaderSelector.mustache new file mode 100644 index 0000000000..aece2d69c0 --- /dev/null +++ b/templates/php/HeaderSelector.mustache @@ -0,0 +1,99 @@ +partial_header}} +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace {{invokerPackage}}; + +use \Exception; + +/** + * ApiException Class Doc Comment + * + * @category Class + * @package {{invokerPackage}} + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class HeaderSelector +{ + + /** + * @param string[] $accept + * @param string[] $contentTypes + * @return array + */ + public function selectHeaders($accept, $contentTypes) + { + $headers = []; + + $accept = $this->selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); + return $headers; + } + + /** + * @param string[] $accept + * @return array + */ + public function selectHeadersForMultipart($accept) + { + $headers = $this->selectHeaders($accept, []); + + unset($headers['Content-Type']); + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided + * + * @param string[] $accept Array of header + * + * @return null|string Accept (e.g. application/json) + */ + private function selectAcceptHeader($accept) + { + if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + return null; + } elseif ($jsonAccept = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept)) { + return implode(',', $jsonAccept); + } else { + return implode(',', $accept); + } + } + + /** + * Return the content type based on an array of content-type provided + * + * @param string[] $contentType Array fo content-type + * + * @return string Content-Type (e.g. application/json) + */ + private function selectContentTypeHeader($contentType) + { + if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { + return 'application/json'; + } elseif (preg_grep("/application\/json/i", $contentType)) { + return 'application/json'; + } else { + return implode(',', $contentType); + } + } +} diff --git a/templates/php/ModelInterface.mustache b/templates/php/ModelInterface.mustache new file mode 100644 index 0000000000..417ca5d56e --- /dev/null +++ b/templates/php/ModelInterface.mustache @@ -0,0 +1,86 @@ +partial_header}} +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace {{modelPackage}}; + +/** + * Interface abstracting model access. + * + * @package {{modelPackage}} + * @author OpenAPI Generator team + */ +interface ModelInterface +{ + /** + * The original name of the model. + * + * @return string + */ + public function getModelName(); + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes(); + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats(); + + /** + * Array of attributes where the key is the local name, and the value is the original name + * + * @return array + */ + public static function attributeMap(); + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters(); + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters(); + + /** + * Show all the invalid properties with reasons. + * + * @return array + */ + public function listInvalidProperties(); + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool + */ + public function valid(); +} diff --git a/templates/php/ObjectSerializer.mustache b/templates/php/ObjectSerializer.mustache new file mode 100644 index 0000000000..2d5c2c9113 --- /dev/null +++ b/templates/php/ObjectSerializer.mustache @@ -0,0 +1,384 @@ +partial_header}} +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace {{invokerPackage}}; + +use {{modelPackage}}\ModelInterface; + +/** + * ObjectSerializer Class Doc Comment + * + * @category Class + * @package {{invokerPackage}} + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class ObjectSerializer +{ + /** @var string */ + private static $dateTimeFormat = \DateTime::ATOM; + + /** + * Change the date format + * + * @param string $format the new date format to use + */ + public static function setDateTimeFormat($format) + { + self::$dateTimeFormat = $format; + } + + /** + * Serialize data + * + * @param mixed $data the data to serialize + * @param string $type the OpenAPIToolsType of the data + * @param string $format the format of the OpenAPITools type of the data + * + * @return scalar|object|array|null serialized form of $data + */ + public static function sanitizeForSerialization($data, $type = null, $format = null) + { + if (is_scalar($data) || null === $data) { + return $data; + } + + if ($data instanceof \DateTime) { + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, [{{&primitives}}], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue($value) + { + return rawurlencode(self::toString($value)); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the query, by imploding comma-separated if it's an object. + * If it's a string, pass through unchanged. It will be url-encoded + * later. + * + * @param string[]|string|\DateTime $object an object to be serialized to a string + * + * @return string the serialized object + */ + public static function toQueryValue($object) + { + if (is_array($object)) { + return implode(',', $object); + } else { + return self::toString($object); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue($value) + { + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); + } + + return self::toString($value); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\SplFileObject $value the value of the form parameter + * + * @return string the form string + */ + public static function toFormValue($value) + { + if ($value instanceof \SplFileObject) { + return $value->getRealPath(); + } else { + return self::toString($value); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * If it's a boolean, convert it to "true" or "false". + * + * @param string|bool|\DateTime $value the value of the parameter + * + * @return string the header string + */ + public static function toString($value) + { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(self::$dateTimeFormat); + } elseif (is_bool($value)) { + return $value ? 'true' : 'false'; + } else { + return $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } else if ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some API's return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some API's return a date-time with too high nanosecond + // precision for php's DateTime to handle. This conversion + // (string -> unix timestamp -> DateTime) is a workaround + // for the problem. + return (new \DateTime())->setTimestamp(strtotime($data)); + } + } else { + return null; + } + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, [{{&primitives}}], true)) { + settype($data, $class); + return $data; + } + + if ($class === '\SplFileObject') { + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (array_key_exists('Content-Disposition', $httpHeaders) && + preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } elseif (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\{{invokerPackage}}\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/templates/php/README.mustache b/templates/php/README.mustache new file mode 100644 index 0000000000..dada97d670 --- /dev/null +++ b/templates/php/README.mustache @@ -0,0 +1,148 @@ +# {{packageName}} + +{{#appDescriptionWithNewLines}} +{{{.}}} +{{/appDescriptionWithNewLines}} + +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}). +{{/infoUrl}} + +## Installation & Usage + +### Requirements + +PHP 7.3 and later. +Should also work with PHP 8.0 but has not been tested. + +### Composer + +To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: + +```json +{ + "repositories": [ + { + "type": "vcs", + "url": "https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git" + } + ], + "require": { + "{{gitUserId}}/{{gitRepoId}}": "*@dev" + } +} +``` + +Then run `composer install` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php + php_doc_auth_partial}} +$apiInstance = new {{invokerPackage}}\Api\{{classname}}( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(){{#hasAuthMethods}}, + $config{{/hasAuthMethods}} +); +{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}}{{#description}} | {{{.}}}{{/description}} +{{/allParams}} + +try { + {{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + print_r($result);{{/returnType}} +} catch (Exception $e) { + echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` + +## API Endpoints + +All URIs are relative to *{{basePath}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +## Models + +{{#models}}{{#model}}- [{{{classname}}}]({{modelDocPath}}/{{{classname}}}.md){{/model}} +{{/models}} + +## Authorization +{{^authMethods}} +All endpoints do not require authorization. +{{/authMethods}} +{{#authMethods}} +{{#last}} Authentication schemes defined for the API:{{/last}} +### {{{name}}} +{{#isApiKey}} + +- **Type**: API key +- **API key parameter name**: {{{keyParamName}}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} + +{{/isApiKey}} +{{#isBasic}} +{{#isBasicBasic}} + +- **Type**: HTTP basic authentication +{{/isBasicBasic}} +{{#isBasicBearer}} + +- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} +{{/isBasicBearer}} +{{/isBasic}} +{{#isOAuth}} + +- **Type**: `OAuth` +- **Flow**: `{{{flow}}}` +- **Authorization URL**: `{{{authorizationUrl}}}` +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} + - **{{{scope}}}**: {{{description}}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} +## Tests + +To run the tests, use: + +```bash +composer install +vendor/bin/phpunit +``` + +## Author + +{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} +{{/-last}}{{/apis}}{{/apiInfo}} +## About this package + +This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `{{appVersion}}` +{{#artifactVersion}} + - Package version: `{{.}}` +{{/artifactVersion}} +{{^hideGenerationTimestamp}} + - Build date: `{{generatedDate}}` +{{/hideGenerationTimestamp}} +- Build package: `{{generatorClass}}` diff --git a/templates/php/api.mustache b/templates/php/api.mustache new file mode 100644 index 0000000000..60989ca573 --- /dev/null +++ b/templates/php/api.mustache @@ -0,0 +1,700 @@ +partial_header}} +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace {{apiPackage}}; + +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\ConnectException; +use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Psr7\Request; +use GuzzleHttp\RequestOptions; +use {{invokerPackage}}\ApiException; +use {{invokerPackage}}\Configuration; +use {{invokerPackage}}\HeaderSelector; +use {{invokerPackage}}\ObjectSerializer; + +/** + * {{classname}} Class Doc Comment + * + * @category Class + * @package {{invokerPackage}} + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +{{#operations}}class {{classname}} +{ + /** + * @var ClientInterface + */ + protected $client; + + /** + * @var Configuration + */ + protected $config; + + /** + * @var HeaderSelector + */ + protected $headerSelector; + + /** + * @var int Host index + */ + protected $hostIndex; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + +{{#operation}} + /** + * Operation {{{operationId}}} +{{#summary}} + * + * {{.}} +{{/summary}} + * +{{#description}} + * {{.}} + * +{{/description}} +{{#vendorExtensions.x-group-parameters}} + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * +{{/vendorExtensions.x-group-parameters}} +{{#servers}} +{{#-first}} + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. +{{/-first}} + * URL: {{{url}}} +{{#-last}} + * +{{/-last}} +{{/servers}} +{{#allParams}} + * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} +{{/allParams}} + * + * @throws \{{invokerPackage}}\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return {{#returnType}}{{#responses}}{{#dataType}}{{^-first}}|{{/-first}}{{/dataType}}{{{dataType}}}{{/responses}}{{/returnType}}{{^returnType}}void{{/returnType}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + public function {{operationId}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + { + {{#returnType}}list($response) = {{/returnType}}$this->{{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}});{{#returnType}} + return $response;{{/returnType}} + } + + /** + * Operation {{{operationId}}}WithHttpInfo +{{#summary}} + * + * {{.}} +{{/summary}} + * +{{#description}} + * {{.}} + * +{{/description}} +{{#vendorExtensions.x-group-parameters}} + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * +{{/vendorExtensions.x-group-parameters}} +{{#servers}} +{{#-first}} + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. +{{/-first}} + * URL: {{{url}}} +{{#-last}} + * +{{/-last}} +{{/servers}} +{{#allParams}} + * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} +{{/allParams}} + * + * @throws \{{invokerPackage}}\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of {{#returnType}}{{#responses}}{{#dataType}}{{^-first}}|{{/-first}}{{/dataType}}{{{dataType}}}{{/responses}}{{/returnType}}{{^returnType}}null{{/returnType}}, HTTP status code, HTTP response headers (array of strings) + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + public function {{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + { + $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + {{#returnType}} + {{#responses}} + {{#-first}} + + switch($statusCode) { + {{/-first}} + {{#dataType}} + {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} + if ('{{{dataType}}}' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '{{{dataType}}}', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + {{/dataType}} + {{#-last}} + } + {{/-last}} + {{/responses}} + + $returnType = '{{{returnType}}}'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + {{/returnType}} + {{^returnType}} + + return [null, $statusCode, $response->getHeaders()]; + {{/returnType}} + + } catch (ApiException $e) { + switch ($e->getCode()) { + {{#responses}} + {{#dataType}} + {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '{{{dataType}}}', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + {{/dataType}} + {{/responses}} + } + throw $e; + } + } + + /** + * Operation {{{operationId}}}Async + * +{{#summary}} + * {{.}} + * +{{/summary}} +{{#description}} + * {{.}} + * +{{/description}} +{{#vendorExtensions.x-group-parameters}} + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * +{{/vendorExtensions.x-group-parameters}} +{{#servers}} +{{#-first}} + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. +{{/-first}} + * URL: {{{url}}} +{{#-last}} + * +{{/-last}} +{{/servers}} +{{#allParams}} + * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} +{{/allParams}} + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + public function {{operationId}}Async({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + { + return $this->{{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation {{{operationId}}}AsyncWithHttpInfo + * +{{#summary}} + * {{.}} + * +{{/summary}} +{{#description}} + * {{.}} + * +{{/description}} +{{#vendorExtensions.x-group-parameters}} + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * +{{/vendorExtensions.x-group-parameters}} +{{#servers}} +{{#-first}} + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. +{{/-first}} + * URL: {{{url}}} +{{#-last}} + * +{{/-last}} +{{/servers}} +{{#allParams}} + * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} +{{/allParams}} + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + public function {{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + { + $returnType = '{{{returnType}}}'; + $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + {{#returnType}} + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + {{/returnType}} + {{^returnType}} + return [null, $response->getStatusCode(), $response->getHeaders()]; + {{/returnType}} + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation '{{{operationId}}}' + * +{{#vendorExtensions.x-group-parameters}} + * Note: the input parameter is an associative array with the keys listed as the parameter name below + * +{{/vendorExtensions.x-group-parameters}} +{{#servers}} +{{#-first}} + * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. +{{/-first}} + * URL: {{{url}}} +{{#-last}} + * +{{/-last}} +{{/servers}} +{{#allParams}} + * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} +{{/allParams}} + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + public function {{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) + { + {{#vendorExtensions.x-group-parameters}} + // unbox the parameters from the associative array + {{#allParams}} + ${{paramName}} = array_key_exists('{{paramName}}', $associative_array) ? $associative_array['{{paramName}}'] : {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}; + {{/allParams}} + + {{/vendorExtensions.x-group-parameters}} + {{#allParams}} + {{#required}} + // verify the required parameter '{{paramName}}' is set + if (${{paramName}} === null || (is_array(${{paramName}}) && count(${{paramName}}) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter ${{paramName}} when calling {{operationId}}' + ); + } + {{/required}} + {{#hasValidation}} + {{#maxLength}} + if ({{^required}}${{paramName}} !== null && {{/required}}strlen(${{paramName}}) > {{maxLength}}) { + throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maxLength}}.'); + } + {{/maxLength}} + {{#minLength}} + if ({{^required}}${{paramName}} !== null && {{/required}}strlen(${{paramName}}) < {{minLength}}) { + throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.'); + } + {{/minLength}} + {{#maximum}} + if ({{^required}}${{paramName}} !== null && {{/required}}${{paramName}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}) { + throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.'); + } + {{/maximum}} + {{#minimum}} + if ({{^required}}${{paramName}} !== null && {{/required}}${{paramName}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}) { + throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.'); + } + {{/minimum}} + {{#pattern}} + if ({{^required}}${{paramName}} !== null && {{/required}}!preg_match("{{{pattern}}}", ${{paramName}})) { + throw new \InvalidArgumentException("invalid value for \"{{paramName}}\" when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}."); + } + {{/pattern}} + {{#maxItems}} + if ({{^required}}${{paramName}} !== null && {{/required}}count(${{paramName}}) > {{maxItems}}) { + throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, number of items must be less than or equal to {{maxItems}}.'); + } + {{/maxItems}} + {{#minItems}} + if ({{^required}}${{paramName}} !== null && {{/required}}count(${{paramName}}) < {{minItems}}) { + throw new \InvalidArgumentException('invalid value for "${{paramName}}" when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{minItems}}.'); + } + {{/minItems}} + + {{/hasValidation}} + {{/allParams}} + + $resourcePath = '{{{path}}}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + {{#queryParams}} + // query params + {{#isExplode}} + if (${{paramName}} !== null) { + {{#style}} + if('form' === '{{style}}' && is_array(${{paramName}})) { + foreach(${{paramName}} as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['{{baseName}}'] = ${{paramName}}; + } + {{/style}} + {{^style}} + $queryParams['{{baseName}}'] = ${{paramName}}; + {{/style}} + } + {{/isExplode}} + {{^isExplode}} + if (is_array(${{paramName}})) { + ${{paramName}} = ObjectSerializer::serializeCollection(${{paramName}}, '{{style}}{{^style}}{{collectionFormat}}{{/style}}', true); + } + if (${{paramName}} !== null) { + $queryParams['{{baseName}}'] = ${{paramName}}; + } + {{/isExplode}} + {{/queryParams}} + + {{#headerParams}} + // header params + {{#collectionFormat}} + if (is_array(${{paramName}})) { + ${{paramName}} = ObjectSerializer::serializeCollection(${{paramName}}, '{{collectionFormat}}'); + } + {{/collectionFormat}} + if (${{paramName}} !== null) { + $headerParams['{{baseName}}'] = ObjectSerializer::toHeaderValue(${{paramName}}); + } + {{/headerParams}} + + {{#pathParams}} + // path params + {{#collectionFormat}} + if (is_array(${{paramName}})) { + ${{paramName}} = ObjectSerializer::serializeCollection(${{paramName}}, '{{collectionFormat}}'); + } + {{/collectionFormat}} + if (${{paramName}} !== null) { + $resourcePath = str_replace( + '{' . '{{baseName}}' . '}', + ObjectSerializer::toPathValue(${{paramName}}), + $resourcePath + ); + } + {{/pathParams}} + + {{#formParams}} + // form params + if (${{paramName}} !== null) { + {{#isFile}} + $multipart = true; + $formParams['{{baseName}}'] = []; + $paramFiles = is_array(${{paramName}}) ? ${{paramName}} : [${{paramName}}]; + foreach ($paramFiles as $paramFile) { + $formParams['{{baseName}}'][] = \GuzzleHttp\Psr7\Utils::tryFopen( + ObjectSerializer::toFormValue($paramFile), + 'rb' + ); + } + {{/isFile}} + {{^isFile}} + $formParams['{{baseName}}'] = ObjectSerializer::toFormValue(${{paramName}}); + {{/isFile}} + } + {{/formParams}} + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}], + [{{#consumes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}}] + ); + } + + // for model (json/xml) + {{#bodyParams}} + if (isset(${{paramName}})) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization(${{paramName}})); + } else { + $httpBody = ${{paramName}}; + } + } elseif (count($formParams) > 0) { + {{/bodyParams}} + {{^bodyParams}} + if (count($formParams) > 0) { + {{/bodyParams}} + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); + } + } + + {{#authMethods}} + {{#isApiKey}} + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('{{keyParamName}}'); + if ($apiKey !== null) { + {{#isKeyInHeader}}$headers['{{keyParamName}}'] = $apiKey;{{/isKeyInHeader}}{{#isKeyInQuery}}$queryParams['{{keyParamName}}'] = $apiKey;{{/isKeyInQuery}} + } + {{/isApiKey}} + {{#isBasic}} + {{#isBasicBasic}} + // this endpoint requires HTTP basic authentication + if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + // this endpoint requires Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} authentication (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + {{/isBasicBearer}} + {{/isBasic}} + {{#isOAuth}} + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + {{/isOAuth}} + {{/authMethods}} + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + {{#servers.0}} + $operationHosts = [{{#servers}}"{{{url}}}"{{^-last}}, {{/-last}}{{/servers}}]; + if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) { + throw new \InvalidArgumentException("Invalid index {$this->hostIndex} when selecting the host. Must be less than ".sizeof($operationHosts)); + } + $operationHost = $operationHosts[$this->hostIndex]; + + {{/servers.0}} + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + return new Request( + '{{httpMethod}}', + {{^servers.0}}$this->config->getHost(){{/servers.0}}{{#servers.0}}$operationHost{{/servers.0}} . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + {{/operation}} + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} +{{/operations}} diff --git a/templates/php/api_doc.mustache b/templates/php/api_doc.mustache new file mode 100644 index 0000000000..7c8460fe48 --- /dev/null +++ b/templates/php/api_doc.mustache @@ -0,0 +1,78 @@ +# {{invokerPackage}}\{{classname}}{{#description}} + +{{.}}{{/description}} + +All URIs are relative to {{basePath}}. + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}()**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{/operation}}{{/operations}}{{#operations}}{{#operation}} + +## `{{{operationId}}}()` + +```php +{{{operationId}}}({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}: {{{.}}}{{/returnType}} +``` + +{{{summary}}}{{#notes}} + +{{{.}}}{{/notes}} + +### Example + +```php + php_doc_auth_partial}} +$apiInstance = new {{invokerPackage}}\Api\{{classname}}( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(){{#hasAuthMethods}}, + $config{{/hasAuthMethods}} +); +{{^vendorExtensions.x-group-parameters}} +{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}}{{#description}} | {{{.}}}{{/description}} +{{/allParams}} +{{/vendorExtensions.x-group-parameters}} +{{#vendorExtensions.x-group-parameters}} +{{#allParams}}$associate_array['{{paramName}}'] = {{{example}}}; // {{{dataType}}}{{#description}} | {{{.}}}{{/description}} +{{/allParams}} +{{/vendorExtensions.x-group-parameters}} + +try { + {{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associate_array{{/vendorExtensions.x-group-parameters}});{{#returnType}} + print_r($result);{{/returnType}} +} catch (Exception $e) { + echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +{{#vendorExtensions.x-group-parameters}} +Note: the input parameter is an associative array with the keys listed as the parameter name below. + +{{/vendorExtensions.x-group-parameters}} +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{{dataType}}}**](../Model/{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**](../Model/{{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + +- **Content-Type**: {{#consumes}}`{{{mediaType}}}`{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} +- **Accept**: {{#produces}}`{{{mediaType}}}`{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md){{/operation}}{{/operations}} diff --git a/templates/php/api_test.mustache b/templates/php/api_test.mustache new file mode 100644 index 0000000000..6685fe5d5e --- /dev/null +++ b/templates/php/api_test.mustache @@ -0,0 +1,79 @@ +partial_header}} +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Please update the test case below to test the endpoint. + */ + +namespace {{invokerPackage}}\Test\Api; + +use \{{invokerPackage}}\Configuration; +use \{{invokerPackage}}\ApiException; +use \{{invokerPackage}}\ObjectSerializer; +use PHPUnit\Framework\TestCase; + +/** + * {{classname}}Test Class Doc Comment + * + * @category Class + * @package {{invokerPackage}} + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +{{#operations}}class {{classname}}Test extends TestCase +{ + + /** + * Setup before running any test cases + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + {{#operation}} + + /** + * Test case for {{{operationId}}} + * + * {{{summary}}}. + * + */ + public function test{{vendorExtensions.x-test-operation-id}}() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + {{/operation}} +} +{{/operations}} diff --git a/templates/php/composer.mustache b/templates/php/composer.mustache new file mode 100644 index 0000000000..6a69cead65 --- /dev/null +++ b/templates/php/composer.mustache @@ -0,0 +1,44 @@ +{ + {{#composerPackageName}} + "name": "{{.}}", + {{/composerPackageName}} + {{#artifactVersion}} + "version": "{{.}}", + {{/artifactVersion}} + "description": "{{{appDescription}}}", + "keywords": [ + "openapitools", + "openapi-generator", + "openapi", + "php", + "sdk", + "rest", + "api" + ], + "homepage": "https://openapi-generator.tech", + "license": "unlicense", + "authors": [ + { + "name": "OpenAPI-Generator contributors", + "homepage": "https://openapi-generator.tech" + } + ], + "require": { + "php": "^7.3 || ^8.0", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^7.3", + "guzzlehttp/psr7": "^2.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0 || ^9.0", + "friendsofphp/php-cs-fixer": "^2.12" + }, + "autoload": { + "psr-4": { "{{escapedInvokerPackage}}\\" : "{{srcBasePath}}/" } + }, + "autoload-dev": { + "psr-4": { "{{escapedInvokerPackage}}\\Test\\" : "{{testBasePath}}/" } + } +} diff --git a/templates/php/git_push.sh.mustache b/templates/php/git_push.sh.mustache new file mode 100644 index 0000000000..0e3776ae6d --- /dev/null +++ b/templates/php/git_push.sh.mustache @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="{{{gitHost}}}" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="{{{gitUserId}}}" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="{{{gitRepoId}}}" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="{{{releaseNote}}}" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/templates/php/gitignore b/templates/php/gitignore new file mode 100644 index 0000000000..92f7fdeff5 --- /dev/null +++ b/templates/php/gitignore @@ -0,0 +1,14 @@ +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock + +# php-cs-fixer cache +.php_cs.cache + +# PHPUnit cache +.phpunit.result.cache diff --git a/templates/php/model.mustache b/templates/php/model.mustache new file mode 100644 index 0000000000..c100009e5f --- /dev/null +++ b/templates/php/model.mustache @@ -0,0 +1,48 @@ +partial_header}} +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace {{modelPackage}}; +{{^isEnum}} +{{^parentSchema}} + +use \ArrayAccess; +{{/parentSchema}} +{{/isEnum}} +use \{{invokerPackage}}\ObjectSerializer; + +/** + * {{classname}} Class Doc Comment + * + * @category Class +{{#description}} + * @description {{.}} +{{/description}} + * @package {{invokerPackage}} + * @author OpenAPI Generator team + * @link https://openapi-generator.tech +{{^isEnum}} + * @implements \ArrayAccess + * @template TKey int|null + * @template TValue mixed|null +{{/isEnum}} + */ +{{#isEnum}}{{>model_enum}}{{/isEnum}}{{^isEnum}}{{>model_generic}}{{/isEnum}} +{{/model}}{{/models}} diff --git a/templates/php/model_doc.mustache b/templates/php/model_doc.mustache new file mode 100644 index 0000000000..43b0ab6e13 --- /dev/null +++ b/templates/php/model_doc.mustache @@ -0,0 +1,10 @@ +# {{#models}}{{#model}}# {{classname}} + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} |{{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}}{{#defaultValue}} [default to {{{.}}}]{{/defaultValue}} +{{/vars}} + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md){{/model}}{{/models}} diff --git a/templates/php/model_enum.mustache b/templates/php/model_enum.mustache new file mode 100644 index 0000000000..88036f76ff --- /dev/null +++ b/templates/php/model_enum.mustache @@ -0,0 +1,28 @@ +class {{classname}} +{ + /** + * Possible values of this enum + */ + {{#allowableValues}} + {{#enumVars}} + const {{^isString}}NUMBER_{{/isString}}{{{name}}} = {{{value}}}; + + {{/enumVars}} + {{/allowableValues}} + /** + * Gets allowable values of the enum + * @return string[] + */ + public static function getAllowableEnumValues() + { + return [ + {{#allowableValues}} + {{#enumVars}} + self::{{^isString}}NUMBER_{{/isString}}{{{name}}}{{^-last}}, + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + + ]; + } +} diff --git a/templates/php/model_generic.mustache b/templates/php/model_generic.mustache new file mode 100644 index 0000000000..a56a82181e --- /dev/null +++ b/templates/php/model_generic.mustache @@ -0,0 +1,454 @@ +class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^parentSchema}}implements ModelInterface, ArrayAccess, \JsonSerializable{{/parentSchema}} +{ + public const DISCRIMINATOR = {{#discriminator}}'{{discriminatorName}}'{{/discriminator}}{{^discriminator}}null{{/discriminator}}; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = '{{name}}'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + {{#vars}}'{{name}}' => '{{{dataType}}}'{{^-last}}, + {{/-last}}{{/vars}} + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + {{#vars}}'{{name}}' => {{#dataFormat}}'{{{.}}}'{{/dataFormat}}{{^dataFormat}}null{{/dataFormat}}{{^-last}}, + {{/-last}}{{/vars}} + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes{{#parentSchema}} + parent::openAPITypes(){{/parentSchema}}; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats{{#parentSchema}} + parent::openAPIFormats(){{/parentSchema}}; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + {{#vars}}'{{name}}' => '{{baseName}}'{{^-last}}, + {{/-last}}{{/vars}} + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + {{#vars}}'{{name}}' => '{{setter}}'{{^-last}}, + {{/-last}}{{/vars}} + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + {{#vars}}'{{name}}' => '{{getter}}'{{^-last}}, + {{/-last}}{{/vars}} + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return {{#parentSchema}}parent::attributeMap() + {{/parentSchema}}self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return {{#parentSchema}}parent::setters() + {{/parentSchema}}self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return {{#parentSchema}}parent::getters() + {{/parentSchema}}self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + {{#vars}} + {{#isEnum}} + {{#allowableValues}} + {{#enumVars}} + const {{enumName}}_{{{name}}} = {{{value}}}; + {{/enumVars}} + {{/allowableValues}} + {{/isEnum}} + {{/vars}} + + {{#vars}} + {{#isEnum}} + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function {{getter}}AllowableValues() + { + return [ + {{#allowableValues}}{{#enumVars}}self::{{enumName}}_{{{name}}},{{^-last}} + {{/-last}}{{/enumVars}}{{/allowableValues}} + ]; + } + + {{/isEnum}} + {{/vars}} + {{^parentSchema}} + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + {{/parentSchema}} + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + {{#parentSchema}} + parent::__construct($data); + + {{/parentSchema}} + {{#vars}} + $this->container['{{name}}'] = $data['{{name}}'] ?? {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}; + {{/vars}} + {{#discriminator}} + + // Initialize discriminator property with the model name. + $this->container['{{discriminatorName}}'] = static::$openAPIModelName; + {{/discriminator}} + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + {{#parentSchema}} + $invalidProperties = parent::listInvalidProperties(); + {{/parentSchema}} + {{^parentSchema}} + $invalidProperties = []; + {{/parentSchema}} + + {{#vars}} + {{#required}} + if ($this->container['{{name}}'] === null) { + $invalidProperties[] = "'{{name}}' can't be null"; + } + {{/required}} + {{#isEnum}} + {{^isContainer}} + $allowedValues = $this->{{getter}}AllowableValues(); + if (!is_null($this->container['{{name}}']) && !in_array($this->container['{{name}}'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for '{{name}}', must be one of '%s'", + $this->container['{{name}}'], + implode("', '", $allowedValues) + ); + } + + {{/isContainer}} + {{/isEnum}} + {{#hasValidation}} + {{#maxLength}} + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(mb_strlen($this->container['{{name}}']) > {{maxLength}})) { + $invalidProperties[] = "invalid value for '{{name}}', the character length must be smaller than or equal to {{{maxLength}}}."; + } + + {{/maxLength}} + {{#minLength}} + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(mb_strlen($this->container['{{name}}']) < {{minLength}})) { + $invalidProperties[] = "invalid value for '{{name}}', the character length must be bigger than or equal to {{{minLength}}}."; + } + + {{/minLength}} + {{#maximum}} + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}($this->container['{{name}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}})) { + $invalidProperties[] = "invalid value for '{{name}}', must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}."; + } + + {{/maximum}} + {{#minimum}} + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}($this->container['{{name}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}})) { + $invalidProperties[] = "invalid value for '{{name}}', must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}."; + } + + {{/minimum}} + {{#pattern}} + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}!preg_match("{{{pattern}}}", $this->container['{{name}}'])) { + $invalidProperties[] = "invalid value for '{{name}}', must be conform to the pattern {{{pattern}}}."; + } + + {{/pattern}} + {{#maxItems}} + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(count($this->container['{{name}}']) > {{maxItems}})) { + $invalidProperties[] = "invalid value for '{{name}}', number of items must be less than or equal to {{{maxItems}}}."; + } + + {{/maxItems}} + {{#minItems}} + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(count($this->container['{{name}}']) < {{minItems}})) { + $invalidProperties[] = "invalid value for '{{name}}', number of items must be greater than or equal to {{{minItems}}}."; + } + + {{/minItems}} + {{/hasValidation}} + {{/vars}} + 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; + } + + {{#vars}} + + /** + * Gets {{name}} + * + * @return {{{dataType}}}{{^required}}|null{{/required}} + {{#deprecated}} + * @deprecated + {{/deprecated}} + */ + public function {{getter}}() + { + return $this->container['{{name}}']; + } + + /** + * Sets {{name}} + * + * @param {{{dataType}}}{{^required}}|null{{/required}} ${{name}}{{#description}} {{{.}}}{{/description}}{{^description}} {{{name}}}{{/description}} + * + * @return self + {{#deprecated}} + * @deprecated + {{/deprecated}} + */ + public function {{setter}}(${{name}}) + { + {{#isEnum}} + $allowedValues = $this->{{getter}}AllowableValues(); + {{^isContainer}} + if ({{^required}}!is_null(${{name}}) && {{/required}}!in_array(${{{name}}}, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for '{{name}}', must be one of '%s'", + ${{{name}}}, + implode("', '", $allowedValues) + ) + ); + } + {{/isContainer}} + {{#isContainer}} + if ({{^required}}!is_null(${{name}}) && {{/required}}array_diff(${{{name}}}, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for '{{name}}', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + {{/isContainer}} + {{/isEnum}} + {{#hasValidation}} + {{#maxLength}} + if ({{^required}}!is_null(${{name}}) && {{/required}}(mb_strlen(${{name}}) > {{maxLength}})) { + throw new \InvalidArgumentException('invalid length for ${{name}} when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maxLength}}.'); + }{{/maxLength}} + {{#minLength}} + if ({{^required}}!is_null(${{name}}) && {{/required}}(mb_strlen(${{name}}) < {{minLength}})) { + throw new \InvalidArgumentException('invalid length for ${{name}} when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.'); + } + {{/minLength}} + {{#maximum}} + if ({{^required}}!is_null(${{name}}) && {{/required}}(${{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}})) { + throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.'); + } + {{/maximum}} + {{#minimum}} + if ({{^required}}!is_null(${{name}}) && {{/required}}(${{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}})) { + throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.'); + } + {{/minimum}} + {{#pattern}} + if ({{^required}}!is_null(${{name}}) && {{/required}}(!preg_match("{{{pattern}}}", ${{name}}))) { + throw new \InvalidArgumentException("invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}."); + } + {{/pattern}} + {{#maxItems}} + if ({{^required}}!is_null(${{name}}) && {{/required}}(count(${{name}}) > {{maxItems}})) { + throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, number of items must be less than or equal to {{maxItems}}.'); + }{{/maxItems}} + {{#minItems}} + if ({{^required}}!is_null(${{name}}) && {{/required}}(count(${{name}}) < {{minItems}})) { + throw new \InvalidArgumentException('invalid length for ${{name}} when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{minItems}}.'); + } + {{/minItems}} + {{/hasValidation}} + $this->container['{{name}}'] = ${{name}}; + + return $this; + } + {{/vars}} + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/templates/php/model_test.mustache b/templates/php/model_test.mustache new file mode 100644 index 0000000000..c2fffedde4 --- /dev/null +++ b/templates/php/model_test.mustache @@ -0,0 +1,87 @@ +partial_header}} +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Please update the test case below to test the model. + */ + +namespace {{invokerPackage}}\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * {{classname}}Test Class Doc Comment + * + * @category Class + * @description {{description}}{{^description}}{{classname}}{{/description}} + * @package {{invokerPackage}} + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class {{classname}}Test extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "{{classname}}" + */ + public function test{{classname}}() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +{{#vars}} + + /** + * Test attribute "{{name}}" + */ + public function testProperty{{nameInCamelCase}}() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +{{/vars}} +} +{{/model}} +{{/models}} diff --git a/templates/php/partial_header.mustache b/templates/php/partial_header.mustache new file mode 100644 index 0000000000..ef3530aaee --- /dev/null +++ b/templates/php/partial_header.mustache @@ -0,0 +1,18 @@ +/** + {{#appName}} + * {{{.}}} + * + {{/appName}} + {{#appDescription}} + * {{{.}}} + * + {{/appDescription}} + {{#version}} + * The version of the OpenAPI document: {{{.}}} + {{/version}} + {{#infoEmail}} + * Contact: {{{.}}} + {{/infoEmail}} + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: {{{generatorVersion}}} + */ diff --git a/templates/php/php_doc_auth_partial.mustache b/templates/php/php_doc_auth_partial.mustache new file mode 100644 index 0000000000..282150604c --- /dev/null +++ b/templates/php/php_doc_auth_partial.mustache @@ -0,0 +1,23 @@ +{{#hasAuthMethods}}{{#authMethods}} +{{#isBasic}} +{{#isBasicBasic}} +// Configure HTTP basic authorization: {{{name}}} +$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration() + ->setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); +{{/isBasicBasic}} +{{#isBasicBearer}} +// Configure Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} authorization: {{{name}}} +$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); +{{/isBasicBearer}} +{{/isBasic}} +{{#isApiKey}} +// Configure API key authorization: {{{name}}} +$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKeyPrefix('{{{keyParamName}}}', 'Bearer'); +{{/isApiKey}} +{{#isOAuth}} +// Configure OAuth2 access token for authorization: {{{name}}} +$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); +{{/isOAuth}}{{/authMethods}}{{/hasAuthMethods}} diff --git a/templates/php/phpunit.xml.mustache b/templates/php/phpunit.xml.mustache new file mode 100644 index 0000000000..b72fb7c6e7 --- /dev/null +++ b/templates/php/phpunit.xml.mustache @@ -0,0 +1,18 @@ + + + + + {{apiSrcPath}} + {{modelSrcPath}} + + + + + {{apiTestPath}} + {{modelTestPath}} + + + + + + From f87a1dad77a8e3158338fb47719e9d2ada7af96a Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Mon, 10 Jan 2022 16:00:18 +0100 Subject: [PATCH 02/26] feat: add appid/apiKey init --- openapitools.json | 3 +- templates/php/Configuration.mustache | 50 ++++++----- templates/php/api.mustache | 121 --------------------------- 3 files changed, 29 insertions(+), 145 deletions(-) diff --git a/openapitools.json b/openapitools.json index e270452887..bcc5c59068 100644 --- a/openapitools.json +++ b/openapitools.json @@ -135,11 +135,12 @@ "templateDir": "#{cwd}/templates/php/", "config": "#{cwd}/openapitools.json", "output": "#{cwd}/clients/algoliasearch-client-php", - "apiPackage": "src", + "apiPackage": "", "glob": "specs/search/spec.yml", "gitHost": "algolia", "gitUserId": "algolia", "gitRepoId": "algoliasearch-client-php", + "invokerPackage": "Algolia\\AlgoliaSearch", "additionalProperties": { } } diff --git a/templates/php/Configuration.mustache b/templates/php/Configuration.mustache index 408740429a..fd316ffee0 100644 --- a/templates/php/Configuration.mustache +++ b/templates/php/Configuration.mustache @@ -56,18 +56,18 @@ class Configuration protected $accessToken = ''; /** - * Username for HTTP basic authentication + * Algolia Application ID * * @var string */ - protected $username = ''; + protected $appId = ''; /** - * Password for HTTP basic authentication + * Algolia API Key * * @var string */ - protected $password = ''; + protected $algoliaApiKey = ''; /** * The host @@ -107,9 +107,15 @@ class Configuration /** * Constructor */ - public function __construct() + public function __construct(string $appId = null, string $algoliaApiKe = null) { $this->tempFolderPath = sys_get_temp_dir(); + + $this->setAlgoliaApiKey($algoliaApiKey); + $this->setApiKey('X-Algolia-API-Key', $algoliaApiKey); + + $this->setAppId($appId); + $this->setApiKey('X-Algolia-Application-Id', $appId); } /** @@ -188,49 +194,47 @@ class Configuration } /** - * Sets the username for HTTP basic authentication + * Sets the Algolia Application ID * - * @param string $username Username for HTTP basic authentication + * @param string $appId Application ID * * @return $this */ - public function setUsername($username) + public function setAppId($appId = '') { - $this->username = $username; - return $this; + $this->appId = $appId; } /** - * Gets the username for HTTP basic authentication + * Gets the Algolia application ID * - * @return string Username for HTTP basic authentication + * @return string */ - public function getUsername() + public function getAppId() { - return $this->username; + return $this->appId; } /** - * Sets the password for HTTP basic authentication + * Sets the Algolia API Key * - * @param string $password Password for HTTP basic authentication + * @param string $algoliaApiKey Algolia API Key * * @return $this */ - public function setPassword($password) + public function setAlgoliaApiKey($algoliaApiKey = '') { - $this->password = $password; - return $this; + $this->algoliaApiKey = $algoliaApiKey; } /** - * Gets the password for HTTP basic authentication + * Gets the Algolia API Key * - * @return string Password for HTTP basic authentication + * @return string */ - public function getPassword() + public function getAlgoliaApiKey() { - return $this->password; + return $this->algoliaApiKey; } /** diff --git a/templates/php/api.mustache b/templates/php/api.mustache index 60989ca573..d40f4f7882 100644 --- a/templates/php/api.mustache +++ b/templates/php/api.mustache @@ -283,127 +283,6 @@ use {{invokerPackage}}\ObjectSerializer; } } - /** - * Operation {{{operationId}}}Async - * -{{#summary}} - * {{.}} - * -{{/summary}} -{{#description}} - * {{.}} - * -{{/description}} -{{#vendorExtensions.x-group-parameters}} - * Note: the input parameter is an associative array with the keys listed as the parameter name below - * -{{/vendorExtensions.x-group-parameters}} -{{#servers}} -{{#-first}} - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. -{{/-first}} - * URL: {{{url}}} -{{#-last}} - * -{{/-last}} -{{/servers}} -{{#allParams}} - * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} -{{/allParams}} - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - public function {{operationId}}Async({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) - { - return $this->{{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation {{{operationId}}}AsyncWithHttpInfo - * -{{#summary}} - * {{.}} - * -{{/summary}} -{{#description}} - * {{.}} - * -{{/description}} -{{#vendorExtensions.x-group-parameters}} - * Note: the input parameter is an associative array with the keys listed as the parameter name below - * -{{/vendorExtensions.x-group-parameters}} -{{#servers}} -{{#-first}} - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. -{{/-first}} - * URL: {{{url}}} -{{#-last}} - * -{{/-last}} -{{/servers}} -{{#allParams}} - * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} -{{/allParams}} - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - public function {{operationId}}AsyncWithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) - { - $returnType = '{{{returnType}}}'; - $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - {{#returnType}} - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - {{/returnType}} - {{^returnType}} - return [null, $response->getStatusCode(), $response->getHeaders()]; - {{/returnType}} - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - /** * Create request for operation '{{{operationId}}}' * From 5e77ec01ed2dc2a60a3b6ef32f729d4100451cc2 Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Mon, 10 Jan 2022 18:07:43 +0100 Subject: [PATCH 03/26] feat: strippin' like crazy --- templates/php/api.mustache | 425 ++++++++++++++++--------------------- 1 file changed, 185 insertions(+), 240 deletions(-) diff --git a/templates/php/api.mustache b/templates/php/api.mustache index d40f4f7882..7f966da40a 100644 --- a/templates/php/api.mustache +++ b/templates/php/api.mustache @@ -143,173 +143,6 @@ use {{invokerPackage}}\ObjectSerializer; {{/isDeprecated}} */ public function {{operationId}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) - { - {{#returnType}}list($response) = {{/returnType}}$this->{{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}});{{#returnType}} - return $response;{{/returnType}} - } - - /** - * Operation {{{operationId}}}WithHttpInfo -{{#summary}} - * - * {{.}} -{{/summary}} - * -{{#description}} - * {{.}} - * -{{/description}} -{{#vendorExtensions.x-group-parameters}} - * Note: the input parameter is an associative array with the keys listed as the parameter name below - * -{{/vendorExtensions.x-group-parameters}} -{{#servers}} -{{#-first}} - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. -{{/-first}} - * URL: {{{url}}} -{{#-last}} - * -{{/-last}} -{{/servers}} -{{#allParams}} - * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} -{{/allParams}} - * - * @throws \{{invokerPackage}}\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of {{#returnType}}{{#responses}}{{#dataType}}{{^-first}}|{{/-first}}{{/dataType}}{{{dataType}}}{{/responses}}{{/returnType}}{{^returnType}}null{{/returnType}}, HTTP status code, HTTP response headers (array of strings) - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - public function {{operationId}}WithHttpInfo({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) - { - $request = $this->{{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - {{#returnType}} - {{#responses}} - {{#-first}} - - switch($statusCode) { - {{/-first}} - {{#dataType}} - {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} - if ('{{{dataType}}}' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '{{{dataType}}}', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - {{/dataType}} - {{#-last}} - } - {{/-last}} - {{/responses}} - - $returnType = '{{{returnType}}}'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - {{/returnType}} - {{^returnType}} - - return [null, $statusCode, $response->getHeaders()]; - {{/returnType}} - - } catch (ApiException $e) { - switch ($e->getCode()) { - {{#responses}} - {{#dataType}} - {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '{{{dataType}}}', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - {{/dataType}} - {{/responses}} - } - throw $e; - } - } - - /** - * Create request for operation '{{{operationId}}}' - * -{{#vendorExtensions.x-group-parameters}} - * Note: the input parameter is an associative array with the keys listed as the parameter name below - * -{{/vendorExtensions.x-group-parameters}} -{{#servers}} -{{#-first}} - * This operation contains host(s) defined in the OpenAP spec. Use 'hostIndex' to select the host. -{{/-first}} - * URL: {{{url}}} -{{#-last}} - * -{{/-last}} -{{/servers}} -{{#allParams}} - * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} -{{/allParams}} - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - {{#isDeprecated}} - * @deprecated - {{/isDeprecated}} - */ - public function {{operationId}}Request({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^required}} = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associative_array{{/vendorExtensions.x-group-parameters}}) { {{#vendorExtensions.x-group-parameters}} // unbox the parameters from the associative array @@ -368,12 +201,9 @@ use {{invokerPackage}}\ObjectSerializer; {{/allParams}} $resourcePath = '{{{path}}}'; - $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; - $multipart = false; - {{#queryParams}} // query params {{#isExplode}} @@ -402,7 +232,6 @@ use {{invokerPackage}}\ObjectSerializer; } {{/isExplode}} {{/queryParams}} - {{#headerParams}} // header params {{#collectionFormat}} @@ -414,7 +243,6 @@ use {{invokerPackage}}\ObjectSerializer; $headerParams['{{baseName}}'] = ObjectSerializer::toHeaderValue(${{paramName}}); } {{/headerParams}} - {{#pathParams}} // path params {{#collectionFormat}} @@ -430,74 +258,15 @@ use {{invokerPackage}}\ObjectSerializer; ); } {{/pathParams}} - - {{#formParams}} - // form params - if (${{paramName}} !== null) { - {{#isFile}} - $multipart = true; - $formParams['{{baseName}}'] = []; - $paramFiles = is_array(${{paramName}}) ? ${{paramName}} : [${{paramName}}]; - foreach ($paramFiles as $paramFile) { - $formParams['{{baseName}}'][] = \GuzzleHttp\Psr7\Utils::tryFopen( - ObjectSerializer::toFormValue($paramFile), - 'rb' - ); - } - {{/isFile}} - {{^isFile}} - $formParams['{{baseName}}'] = ObjectSerializer::toFormValue(${{paramName}}); - {{/isFile}} - } - {{/formParams}} - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}] - ); - } else { - $headers = $this->headerSelector->selectHeaders( - [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}], - [{{#consumes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}}] - ); - } - - // for model (json/xml) + $headers = $this->headerSelector->selectHeaders( + [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}], + [{{#consumes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}}] + ); {{#bodyParams}} - if (isset(${{paramName}})) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization(${{paramName}})); - } else { - $httpBody = ${{paramName}}; - } - } elseif (count($formParams) > 0) { + if (isset(${{paramName}})) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization(${{paramName}})); + } {{/bodyParams}} - {{^bodyParams}} - if (count($formParams) > 0) { - {{/bodyParams}} - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode($formParams); - - } else { - // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); - } - } - {{#authMethods}} {{#isApiKey}} // this endpoint requires API key authentication @@ -548,14 +317,23 @@ use {{invokerPackage}}\ObjectSerializer; {{/servers.0}} $query = \GuzzleHttp\Psr7\Query::build($queryParams); - return new Request( + $request = new Request( '{{httpMethod}}', {{^servers.0}}$this->config->getHost(){{/servers.0}}{{#servers.0}}$operationHost{{/servers.0}} . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); + + $expectedResponse = null; + {{#responses.0}} + $expectedResponse = '{{responses.0.dataType}}'; + {{/responses.0}} + {{#returnType}}list($response) = {{/returnType}}$this->sendRequest($request, $expectedResponse); + + {{#returnType}} + return $response; + {{/returnType}} } - {{/operation}} /** * Create http client option @@ -575,5 +353,172 @@ use {{invokerPackage}}\ObjectSerializer; return $options; } + + /** + * Send the request and handle the response + * + * @throws \RuntimeException on file opening failure + * @return array + */ + protected function sendRequest($request, $expectedResponse) + { + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if (expectedResponse === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, expectedResponse, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } + + $returnType = $expectedResponse; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + expectedResponse, + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Algolia\AlgoliaSearch\Model\ErrorBase', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Algolia\AlgoliaSearch\Model\ErrorBase', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Algolia\AlgoliaSearch\Model\ErrorBase', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Algolia\AlgoliaSearch\Model\ErrorBase', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } } {{/operations}} From 38b2e5e42518755b0028e36c354f9989d6067754 Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Tue, 11 Jan 2022 14:51:41 +0100 Subject: [PATCH 04/26] feat: add PHP search client --- .gitignore | 2 + clients/algoliasearch-client-php/.gitignore | 14 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 206 + .../.openapi-generator/VERSION | 1 + clients/algoliasearch-client-php/.php_cs | 23 + clients/algoliasearch-client-php/.travis.yml | 9 + clients/algoliasearch-client-php/README.md | 278 + .../algoliasearch-client-php/composer.json | 39 + .../docs/Api/SearchApi.md | 3971 ++++++++++++++ .../docs/Model/Action.md | 8 + .../docs/Model/AddApiKeyResponse.md | 10 + .../docs/Model/Anchoring.md | 8 + .../docs/Model/ApiKey.md | 16 + .../docs/Model/AssignUserIdObject.md | 9 + .../docs/Model/AutomaticFacetFilter.md | 11 + .../docs/Model/BaseBrowseResponse.md | 9 + .../docs/Model/BaseIndexSettings.md | 20 + .../docs/Model/BaseSearchParams.md | 40 + .../docs/Model/BaseSearchResponse.md | 32 + .../Model/BaseSearchResponseFacetsStats.md | 12 + .../docs/Model/BatchAssignUserIdsObject.md | 10 + .../docs/Model/BatchDictionaryEntries.md | 10 + .../Model/BatchDictionaryEntriesRequest.md | 10 + .../docs/Model/BatchObject.md | 9 + .../docs/Model/BatchResponse.md | 10 + .../docs/Model/BatchWriteObject.md | 9 + .../docs/Model/BrowseRequest.md | 10 + .../docs/Model/BrowseResponse.md | 34 + .../docs/Model/BuildInOperation.md | 10 + .../docs/Model/Condition.md | 12 + .../docs/Model/Consequence.md | 13 + .../docs/Model/ConsequenceHide.md | 9 + .../docs/Model/ConsequenceParams.md | 87 + .../docs/Model/CreatedAtObject.md | 9 + .../docs/Model/CreatedAtResponse.md | 9 + .../docs/Model/DeleteApiKeyResponse.md | 9 + .../docs/Model/DeleteSourceResponse.md | 9 + .../docs/Model/DeletedAtResponse.md | 10 + .../docs/Model/DictionaryEntry.md | 14 + .../docs/Model/DictionaryLanguage.md | 9 + .../docs/Model/DictionarySettingsRequest.md | 9 + .../docs/Model/ErrorBase.md | 9 + .../Model/GetDictionarySettingsResponse.md | 9 + .../docs/Model/GetLogsResponse.md | 9 + .../docs/Model/GetLogsResponseInnerQueries.md | 11 + .../docs/Model/GetLogsResponseLogs.md | 23 + .../docs/Model/GetObjectsObject.md | 9 + .../docs/Model/GetObjectsResponse.md | 9 + .../docs/Model/GetTaskResponse.md | 9 + .../docs/Model/GetTopUserIdsResponse.md | 9 + .../docs/Model/HighlightResult.md | 12 + .../docs/Model/Index.md | 19 + .../docs/Model/IndexSettings.md | 64 + .../docs/Model/IndexSettingsAsSearchParams.md | 52 + .../docs/Model/KeyObject.md | 17 + .../docs/Model/Languages.md | 11 + .../docs/Model/ListApiKeysResponse.md | 9 + .../docs/Model/ListClustersResponse.md | 9 + .../docs/Model/ListIndicesResponse.md | 10 + .../docs/Model/ListUserIdsResponse.md | 9 + .../docs/Model/MultipleBatchResponse.md | 10 + .../docs/Model/MultipleGetObjectsObject.md | 11 + .../docs/Model/MultipleQueries.md | 13 + .../docs/Model/MultipleQueriesObject.md | 10 + .../docs/Model/MultipleQueriesResponse.md | 9 + .../docs/Model/Operation.md | 11 + .../docs/Model/OperationIndexObject.md | 11 + .../docs/Model/Params.md | 11 + .../docs/Model/Promote.md | 11 + .../docs/Model/RankingInfo.md | 19 + .../Model/RankingInfoMatchedGeoLocation.md | 11 + .../docs/Model/Record.md | 13 + .../docs/Model/RemoveUserIdResponse.md | 9 + .../docs/Model/ReplaceSourceResponse.md | 9 + .../docs/Model/RequiredSearchParams.md | 9 + .../docs/Model/Rule.md | 14 + .../docs/Model/SaveObjectResponse.md | 11 + .../docs/Model/SaveSynonymResponse.md | 11 + .../docs/Model/SearchDictionaryEntries.md | 12 + .../docs/Model/SearchForFacetValuesRequest.md | 11 + .../Model/SearchForFacetValuesResponse.md | 9 + .../SearchForFacetValuesResponseFacetHits.md | 11 + .../docs/Model/SearchHits.md | 9 + .../docs/Model/SearchParams.md | 86 + .../docs/Model/SearchParamsObject.md | 85 + .../docs/Model/SearchParamsString.md | 9 + .../docs/Model/SearchResponse.md | 33 + .../docs/Model/SearchRulesParams.md | 15 + .../docs/Model/SearchRulesResponse.md | 12 + .../docs/Model/SearchSynonymsResponse.md | 10 + .../docs/Model/SearchUserIdsObject.md | 12 + .../docs/Model/SearchUserIdsResponse.md | 13 + .../SearchUserIdsResponseHighlightResult.md | 10 + .../docs/Model/SearchUserIdsResponseHits.md | 14 + .../docs/Model/SnippetResult.md | 10 + .../docs/Model/Source.md | 10 + .../docs/Model/StandardEntries.md | 11 + .../docs/Model/SynonymHit.md | 17 + .../docs/Model/SynonymHitHighlightResult.md | 10 + .../docs/Model/TimeRange.md | 10 + .../docs/Model/UpdateApiKeyResponse.md | 10 + .../docs/Model/UpdatedAtResponse.md | 10 + .../Model/UpdatedAtWithObjectIdResponse.md | 11 + .../docs/Model/UpdatedRuleResponse.md | 11 + .../docs/Model/UserId.md | 12 + clients/algoliasearch-client-php/git_push.sh | 57 + .../lib/Api/SearchApi.php | 4755 +++++++++++++++++ .../lib/ApiException.php | 120 + .../lib/Configuration.php | 492 ++ .../lib/HeaderSelector.php | 108 + .../lib/Model/Action.php | 78 + .../lib/Model/AddApiKeyResponse.php | 356 ++ .../lib/Model/Anchoring.php | 69 + .../lib/Model/ApiKey.php | 582 ++ .../lib/Model/AssignUserIdObject.php | 324 ++ .../lib/Model/AutomaticFacetFilter.php | 384 ++ .../lib/Model/BaseBrowseResponse.php | 323 ++ .../lib/Model/BaseIndexSettings.php | 650 +++ .../lib/Model/BaseSearchParams.php | 1275 +++++ .../lib/Model/BaseSearchResponse.php | 1046 ++++ .../Model/BaseSearchResponseFacetsStats.php | 410 ++ .../lib/Model/BatchAssignUserIdsObject.php | 357 ++ .../lib/Model/BatchDictionaryEntries.php | 354 ++ .../Model/BatchDictionaryEntriesRequest.php | 390 ++ .../lib/Model/BatchObject.php | 321 ++ .../lib/Model/BatchResponse.php | 350 ++ .../lib/Model/BatchWriteObject.php | 321 ++ .../lib/Model/BrowseRequest.php | 350 ++ .../lib/Model/BrowseResponse.php | 1112 ++++ .../lib/Model/BuildInOperation.php | 401 ++ .../lib/Model/Condition.php | 410 ++ .../lib/Model/Consequence.php | 441 ++ .../lib/Model/ConsequenceHide.php | 324 ++ .../lib/Model/ConsequenceParams.php | 2924 ++++++++++ .../lib/Model/CreatedAtObject.php | 323 ++ .../lib/Model/CreatedAtResponse.php | 324 ++ .../lib/Model/DeleteApiKeyResponse.php | 323 ++ .../lib/Model/DeleteSourceResponse.php | 323 ++ .../lib/Model/DeletedAtResponse.php | 357 ++ .../lib/Model/DictionaryEntry.php | 511 ++ .../lib/Model/DictionaryLanguage.php | 321 ++ .../lib/Model/DictionarySettingsRequest.php | 324 ++ .../lib/Model/ErrorBase.php | 321 ++ .../Model/GetDictionarySettingsResponse.php | 323 ++ .../lib/Model/GetLogsResponse.php | 323 ++ .../lib/Model/GetLogsResponseInnerQueries.php | 380 ++ .../lib/Model/GetLogsResponseLogs.php | 773 +++ .../lib/Model/GetObjectsObject.php | 321 ++ .../lib/Model/GetObjectsResponse.php | 320 ++ .../lib/Model/GetTaskResponse.php | 357 ++ .../lib/Model/GetTopUserIdsResponse.php | 324 ++ .../lib/Model/HighlightResult.php | 447 ++ .../lib/Model/Index.php | 644 +++ .../lib/Model/IndexSettings.php | 2210 ++++++++ .../lib/Model/IndexSettingsAsSearchParams.php | 1849 +++++++ .../lib/Model/KeyObject.php | 614 +++ .../lib/Model/Languages.php | 390 ++ .../lib/Model/ListApiKeysResponse.php | 323 ++ .../lib/Model/ListClustersResponse.php | 324 ++ .../lib/Model/ListIndicesResponse.php | 350 ++ .../lib/Model/ListUserIdsResponse.php | 324 ++ .../lib/Model/ModelInterface.php | 95 + .../lib/Model/MultipleBatchResponse.php | 350 ++ .../lib/Model/MultipleGetObjectsObject.php | 387 ++ .../lib/Model/MultipleQueries.php | 477 ++ .../lib/Model/MultipleQueriesObject.php | 387 ++ .../lib/Model/MultipleQueriesResponse.php | 320 ++ .../lib/Model/Operation.php | 380 ++ .../lib/Model/OperationIndexObject.php | 446 ++ .../lib/Model/Params.php | 381 ++ .../lib/Model/Promote.php | 384 ++ .../lib/Model/RankingInfo.php | 620 +++ .../Model/RankingInfoMatchedGeoLocation.php | 380 ++ .../lib/Model/Record.php | 444 ++ .../lib/Model/RemoveUserIdResponse.php | 323 ++ .../lib/Model/ReplaceSourceResponse.php | 323 ++ .../lib/Model/RequiredSearchParams.php | 323 ++ .../lib/Model/Rule.php | 477 ++ .../lib/Model/SaveObjectResponse.php | 380 ++ .../lib/Model/SaveSynonymResponse.php | 389 ++ .../lib/Model/SearchDictionaryEntries.php | 414 ++ .../lib/Model/SearchForFacetValuesRequest.php | 389 ++ .../Model/SearchForFacetValuesResponse.php | 323 ++ .../SearchForFacetValuesResponseFacetHits.php | 389 ++ .../lib/Model/SearchHits.php | 320 ++ .../lib/Model/SearchParams.php | 2897 ++++++++++ .../lib/Model/SearchParamsObject.php | 2867 ++++++++++ .../lib/Model/SearchParamsString.php | 320 ++ .../lib/Model/SearchResponse.php | 1079 ++++ .../lib/Model/SearchRulesParams.php | 501 ++ .../lib/Model/SearchRulesResponse.php | 422 ++ .../lib/Model/SearchSynonymsResponse.php | 356 ++ .../lib/Model/SearchUserIdsObject.php | 414 ++ .../lib/Model/SearchUserIdsResponse.php | 456 ++ .../SearchUserIdsResponseHighlightResult.php | 356 ++ .../lib/Model/SearchUserIdsResponseHits.php | 488 ++ .../lib/Model/SnippetResult.php | 386 ++ .../lib/Model/Source.php | 354 ++ .../lib/Model/StandardEntries.php | 381 ++ .../lib/Model/SynonymHit.php | 607 +++ .../lib/Model/SynonymHitHighlightResult.php | 351 ++ .../lib/Model/TimeRange.php | 356 ++ .../lib/Model/UpdateApiKeyResponse.php | 356 ++ .../lib/Model/UpdatedAtResponse.php | 357 ++ .../Model/UpdatedAtWithObjectIdResponse.php | 381 ++ .../lib/Model/UpdatedRuleResponse.php | 389 ++ .../lib/Model/UserId.php | 423 ++ .../lib/ObjectSerializer.php | 393 ++ .../algoliasearch-client-php/phpunit.xml.dist | 18 + .../test/Api/SearchApiTest.php | 757 +++ .../test/Model/ActionTest.php | 81 + .../test/Model/AddApiKeyResponseTest.php | 99 + .../test/Model/AnchoringTest.php | 81 + .../test/Model/ApiKeyTest.php | 153 + .../test/Model/AssignUserIdObjectTest.php | 90 + .../test/Model/AutomaticFacetFilterTest.php | 108 + .../test/Model/BaseBrowseResponseTest.php | 90 + .../test/Model/BaseIndexSettingsTest.php | 189 + .../test/Model/BaseSearchParamsTest.php | 369 ++ .../BaseSearchResponseFacetsStatsTest.php | 117 + .../test/Model/BaseSearchResponseTest.php | 297 + .../Model/BatchAssignUserIdsObjectTest.php | 99 + .../BatchDictionaryEntriesRequestTest.php | 99 + .../test/Model/BatchDictionaryEntriesTest.php | 99 + .../test/Model/BatchObjectTest.php | 90 + .../test/Model/BatchResponseTest.php | 99 + .../test/Model/BatchWriteObjectTest.php | 90 + .../test/Model/BrowseRequestTest.php | 99 + .../test/Model/BrowseResponseTest.php | 315 ++ .../test/Model/BuildInOperationTest.php | 99 + .../test/Model/ConditionTest.php | 117 + .../test/Model/ConsequenceHideTest.php | 90 + .../test/Model/ConsequenceParamsTest.php | 792 +++ .../test/Model/ConsequenceTest.php | 126 + .../test/Model/CreatedAtObjectTest.php | 90 + .../test/Model/CreatedAtResponseTest.php | 90 + .../test/Model/DeleteApiKeyResponseTest.php | 90 + .../test/Model/DeleteSourceResponseTest.php | 90 + .../test/Model/DeletedAtResponseTest.php | 99 + .../test/Model/DictionaryEntryTest.php | 135 + .../test/Model/DictionaryLanguageTest.php | 90 + .../Model/DictionarySettingsRequestTest.php | 90 + .../test/Model/ErrorBaseTest.php | 90 + .../GetDictionarySettingsResponseTest.php | 90 + .../Model/GetLogsResponseInnerQueriesTest.php | 108 + .../test/Model/GetLogsResponseLogsTest.php | 216 + .../test/Model/GetLogsResponseTest.php | 90 + .../test/Model/GetObjectsObjectTest.php | 90 + .../test/Model/GetObjectsResponseTest.php | 90 + .../test/Model/GetTaskResponseTest.php | 90 + .../test/Model/GetTopUserIdsResponseTest.php | 90 + .../test/Model/HighlightResultTest.php | 117 + .../Model/IndexSettingsAsSearchParamsTest.php | 477 ++ .../test/Model/IndexSettingsTest.php | 585 ++ .../test/Model/IndexTest.php | 180 + .../test/Model/KeyObjectTest.php | 162 + .../test/Model/LanguagesTest.php | 108 + .../test/Model/ListApiKeysResponseTest.php | 90 + .../test/Model/ListClustersResponseTest.php | 90 + .../test/Model/ListIndicesResponseTest.php | 99 + .../test/Model/ListUserIdsResponseTest.php | 90 + .../test/Model/MultipleBatchResponseTest.php | 99 + .../Model/MultipleGetObjectsObjectTest.php | 108 + .../test/Model/MultipleQueriesObjectTest.php | 99 + .../Model/MultipleQueriesResponseTest.php | 90 + .../test/Model/MultipleQueriesTest.php | 126 + .../test/Model/OperationIndexObjectTest.php | 108 + .../test/Model/OperationTest.php | 108 + .../test/Model/ParamsTest.php | 108 + .../test/Model/PromoteTest.php | 108 + .../RankingInfoMatchedGeoLocationTest.php | 108 + .../test/Model/RankingInfoTest.php | 180 + .../test/Model/RecordTest.php | 126 + .../test/Model/RemoveUserIdResponseTest.php | 90 + .../test/Model/ReplaceSourceResponseTest.php | 90 + .../test/Model/RequiredSearchParamsTest.php | 90 + .../test/Model/RuleTest.php | 135 + .../test/Model/SaveObjectResponseTest.php | 108 + .../test/Model/SaveSynonymResponseTest.php | 108 + .../Model/SearchDictionaryEntriesTest.php | 117 + .../Model/SearchForFacetValuesRequestTest.php | 108 + ...rchForFacetValuesResponseFacetHitsTest.php | 108 + .../SearchForFacetValuesResponseTest.php | 90 + .../test/Model/SearchHitsTest.php | 90 + .../test/Model/SearchParamsObjectTest.php | 774 +++ .../test/Model/SearchParamsStringTest.php | 90 + .../test/Model/SearchParamsTest.php | 783 +++ .../test/Model/SearchResponseTest.php | 306 ++ .../test/Model/SearchRulesParamsTest.php | 144 + .../test/Model/SearchRulesResponseTest.php | 117 + .../test/Model/SearchSynonymsResponseTest.php | 99 + .../test/Model/SearchUserIdsObjectTest.php | 117 + ...archUserIdsResponseHighlightResultTest.php | 99 + .../Model/SearchUserIdsResponseHitsTest.php | 135 + .../test/Model/SearchUserIdsResponseTest.php | 126 + .../test/Model/SnippetResultTest.php | 99 + .../test/Model/SourceTest.php | 99 + .../test/Model/StandardEntriesTest.php | 108 + .../Model/SynonymHitHighlightResultTest.php | 99 + .../test/Model/SynonymHitTest.php | 162 + .../test/Model/TimeRangeTest.php | 99 + .../test/Model/UpdateApiKeyResponseTest.php | 99 + .../test/Model/UpdatedAtResponseTest.php | 99 + .../UpdatedAtWithObjectIdResponseTest.php | 108 + .../test/Model/UpdatedRuleResponseTest.php | 108 + .../test/Model/UserIdTest.php | 117 + openapitools.json | 1 + playground/php/composer.json | 21 + playground/php/composer.lock | 4755 +++++++++++++++++ playground/php/src/search.php | 11 + templates/php/Configuration.mustache | 4 +- templates/php/api.mustache | 26 +- 313 files changed, 82514 insertions(+), 17 deletions(-) create mode 100644 clients/algoliasearch-client-php/.gitignore create mode 100644 clients/algoliasearch-client-php/.openapi-generator-ignore create mode 100644 clients/algoliasearch-client-php/.openapi-generator/FILES create mode 100644 clients/algoliasearch-client-php/.openapi-generator/VERSION create mode 100644 clients/algoliasearch-client-php/.php_cs create mode 100644 clients/algoliasearch-client-php/.travis.yml create mode 100644 clients/algoliasearch-client-php/README.md create mode 100644 clients/algoliasearch-client-php/composer.json create mode 100644 clients/algoliasearch-client-php/docs/Api/SearchApi.md create mode 100644 clients/algoliasearch-client-php/docs/Model/Action.md create mode 100644 clients/algoliasearch-client-php/docs/Model/AddApiKeyResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/Anchoring.md create mode 100644 clients/algoliasearch-client-php/docs/Model/ApiKey.md create mode 100644 clients/algoliasearch-client-php/docs/Model/AssignUserIdObject.md create mode 100644 clients/algoliasearch-client-php/docs/Model/AutomaticFacetFilter.md create mode 100644 clients/algoliasearch-client-php/docs/Model/BaseBrowseResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/BaseIndexSettings.md create mode 100644 clients/algoliasearch-client-php/docs/Model/BaseSearchParams.md create mode 100644 clients/algoliasearch-client-php/docs/Model/BaseSearchResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/BaseSearchResponseFacetsStats.md create mode 100644 clients/algoliasearch-client-php/docs/Model/BatchAssignUserIdsObject.md create mode 100644 clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntries.md create mode 100644 clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntriesRequest.md create mode 100644 clients/algoliasearch-client-php/docs/Model/BatchObject.md create mode 100644 clients/algoliasearch-client-php/docs/Model/BatchResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/BatchWriteObject.md create mode 100644 clients/algoliasearch-client-php/docs/Model/BrowseRequest.md create mode 100644 clients/algoliasearch-client-php/docs/Model/BrowseResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/BuildInOperation.md create mode 100644 clients/algoliasearch-client-php/docs/Model/Condition.md create mode 100644 clients/algoliasearch-client-php/docs/Model/Consequence.md create mode 100644 clients/algoliasearch-client-php/docs/Model/ConsequenceHide.md create mode 100644 clients/algoliasearch-client-php/docs/Model/ConsequenceParams.md create mode 100644 clients/algoliasearch-client-php/docs/Model/CreatedAtObject.md create mode 100644 clients/algoliasearch-client-php/docs/Model/CreatedAtResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/DeleteApiKeyResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/DeleteSourceResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/DeletedAtResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/DictionaryEntry.md create mode 100644 clients/algoliasearch-client-php/docs/Model/DictionaryLanguage.md create mode 100644 clients/algoliasearch-client-php/docs/Model/DictionarySettingsRequest.md create mode 100644 clients/algoliasearch-client-php/docs/Model/ErrorBase.md create mode 100644 clients/algoliasearch-client-php/docs/Model/GetDictionarySettingsResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/GetLogsResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/GetLogsResponseInnerQueries.md create mode 100644 clients/algoliasearch-client-php/docs/Model/GetLogsResponseLogs.md create mode 100644 clients/algoliasearch-client-php/docs/Model/GetObjectsObject.md create mode 100644 clients/algoliasearch-client-php/docs/Model/GetObjectsResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/GetTaskResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/GetTopUserIdsResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/HighlightResult.md create mode 100644 clients/algoliasearch-client-php/docs/Model/Index.md create mode 100644 clients/algoliasearch-client-php/docs/Model/IndexSettings.md create mode 100644 clients/algoliasearch-client-php/docs/Model/IndexSettingsAsSearchParams.md create mode 100644 clients/algoliasearch-client-php/docs/Model/KeyObject.md create mode 100644 clients/algoliasearch-client-php/docs/Model/Languages.md create mode 100644 clients/algoliasearch-client-php/docs/Model/ListApiKeysResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/ListClustersResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/ListIndicesResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/ListUserIdsResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/MultipleBatchResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/MultipleGetObjectsObject.md create mode 100644 clients/algoliasearch-client-php/docs/Model/MultipleQueries.md create mode 100644 clients/algoliasearch-client-php/docs/Model/MultipleQueriesObject.md create mode 100644 clients/algoliasearch-client-php/docs/Model/MultipleQueriesResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/Operation.md create mode 100644 clients/algoliasearch-client-php/docs/Model/OperationIndexObject.md create mode 100644 clients/algoliasearch-client-php/docs/Model/Params.md create mode 100644 clients/algoliasearch-client-php/docs/Model/Promote.md create mode 100644 clients/algoliasearch-client-php/docs/Model/RankingInfo.md create mode 100644 clients/algoliasearch-client-php/docs/Model/RankingInfoMatchedGeoLocation.md create mode 100644 clients/algoliasearch-client-php/docs/Model/Record.md create mode 100644 clients/algoliasearch-client-php/docs/Model/RemoveUserIdResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/ReplaceSourceResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/RequiredSearchParams.md create mode 100644 clients/algoliasearch-client-php/docs/Model/Rule.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SaveObjectResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SaveSynonymResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchDictionaryEntries.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesRequest.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponseFacetHits.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchHits.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchParams.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchParamsObject.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchParamsString.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchRulesParams.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchRulesResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchSynonymsResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchUserIdsObject.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHighlightResult.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHits.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SnippetResult.md create mode 100644 clients/algoliasearch-client-php/docs/Model/Source.md create mode 100644 clients/algoliasearch-client-php/docs/Model/StandardEntries.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SynonymHit.md create mode 100644 clients/algoliasearch-client-php/docs/Model/SynonymHitHighlightResult.md create mode 100644 clients/algoliasearch-client-php/docs/Model/TimeRange.md create mode 100644 clients/algoliasearch-client-php/docs/Model/UpdateApiKeyResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/UpdatedAtResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/UpdatedAtWithObjectIdResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/UpdatedRuleResponse.md create mode 100644 clients/algoliasearch-client-php/docs/Model/UserId.md create mode 100644 clients/algoliasearch-client-php/git_push.sh create mode 100644 clients/algoliasearch-client-php/lib/Api/SearchApi.php create mode 100644 clients/algoliasearch-client-php/lib/ApiException.php create mode 100644 clients/algoliasearch-client-php/lib/Configuration.php create mode 100644 clients/algoliasearch-client-php/lib/HeaderSelector.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Action.php create mode 100644 clients/algoliasearch-client-php/lib/Model/AddApiKeyResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Anchoring.php create mode 100644 clients/algoliasearch-client-php/lib/Model/ApiKey.php create mode 100644 clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php create mode 100644 clients/algoliasearch-client-php/lib/Model/AutomaticFacetFilter.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BaseBrowseResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BaseIndexSettings.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BaseSearchParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BaseSearchResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntries.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BatchObject.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BatchResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BrowseRequest.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BrowseResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BuildInOperation.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Condition.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Consequence.php create mode 100644 clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php create mode 100644 clients/algoliasearch-client-php/lib/Model/ConsequenceParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php create mode 100644 clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/DictionaryEntry.php create mode 100644 clients/algoliasearch-client-php/lib/Model/DictionaryLanguage.php create mode 100644 clients/algoliasearch-client-php/lib/Model/DictionarySettingsRequest.php create mode 100644 clients/algoliasearch-client-php/lib/Model/ErrorBase.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetDictionarySettingsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetLogsResponseLogs.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTaskResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopUserIdsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/HighlightResult.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Index.php create mode 100644 clients/algoliasearch-client-php/lib/Model/IndexSettings.php create mode 100644 clients/algoliasearch-client-php/lib/Model/IndexSettingsAsSearchParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/KeyObject.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Languages.php create mode 100644 clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/ModelInterface.php create mode 100644 clients/algoliasearch-client-php/lib/Model/MultipleBatchResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php create mode 100644 clients/algoliasearch-client-php/lib/Model/MultipleQueries.php create mode 100644 clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php create mode 100644 clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Operation.php create mode 100644 clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Params.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Promote.php create mode 100644 clients/algoliasearch-client-php/lib/Model/RankingInfo.php create mode 100644 clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Record.php create mode 100644 clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/RequiredSearchParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Rule.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchDictionaryEntries.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesRequest.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchHits.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchParamsObject.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchParamsString.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SnippetResult.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Source.php create mode 100644 clients/algoliasearch-client-php/lib/Model/StandardEntries.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SynonymHit.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php create mode 100644 clients/algoliasearch-client-php/lib/Model/TimeRange.php create mode 100644 clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/UserId.php create mode 100644 clients/algoliasearch-client-php/lib/ObjectSerializer.php create mode 100644 clients/algoliasearch-client-php/phpunit.xml.dist create mode 100644 clients/algoliasearch-client-php/test/Api/SearchApiTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/ActionTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/AddApiKeyResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/AnchoringTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/ApiKeyTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/AssignUserIdObjectTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/AutomaticFacetFilterTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/BaseBrowseResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/BaseIndexSettingsTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/BaseSearchParamsTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/BaseSearchResponseFacetsStatsTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/BaseSearchResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/BatchAssignUserIdsObjectTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesRequestTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/BatchObjectTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/BatchResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/BatchWriteObjectTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/BrowseRequestTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/BrowseResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/BuildInOperationTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/ConditionTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/ConsequenceHideTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/ConsequenceParamsTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/ConsequenceTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/CreatedAtObjectTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/CreatedAtResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/DeleteApiKeyResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/DeleteSourceResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/DeletedAtResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/DictionaryEntryTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/DictionaryLanguageTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/DictionarySettingsRequestTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/ErrorBaseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/GetDictionarySettingsResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/GetLogsResponseInnerQueriesTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/GetLogsResponseLogsTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/GetLogsResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/GetObjectsObjectTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/GetObjectsResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/GetTaskResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/GetTopUserIdsResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/HighlightResultTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/IndexSettingsAsSearchParamsTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/IndexSettingsTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/IndexTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/KeyObjectTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/LanguagesTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/ListApiKeysResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/ListClustersResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/ListIndicesResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/ListUserIdsResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/MultipleBatchResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/MultipleGetObjectsObjectTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/MultipleQueriesObjectTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/MultipleQueriesResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/MultipleQueriesTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/OperationIndexObjectTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/OperationTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/ParamsTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/PromoteTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/RankingInfoMatchedGeoLocationTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/RankingInfoTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/RecordTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/RemoveUserIdResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/ReplaceSourceResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/RequiredSearchParamsTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/RuleTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SaveObjectResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SaveSynonymResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchDictionaryEntriesTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchForFacetValuesRequestTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseFacetHitsTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchHitsTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchParamsObjectTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchParamsStringTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchParamsTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchRulesParamsTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchRulesResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchSynonymsResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchUserIdsObjectTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHighlightResultTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHitsTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SnippetResultTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SourceTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/StandardEntriesTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SynonymHitHighlightResultTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/SynonymHitTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/TimeRangeTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/UpdateApiKeyResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/UpdatedAtResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/UpdatedAtWithObjectIdResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/UpdatedRuleResponseTest.php create mode 100644 clients/algoliasearch-client-php/test/Model/UserIdTest.php create mode 100644 playground/php/composer.json create mode 100644 playground/php/composer.lock create mode 100644 playground/php/src/search.php diff --git a/.gitignore b/.gitignore index 154378c78f..41e0c5588f 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ yarn-error.log target **/.DS_Store + +playground/php/vendor diff --git a/clients/algoliasearch-client-php/.gitignore b/clients/algoliasearch-client-php/.gitignore new file mode 100644 index 0000000000..92f7fdeff5 --- /dev/null +++ b/clients/algoliasearch-client-php/.gitignore @@ -0,0 +1,14 @@ +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock + +# php-cs-fixer cache +.php_cs.cache + +# PHPUnit cache +.phpunit.result.cache diff --git a/clients/algoliasearch-client-php/.openapi-generator-ignore b/clients/algoliasearch-client-php/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/clients/algoliasearch-client-php/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/clients/algoliasearch-client-php/.openapi-generator/FILES b/clients/algoliasearch-client-php/.openapi-generator/FILES new file mode 100644 index 0000000000..197db5a5c2 --- /dev/null +++ b/clients/algoliasearch-client-php/.openapi-generator/FILES @@ -0,0 +1,206 @@ +.gitignore +.php_cs +.travis.yml +README.md +composer.json +docs/Api/SearchApi.md +docs/Model/Action.md +docs/Model/AddApiKeyResponse.md +docs/Model/Anchoring.md +docs/Model/ApiKey.md +docs/Model/AssignUserIdObject.md +docs/Model/AutomaticFacetFilter.md +docs/Model/BaseBrowseResponse.md +docs/Model/BaseIndexSettings.md +docs/Model/BaseSearchParams.md +docs/Model/BaseSearchResponse.md +docs/Model/BaseSearchResponseFacetsStats.md +docs/Model/BatchAssignUserIdsObject.md +docs/Model/BatchDictionaryEntries.md +docs/Model/BatchDictionaryEntriesRequest.md +docs/Model/BatchObject.md +docs/Model/BatchResponse.md +docs/Model/BatchWriteObject.md +docs/Model/BrowseRequest.md +docs/Model/BrowseResponse.md +docs/Model/BuildInOperation.md +docs/Model/Condition.md +docs/Model/Consequence.md +docs/Model/ConsequenceHide.md +docs/Model/ConsequenceParams.md +docs/Model/CreatedAtObject.md +docs/Model/CreatedAtResponse.md +docs/Model/DeleteApiKeyResponse.md +docs/Model/DeleteSourceResponse.md +docs/Model/DeletedAtResponse.md +docs/Model/DictionaryEntry.md +docs/Model/DictionaryLanguage.md +docs/Model/DictionarySettingsRequest.md +docs/Model/ErrorBase.md +docs/Model/GetDictionarySettingsResponse.md +docs/Model/GetLogsResponse.md +docs/Model/GetLogsResponseInnerQueries.md +docs/Model/GetLogsResponseLogs.md +docs/Model/GetObjectsObject.md +docs/Model/GetObjectsResponse.md +docs/Model/GetTaskResponse.md +docs/Model/GetTopUserIdsResponse.md +docs/Model/HighlightResult.md +docs/Model/Index.md +docs/Model/IndexSettings.md +docs/Model/IndexSettingsAsSearchParams.md +docs/Model/KeyObject.md +docs/Model/Languages.md +docs/Model/ListApiKeysResponse.md +docs/Model/ListClustersResponse.md +docs/Model/ListIndicesResponse.md +docs/Model/ListUserIdsResponse.md +docs/Model/MultipleBatchResponse.md +docs/Model/MultipleGetObjectsObject.md +docs/Model/MultipleQueries.md +docs/Model/MultipleQueriesObject.md +docs/Model/MultipleQueriesResponse.md +docs/Model/Operation.md +docs/Model/OperationIndexObject.md +docs/Model/Params.md +docs/Model/Promote.md +docs/Model/RankingInfo.md +docs/Model/RankingInfoMatchedGeoLocation.md +docs/Model/Record.md +docs/Model/RemoveUserIdResponse.md +docs/Model/ReplaceSourceResponse.md +docs/Model/RequiredSearchParams.md +docs/Model/Rule.md +docs/Model/SaveObjectResponse.md +docs/Model/SaveSynonymResponse.md +docs/Model/SearchDictionaryEntries.md +docs/Model/SearchForFacetValuesRequest.md +docs/Model/SearchForFacetValuesResponse.md +docs/Model/SearchForFacetValuesResponseFacetHits.md +docs/Model/SearchHits.md +docs/Model/SearchParams.md +docs/Model/SearchParamsObject.md +docs/Model/SearchParamsString.md +docs/Model/SearchResponse.md +docs/Model/SearchRulesParams.md +docs/Model/SearchRulesResponse.md +docs/Model/SearchSynonymsResponse.md +docs/Model/SearchUserIdsObject.md +docs/Model/SearchUserIdsResponse.md +docs/Model/SearchUserIdsResponseHighlightResult.md +docs/Model/SearchUserIdsResponseHits.md +docs/Model/SnippetResult.md +docs/Model/Source.md +docs/Model/StandardEntries.md +docs/Model/SynonymHit.md +docs/Model/SynonymHitHighlightResult.md +docs/Model/TimeRange.md +docs/Model/UpdateApiKeyResponse.md +docs/Model/UpdatedAtResponse.md +docs/Model/UpdatedAtWithObjectIdResponse.md +docs/Model/UpdatedRuleResponse.md +docs/Model/UserId.md +git_push.sh +lib/Api/SearchApi.php +lib/ApiException.php +lib/Configuration.php +lib/HeaderSelector.php +lib/Model/Action.php +lib/Model/AddApiKeyResponse.php +lib/Model/Anchoring.php +lib/Model/ApiKey.php +lib/Model/AssignUserIdObject.php +lib/Model/AutomaticFacetFilter.php +lib/Model/BaseBrowseResponse.php +lib/Model/BaseIndexSettings.php +lib/Model/BaseSearchParams.php +lib/Model/BaseSearchResponse.php +lib/Model/BaseSearchResponseFacetsStats.php +lib/Model/BatchAssignUserIdsObject.php +lib/Model/BatchDictionaryEntries.php +lib/Model/BatchDictionaryEntriesRequest.php +lib/Model/BatchObject.php +lib/Model/BatchResponse.php +lib/Model/BatchWriteObject.php +lib/Model/BrowseRequest.php +lib/Model/BrowseResponse.php +lib/Model/BuildInOperation.php +lib/Model/Condition.php +lib/Model/Consequence.php +lib/Model/ConsequenceHide.php +lib/Model/ConsequenceParams.php +lib/Model/CreatedAtObject.php +lib/Model/CreatedAtResponse.php +lib/Model/DeleteApiKeyResponse.php +lib/Model/DeleteSourceResponse.php +lib/Model/DeletedAtResponse.php +lib/Model/DictionaryEntry.php +lib/Model/DictionaryLanguage.php +lib/Model/DictionarySettingsRequest.php +lib/Model/ErrorBase.php +lib/Model/GetDictionarySettingsResponse.php +lib/Model/GetLogsResponse.php +lib/Model/GetLogsResponseInnerQueries.php +lib/Model/GetLogsResponseLogs.php +lib/Model/GetObjectsObject.php +lib/Model/GetObjectsResponse.php +lib/Model/GetTaskResponse.php +lib/Model/GetTopUserIdsResponse.php +lib/Model/HighlightResult.php +lib/Model/Index.php +lib/Model/IndexSettings.php +lib/Model/IndexSettingsAsSearchParams.php +lib/Model/KeyObject.php +lib/Model/Languages.php +lib/Model/ListApiKeysResponse.php +lib/Model/ListClustersResponse.php +lib/Model/ListIndicesResponse.php +lib/Model/ListUserIdsResponse.php +lib/Model/ModelInterface.php +lib/Model/MultipleBatchResponse.php +lib/Model/MultipleGetObjectsObject.php +lib/Model/MultipleQueries.php +lib/Model/MultipleQueriesObject.php +lib/Model/MultipleQueriesResponse.php +lib/Model/Operation.php +lib/Model/OperationIndexObject.php +lib/Model/Params.php +lib/Model/Promote.php +lib/Model/RankingInfo.php +lib/Model/RankingInfoMatchedGeoLocation.php +lib/Model/Record.php +lib/Model/RemoveUserIdResponse.php +lib/Model/ReplaceSourceResponse.php +lib/Model/RequiredSearchParams.php +lib/Model/Rule.php +lib/Model/SaveObjectResponse.php +lib/Model/SaveSynonymResponse.php +lib/Model/SearchDictionaryEntries.php +lib/Model/SearchForFacetValuesRequest.php +lib/Model/SearchForFacetValuesResponse.php +lib/Model/SearchForFacetValuesResponseFacetHits.php +lib/Model/SearchHits.php +lib/Model/SearchParams.php +lib/Model/SearchParamsObject.php +lib/Model/SearchParamsString.php +lib/Model/SearchResponse.php +lib/Model/SearchRulesParams.php +lib/Model/SearchRulesResponse.php +lib/Model/SearchSynonymsResponse.php +lib/Model/SearchUserIdsObject.php +lib/Model/SearchUserIdsResponse.php +lib/Model/SearchUserIdsResponseHighlightResult.php +lib/Model/SearchUserIdsResponseHits.php +lib/Model/SnippetResult.php +lib/Model/Source.php +lib/Model/StandardEntries.php +lib/Model/SynonymHit.php +lib/Model/SynonymHitHighlightResult.php +lib/Model/TimeRange.php +lib/Model/UpdateApiKeyResponse.php +lib/Model/UpdatedAtResponse.php +lib/Model/UpdatedAtWithObjectIdResponse.php +lib/Model/UpdatedRuleResponse.php +lib/Model/UserId.php +lib/ObjectSerializer.php +phpunit.xml.dist diff --git a/clients/algoliasearch-client-php/.openapi-generator/VERSION b/clients/algoliasearch-client-php/.openapi-generator/VERSION new file mode 100644 index 0000000000..e230c8396d --- /dev/null +++ b/clients/algoliasearch-client-php/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.0 \ No newline at end of file diff --git a/clients/algoliasearch-client-php/.php_cs b/clients/algoliasearch-client-php/.php_cs new file mode 100644 index 0000000000..4fbe53ec5f --- /dev/null +++ b/clients/algoliasearch-client-php/.php_cs @@ -0,0 +1,23 @@ +setUsingCache(true) + ->setRules([ + '@PSR2' => true, + 'ordered_imports' => true, + 'phpdoc_order' => true, + 'array_syntax' => [ 'syntax' => 'short' ], + 'strict_comparison' => true, + 'strict_param' => true, + 'no_trailing_whitespace' => false, + 'no_trailing_whitespace_in_comment' => false, + 'braces' => false, + 'single_blank_line_at_eof' => false, + 'blank_line_after_namespace' => false, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->exclude('test') + ->exclude('tests') + ->in(__DIR__) + ); diff --git a/clients/algoliasearch-client-php/.travis.yml b/clients/algoliasearch-client-php/.travis.yml new file mode 100644 index 0000000000..714772ee93 --- /dev/null +++ b/clients/algoliasearch-client-php/.travis.yml @@ -0,0 +1,9 @@ +language: php +# Bionic environment has preinstalled PHP from 7.1 to 7.4 +# https://docs.travis-ci.com/user/reference/bionic/#php-support +dist: bionic +php: + - 7.3 + - 7.4 +before_install: "composer install" +script: "vendor/bin/phpunit" diff --git a/clients/algoliasearch-client-php/README.md b/clients/algoliasearch-client-php/README.md new file mode 100644 index 0000000000..fdde69b885 --- /dev/null +++ b/clients/algoliasearch-client-php/README.md @@ -0,0 +1,278 @@ +# OpenAPIClient-php + +API powering the Search feature of Algolia. + + +## Installation & Usage + +### Requirements + +PHP 7.3 and later. +Should also work with PHP 8.0 but has not been tested. + +### Composer + +To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: + +```json +{ + "repositories": [ + { + "type": "vcs", + "url": "https://algolia/algolia/algoliasearch-client-php.git" + } + ], + "require": { + "algolia/algoliasearch-client-php": "*@dev" + } +} +``` + +Then run `composer install` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$apiKey = new \Algolia\AlgoliaSearch\Model\ApiKey(); // \Algolia\AlgoliaSearch\Model\ApiKey + +try { + $result = $apiInstance->addApiKey($apiKey); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->addApiKey: ', $e->getMessage(), PHP_EOL; +} + +``` + +## API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*SearchApi* | [**addApiKey**](docs/Api/SearchApi.md#addapikey) | **POST** /1/keys | Create a new API key. +*SearchApi* | [**addOrUpdateObject**](docs/Api/SearchApi.md#addorupdateobject) | **PUT** /1/indexes/{indexName}/{objectID} | Add or replace an object with a given object ID. +*SearchApi* | [**appendSource**](docs/Api/SearchApi.md#appendsource) | **POST** /1/security/sources/append | +*SearchApi* | [**assignUserId**](docs/Api/SearchApi.md#assignuserid) | **POST** /1/clusters/mapping | Assign or Move userID +*SearchApi* | [**batch**](docs/Api/SearchApi.md#batch) | **POST** /1/indexes/{indexName}/batch | +*SearchApi* | [**batchAssignUserIds**](docs/Api/SearchApi.md#batchassignuserids) | **POST** /1/clusters/mapping/batch | Batch assign userIDs +*SearchApi* | [**batchDictionaryEntries**](docs/Api/SearchApi.md#batchdictionaryentries) | **POST** /1/dictionaries/{dictionaryName}/batch | Send a batch of dictionary entries. +*SearchApi* | [**batchRules**](docs/Api/SearchApi.md#batchrules) | **POST** /1/indexes/{indexName}/rules/batch | Batch Rules. +*SearchApi* | [**browse**](docs/Api/SearchApi.md#browse) | **POST** /1/indexes/{indexName}/browse | Retrieve all index content. +*SearchApi* | [**clearAllSynonyms**](docs/Api/SearchApi.md#clearallsynonyms) | **POST** /1/indexes/{indexName}/synonyms/clear | Clear all synonyms. +*SearchApi* | [**clearObjects**](docs/Api/SearchApi.md#clearobjects) | **POST** /1/indexes/{indexName}/clear | clear all objects from an index. +*SearchApi* | [**clearRules**](docs/Api/SearchApi.md#clearrules) | **POST** /1/indexes/{indexName}/rules/clear | Clear Rules. +*SearchApi* | [**deleteApiKey**](docs/Api/SearchApi.md#deleteapikey) | **DELETE** /1/keys/{key} | Delete an API key. +*SearchApi* | [**deleteBy**](docs/Api/SearchApi.md#deleteby) | **POST** /1/indexes/{indexName}/deleteByQuery | Delete all records matching the query. +*SearchApi* | [**deleteIndex**](docs/Api/SearchApi.md#deleteindex) | **DELETE** /1/indexes/{indexName} | Delete index. +*SearchApi* | [**deleteObject**](docs/Api/SearchApi.md#deleteobject) | **DELETE** /1/indexes/{indexName}/{objectID} | Delete object. +*SearchApi* | [**deleteRule**](docs/Api/SearchApi.md#deleterule) | **DELETE** /1/indexes/{indexName}/rules/{objectID} | Delete a rule. +*SearchApi* | [**deleteSource**](docs/Api/SearchApi.md#deletesource) | **DELETE** /1/security/sources/{source} | +*SearchApi* | [**deleteSynonym**](docs/Api/SearchApi.md#deletesynonym) | **DELETE** /1/indexes/{indexName}/synonyms/{objectID} | Delete synonym. +*SearchApi* | [**getApiKey**](docs/Api/SearchApi.md#getapikey) | **GET** /1/keys/{key} | Get an API key. +*SearchApi* | [**getDictionaryLanguages**](docs/Api/SearchApi.md#getdictionarylanguages) | **GET** /1/dictionaries/*/languages | List dictionaries supported per language. +*SearchApi* | [**getDictionarySettings**](docs/Api/SearchApi.md#getdictionarysettings) | **GET** /1/dictionaries/*/settings | Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values. +*SearchApi* | [**getLogs**](docs/Api/SearchApi.md#getlogs) | **GET** /1/logs | +*SearchApi* | [**getObject**](docs/Api/SearchApi.md#getobject) | **GET** /1/indexes/{indexName}/{objectID} | Retrieve one object from the index. +*SearchApi* | [**getObjects**](docs/Api/SearchApi.md#getobjects) | **POST** /1/indexes/*/objects | Retrieve one or more objects. +*SearchApi* | [**getRule**](docs/Api/SearchApi.md#getrule) | **GET** /1/indexes/{indexName}/rules/{objectID} | Get a rule. +*SearchApi* | [**getSettings**](docs/Api/SearchApi.md#getsettings) | **GET** /1/indexes/{indexName}/settings | +*SearchApi* | [**getSources**](docs/Api/SearchApi.md#getsources) | **GET** /1/security/sources | +*SearchApi* | [**getSynonym**](docs/Api/SearchApi.md#getsynonym) | **GET** /1/indexes/{indexName}/synonyms/{objectID} | Get synonym. +*SearchApi* | [**getTask**](docs/Api/SearchApi.md#gettask) | **GET** /1/indexes/{indexName}/task/{taskID} | +*SearchApi* | [**getTopUserIds**](docs/Api/SearchApi.md#gettopuserids) | **GET** /1/clusters/mapping/top | Get top userID +*SearchApi* | [**getUserId**](docs/Api/SearchApi.md#getuserid) | **GET** /1/clusters/mapping/{userID} | Get userID +*SearchApi* | [**hasPendingMappings**](docs/Api/SearchApi.md#haspendingmappings) | **GET** /1/clusters/mapping/pending | Has pending mappings +*SearchApi* | [**listApiKeys**](docs/Api/SearchApi.md#listapikeys) | **GET** /1/keys | Get the full list of API Keys. +*SearchApi* | [**listClusters**](docs/Api/SearchApi.md#listclusters) | **GET** /1/clusters | List clusters +*SearchApi* | [**listIndices**](docs/Api/SearchApi.md#listindices) | **GET** /1/indexes | List existing indexes. +*SearchApi* | [**listUserIds**](docs/Api/SearchApi.md#listuserids) | **GET** /1/clusters/mapping | List userIDs +*SearchApi* | [**multipleBatch**](docs/Api/SearchApi.md#multiplebatch) | **POST** /1/indexes/*/batch | +*SearchApi* | [**multipleQueries**](docs/Api/SearchApi.md#multiplequeries) | **POST** /1/indexes/*/queries | +*SearchApi* | [**operationIndex**](docs/Api/SearchApi.md#operationindex) | **POST** /1/indexes/{indexName}/operation | Copy/move index. +*SearchApi* | [**partialUpdateObject**](docs/Api/SearchApi.md#partialupdateobject) | **POST** /1/indexes/{indexName}/{objectID}/partial | Partially update an object. +*SearchApi* | [**removeUserId**](docs/Api/SearchApi.md#removeuserid) | **DELETE** /1/clusters/mapping/{userID} | Remove userID +*SearchApi* | [**replaceSources**](docs/Api/SearchApi.md#replacesources) | **PUT** /1/security/sources | +*SearchApi* | [**restoreApiKey**](docs/Api/SearchApi.md#restoreapikey) | **POST** /1/keys/{key}/restore | Restore an API key. +*SearchApi* | [**saveObject**](docs/Api/SearchApi.md#saveobject) | **POST** /1/indexes/{indexName} | +*SearchApi* | [**saveRule**](docs/Api/SearchApi.md#saverule) | **PUT** /1/indexes/{indexName}/rules/{objectID} | Save/Update a rule. +*SearchApi* | [**saveSynonym**](docs/Api/SearchApi.md#savesynonym) | **PUT** /1/indexes/{indexName}/synonyms/{objectID} | Save synonym. +*SearchApi* | [**saveSynonyms**](docs/Api/SearchApi.md#savesynonyms) | **POST** /1/indexes/{indexName}/synonyms/batch | Save a batch of synonyms. +*SearchApi* | [**search**](docs/Api/SearchApi.md#search) | **POST** /1/indexes/{indexName}/query | +*SearchApi* | [**searchDictionaryEntries**](docs/Api/SearchApi.md#searchdictionaryentries) | **POST** /1/dictionaries/{dictionaryName}/search | Search the dictionary entries. +*SearchApi* | [**searchForFacetValues**](docs/Api/SearchApi.md#searchforfacetvalues) | **POST** /1/indexes/{indexName}/facets/{facetName}/query | Search for values of a given facet +*SearchApi* | [**searchRules**](docs/Api/SearchApi.md#searchrules) | **POST** /1/indexes/{indexName}/rules/search | Search for rules. +*SearchApi* | [**searchSynonyms**](docs/Api/SearchApi.md#searchsynonyms) | **POST** /1/indexes/{indexName}/synonyms/search | Get all synonyms that match a query. +*SearchApi* | [**searchUserIds**](docs/Api/SearchApi.md#searchuserids) | **POST** /1/clusters/mapping/search | Search userID +*SearchApi* | [**setDictionarySettings**](docs/Api/SearchApi.md#setdictionarysettings) | **PUT** /1/dictionaries/*/settings | Set dictionary settings. +*SearchApi* | [**setSettings**](docs/Api/SearchApi.md#setsettings) | **PUT** /1/indexes/{indexName}/settings | +*SearchApi* | [**updateApiKey**](docs/Api/SearchApi.md#updateapikey) | **PUT** /1/keys/{key} | Update an API key. + +## Models + +- [Action](docs/Model/Action.md) +- [AddApiKeyResponse](docs/Model/AddApiKeyResponse.md) +- [Anchoring](docs/Model/Anchoring.md) +- [ApiKey](docs/Model/ApiKey.md) +- [AssignUserIdObject](docs/Model/AssignUserIdObject.md) +- [AutomaticFacetFilter](docs/Model/AutomaticFacetFilter.md) +- [BaseBrowseResponse](docs/Model/BaseBrowseResponse.md) +- [BaseIndexSettings](docs/Model/BaseIndexSettings.md) +- [BaseSearchParams](docs/Model/BaseSearchParams.md) +- [BaseSearchResponse](docs/Model/BaseSearchResponse.md) +- [BaseSearchResponseFacetsStats](docs/Model/BaseSearchResponseFacetsStats.md) +- [BatchAssignUserIdsObject](docs/Model/BatchAssignUserIdsObject.md) +- [BatchDictionaryEntries](docs/Model/BatchDictionaryEntries.md) +- [BatchDictionaryEntriesRequest](docs/Model/BatchDictionaryEntriesRequest.md) +- [BatchObject](docs/Model/BatchObject.md) +- [BatchResponse](docs/Model/BatchResponse.md) +- [BatchWriteObject](docs/Model/BatchWriteObject.md) +- [BrowseRequest](docs/Model/BrowseRequest.md) +- [BrowseResponse](docs/Model/BrowseResponse.md) +- [BuildInOperation](docs/Model/BuildInOperation.md) +- [Condition](docs/Model/Condition.md) +- [Consequence](docs/Model/Consequence.md) +- [ConsequenceHide](docs/Model/ConsequenceHide.md) +- [ConsequenceParams](docs/Model/ConsequenceParams.md) +- [CreatedAtObject](docs/Model/CreatedAtObject.md) +- [CreatedAtResponse](docs/Model/CreatedAtResponse.md) +- [DeleteApiKeyResponse](docs/Model/DeleteApiKeyResponse.md) +- [DeleteSourceResponse](docs/Model/DeleteSourceResponse.md) +- [DeletedAtResponse](docs/Model/DeletedAtResponse.md) +- [DictionaryEntry](docs/Model/DictionaryEntry.md) +- [DictionaryLanguage](docs/Model/DictionaryLanguage.md) +- [DictionarySettingsRequest](docs/Model/DictionarySettingsRequest.md) +- [ErrorBase](docs/Model/ErrorBase.md) +- [GetDictionarySettingsResponse](docs/Model/GetDictionarySettingsResponse.md) +- [GetLogsResponse](docs/Model/GetLogsResponse.md) +- [GetLogsResponseInnerQueries](docs/Model/GetLogsResponseInnerQueries.md) +- [GetLogsResponseLogs](docs/Model/GetLogsResponseLogs.md) +- [GetObjectsObject](docs/Model/GetObjectsObject.md) +- [GetObjectsResponse](docs/Model/GetObjectsResponse.md) +- [GetTaskResponse](docs/Model/GetTaskResponse.md) +- [GetTopUserIdsResponse](docs/Model/GetTopUserIdsResponse.md) +- [HighlightResult](docs/Model/HighlightResult.md) +- [Index](docs/Model/Index.md) +- [IndexSettings](docs/Model/IndexSettings.md) +- [IndexSettingsAsSearchParams](docs/Model/IndexSettingsAsSearchParams.md) +- [KeyObject](docs/Model/KeyObject.md) +- [Languages](docs/Model/Languages.md) +- [ListApiKeysResponse](docs/Model/ListApiKeysResponse.md) +- [ListClustersResponse](docs/Model/ListClustersResponse.md) +- [ListIndicesResponse](docs/Model/ListIndicesResponse.md) +- [ListUserIdsResponse](docs/Model/ListUserIdsResponse.md) +- [MultipleBatchResponse](docs/Model/MultipleBatchResponse.md) +- [MultipleGetObjectsObject](docs/Model/MultipleGetObjectsObject.md) +- [MultipleQueries](docs/Model/MultipleQueries.md) +- [MultipleQueriesObject](docs/Model/MultipleQueriesObject.md) +- [MultipleQueriesResponse](docs/Model/MultipleQueriesResponse.md) +- [Operation](docs/Model/Operation.md) +- [OperationIndexObject](docs/Model/OperationIndexObject.md) +- [Params](docs/Model/Params.md) +- [Promote](docs/Model/Promote.md) +- [RankingInfo](docs/Model/RankingInfo.md) +- [RankingInfoMatchedGeoLocation](docs/Model/RankingInfoMatchedGeoLocation.md) +- [Record](docs/Model/Record.md) +- [RemoveUserIdResponse](docs/Model/RemoveUserIdResponse.md) +- [ReplaceSourceResponse](docs/Model/ReplaceSourceResponse.md) +- [RequiredSearchParams](docs/Model/RequiredSearchParams.md) +- [Rule](docs/Model/Rule.md) +- [SaveObjectResponse](docs/Model/SaveObjectResponse.md) +- [SaveSynonymResponse](docs/Model/SaveSynonymResponse.md) +- [SearchDictionaryEntries](docs/Model/SearchDictionaryEntries.md) +- [SearchForFacetValuesRequest](docs/Model/SearchForFacetValuesRequest.md) +- [SearchForFacetValuesResponse](docs/Model/SearchForFacetValuesResponse.md) +- [SearchForFacetValuesResponseFacetHits](docs/Model/SearchForFacetValuesResponseFacetHits.md) +- [SearchHits](docs/Model/SearchHits.md) +- [SearchParams](docs/Model/SearchParams.md) +- [SearchParamsObject](docs/Model/SearchParamsObject.md) +- [SearchParamsString](docs/Model/SearchParamsString.md) +- [SearchResponse](docs/Model/SearchResponse.md) +- [SearchRulesParams](docs/Model/SearchRulesParams.md) +- [SearchRulesResponse](docs/Model/SearchRulesResponse.md) +- [SearchSynonymsResponse](docs/Model/SearchSynonymsResponse.md) +- [SearchUserIdsObject](docs/Model/SearchUserIdsObject.md) +- [SearchUserIdsResponse](docs/Model/SearchUserIdsResponse.md) +- [SearchUserIdsResponseHighlightResult](docs/Model/SearchUserIdsResponseHighlightResult.md) +- [SearchUserIdsResponseHits](docs/Model/SearchUserIdsResponseHits.md) +- [SnippetResult](docs/Model/SnippetResult.md) +- [Source](docs/Model/Source.md) +- [StandardEntries](docs/Model/StandardEntries.md) +- [SynonymHit](docs/Model/SynonymHit.md) +- [SynonymHitHighlightResult](docs/Model/SynonymHitHighlightResult.md) +- [TimeRange](docs/Model/TimeRange.md) +- [UpdateApiKeyResponse](docs/Model/UpdateApiKeyResponse.md) +- [UpdatedAtResponse](docs/Model/UpdatedAtResponse.md) +- [UpdatedAtWithObjectIdResponse](docs/Model/UpdatedAtWithObjectIdResponse.md) +- [UpdatedRuleResponse](docs/Model/UpdatedRuleResponse.md) +- [UserId](docs/Model/UserId.md) + +## Authorization + +### apiKey + +- **Type**: API key +- **API key parameter name**: X-Algolia-API-Key +- **Location**: HTTP header + + + +### appId + +- **Type**: API key +- **API key parameter name**: X-Algolia-Application-Id +- **Location**: HTTP header + + +## Tests + +To run the tests, use: + +```bash +composer install +vendor/bin/phpunit +``` + +## Author + + + +## About this package + +This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `0.1.0` +- Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/clients/algoliasearch-client-php/composer.json b/clients/algoliasearch-client-php/composer.json new file mode 100644 index 0000000000..4dbf465eca --- /dev/null +++ b/clients/algoliasearch-client-php/composer.json @@ -0,0 +1,39 @@ +{ + "name": "algolia/algoliasearch-client-php", + "description": "API powering the Search feature of Algolia.", + "keywords": [ + "openapitools", + "openapi-generator", + "openapi", + "php", + "sdk", + "rest", + "api" + ], + "homepage": "https://openapi-generator.tech", + "license": "unlicense", + "authors": [ + { + "name": "OpenAPI-Generator contributors", + "homepage": "https://openapi-generator.tech" + } + ], + "require": { + "php": "^7.3 || ^8.0", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^7.3", + "guzzlehttp/psr7": "^2.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0 || ^9.0", + "friendsofphp/php-cs-fixer": "^2.12" + }, + "autoload": { + "psr-4": { "Algolia\\AlgoliaSearch\\" : "lib/" } + }, + "autoload-dev": { + "psr-4": { "Algolia\\AlgoliaSearch\\Test\\" : "test/" } + } +} diff --git a/clients/algoliasearch-client-php/docs/Api/SearchApi.md b/clients/algoliasearch-client-php/docs/Api/SearchApi.md new file mode 100644 index 0000000000..927acfe1e6 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Api/SearchApi.md @@ -0,0 +1,3971 @@ +# Algolia\AlgoliaSearch\SearchApi + +All URIs are relative to http://localhost. + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addApiKey()**](SearchApi.md#addApiKey) | **POST** /1/keys | Create a new API key. +[**addOrUpdateObject()**](SearchApi.md#addOrUpdateObject) | **PUT** /1/indexes/{indexName}/{objectID} | Add or replace an object with a given object ID. +[**appendSource()**](SearchApi.md#appendSource) | **POST** /1/security/sources/append | +[**assignUserId()**](SearchApi.md#assignUserId) | **POST** /1/clusters/mapping | Assign or Move userID +[**batch()**](SearchApi.md#batch) | **POST** /1/indexes/{indexName}/batch | +[**batchAssignUserIds()**](SearchApi.md#batchAssignUserIds) | **POST** /1/clusters/mapping/batch | Batch assign userIDs +[**batchDictionaryEntries()**](SearchApi.md#batchDictionaryEntries) | **POST** /1/dictionaries/{dictionaryName}/batch | Send a batch of dictionary entries. +[**batchRules()**](SearchApi.md#batchRules) | **POST** /1/indexes/{indexName}/rules/batch | Batch Rules. +[**browse()**](SearchApi.md#browse) | **POST** /1/indexes/{indexName}/browse | Retrieve all index content. +[**clearAllSynonyms()**](SearchApi.md#clearAllSynonyms) | **POST** /1/indexes/{indexName}/synonyms/clear | Clear all synonyms. +[**clearObjects()**](SearchApi.md#clearObjects) | **POST** /1/indexes/{indexName}/clear | clear all objects from an index. +[**clearRules()**](SearchApi.md#clearRules) | **POST** /1/indexes/{indexName}/rules/clear | Clear Rules. +[**deleteApiKey()**](SearchApi.md#deleteApiKey) | **DELETE** /1/keys/{key} | Delete an API key. +[**deleteBy()**](SearchApi.md#deleteBy) | **POST** /1/indexes/{indexName}/deleteByQuery | Delete all records matching the query. +[**deleteIndex()**](SearchApi.md#deleteIndex) | **DELETE** /1/indexes/{indexName} | Delete index. +[**deleteObject()**](SearchApi.md#deleteObject) | **DELETE** /1/indexes/{indexName}/{objectID} | Delete object. +[**deleteRule()**](SearchApi.md#deleteRule) | **DELETE** /1/indexes/{indexName}/rules/{objectID} | Delete a rule. +[**deleteSource()**](SearchApi.md#deleteSource) | **DELETE** /1/security/sources/{source} | +[**deleteSynonym()**](SearchApi.md#deleteSynonym) | **DELETE** /1/indexes/{indexName}/synonyms/{objectID} | Delete synonym. +[**getApiKey()**](SearchApi.md#getApiKey) | **GET** /1/keys/{key} | Get an API key. +[**getDictionaryLanguages()**](SearchApi.md#getDictionaryLanguages) | **GET** /1/dictionaries/*/languages | List dictionaries supported per language. +[**getDictionarySettings()**](SearchApi.md#getDictionarySettings) | **GET** /1/dictionaries/*/settings | Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values. +[**getLogs()**](SearchApi.md#getLogs) | **GET** /1/logs | +[**getObject()**](SearchApi.md#getObject) | **GET** /1/indexes/{indexName}/{objectID} | Retrieve one object from the index. +[**getObjects()**](SearchApi.md#getObjects) | **POST** /1/indexes/*/objects | Retrieve one or more objects. +[**getRule()**](SearchApi.md#getRule) | **GET** /1/indexes/{indexName}/rules/{objectID} | Get a rule. +[**getSettings()**](SearchApi.md#getSettings) | **GET** /1/indexes/{indexName}/settings | +[**getSources()**](SearchApi.md#getSources) | **GET** /1/security/sources | +[**getSynonym()**](SearchApi.md#getSynonym) | **GET** /1/indexes/{indexName}/synonyms/{objectID} | Get synonym. +[**getTask()**](SearchApi.md#getTask) | **GET** /1/indexes/{indexName}/task/{taskID} | +[**getTopUserIds()**](SearchApi.md#getTopUserIds) | **GET** /1/clusters/mapping/top | Get top userID +[**getUserId()**](SearchApi.md#getUserId) | **GET** /1/clusters/mapping/{userID} | Get userID +[**hasPendingMappings()**](SearchApi.md#hasPendingMappings) | **GET** /1/clusters/mapping/pending | Has pending mappings +[**listApiKeys()**](SearchApi.md#listApiKeys) | **GET** /1/keys | Get the full list of API Keys. +[**listClusters()**](SearchApi.md#listClusters) | **GET** /1/clusters | List clusters +[**listIndices()**](SearchApi.md#listIndices) | **GET** /1/indexes | List existing indexes. +[**listUserIds()**](SearchApi.md#listUserIds) | **GET** /1/clusters/mapping | List userIDs +[**multipleBatch()**](SearchApi.md#multipleBatch) | **POST** /1/indexes/*/batch | +[**multipleQueries()**](SearchApi.md#multipleQueries) | **POST** /1/indexes/*/queries | +[**operationIndex()**](SearchApi.md#operationIndex) | **POST** /1/indexes/{indexName}/operation | Copy/move index. +[**partialUpdateObject()**](SearchApi.md#partialUpdateObject) | **POST** /1/indexes/{indexName}/{objectID}/partial | Partially update an object. +[**removeUserId()**](SearchApi.md#removeUserId) | **DELETE** /1/clusters/mapping/{userID} | Remove userID +[**replaceSources()**](SearchApi.md#replaceSources) | **PUT** /1/security/sources | +[**restoreApiKey()**](SearchApi.md#restoreApiKey) | **POST** /1/keys/{key}/restore | Restore an API key. +[**saveObject()**](SearchApi.md#saveObject) | **POST** /1/indexes/{indexName} | +[**saveRule()**](SearchApi.md#saveRule) | **PUT** /1/indexes/{indexName}/rules/{objectID} | Save/Update a rule. +[**saveSynonym()**](SearchApi.md#saveSynonym) | **PUT** /1/indexes/{indexName}/synonyms/{objectID} | Save synonym. +[**saveSynonyms()**](SearchApi.md#saveSynonyms) | **POST** /1/indexes/{indexName}/synonyms/batch | Save a batch of synonyms. +[**search()**](SearchApi.md#search) | **POST** /1/indexes/{indexName}/query | +[**searchDictionaryEntries()**](SearchApi.md#searchDictionaryEntries) | **POST** /1/dictionaries/{dictionaryName}/search | Search the dictionary entries. +[**searchForFacetValues()**](SearchApi.md#searchForFacetValues) | **POST** /1/indexes/{indexName}/facets/{facetName}/query | Search for values of a given facet +[**searchRules()**](SearchApi.md#searchRules) | **POST** /1/indexes/{indexName}/rules/search | Search for rules. +[**searchSynonyms()**](SearchApi.md#searchSynonyms) | **POST** /1/indexes/{indexName}/synonyms/search | Get all synonyms that match a query. +[**searchUserIds()**](SearchApi.md#searchUserIds) | **POST** /1/clusters/mapping/search | Search userID +[**setDictionarySettings()**](SearchApi.md#setDictionarySettings) | **PUT** /1/dictionaries/*/settings | Set dictionary settings. +[**setSettings()**](SearchApi.md#setSettings) | **PUT** /1/indexes/{indexName}/settings | +[**updateApiKey()**](SearchApi.md#updateApiKey) | **PUT** /1/keys/{key} | Update an API key. + + +## `addApiKey()` + +```php +addApiKey($apiKey): \Algolia\AlgoliaSearch\Model\AddApiKeyResponse +``` + +Create a new API key. + +Add a new API Key with specific permissions/restrictions. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$apiKey = new \Algolia\AlgoliaSearch\Model\ApiKey(); // \Algolia\AlgoliaSearch\Model\ApiKey + +try { + $result = $apiInstance->addApiKey($apiKey); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->addApiKey: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **apiKey** | [**\Algolia\AlgoliaSearch\Model\ApiKey**](../Model/ApiKey.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\AddApiKeyResponse**](../Model/AddApiKeyResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `addOrUpdateObject()` + +```php +addOrUpdateObject($indexName, $objectID, $requestBody): \Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse +``` + +Add or replace an object with a given object ID. + +Add or replace an object with a given object ID. If the object does not exist, it will be created. If it already exists, it will be replaced. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$objectID = 123; // string | Unique identifier of an object. +$requestBody = array('key' => new \stdClass); // array | The Algolia object. + +try { + $result = $apiInstance->addOrUpdateObject($indexName, $objectID, $requestBody); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->addOrUpdateObject: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **objectID** | **string**| Unique identifier of an object. | + **requestBody** | [**array**](../Model/object.md)| The Algolia object. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse**](../Model/UpdatedAtWithObjectIdResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `appendSource()` + +```php +appendSource($source): \Algolia\AlgoliaSearch\Model\CreatedAtResponse +``` + + + +Add a single source to the list of allowed sources. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$source = new \Algolia\AlgoliaSearch\Model\Source(); // \Algolia\AlgoliaSearch\Model\Source | The source to add. + +try { + $result = $apiInstance->appendSource($source); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->appendSource: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **source** | [**\Algolia\AlgoliaSearch\Model\Source**](../Model/Source.md)| The source to add. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\CreatedAtResponse**](../Model/CreatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `assignUserId()` + +```php +assignUserId($xAlgoliaUserID, $assignUserIdObject): \Algolia\AlgoliaSearch\Model\CreatedAtResponse +``` + +Assign or Move userID + +Assign or Move a userID to a cluster. The time it takes to migrate (move) a user is proportional to the amount of data linked to the userID. Upon success, the response is 200 OK. A successful response indicates that the operation has been taken into account, and the userID is directly usable. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$xAlgoliaUserID = new \stdClass; // object | userID to assign. +$assignUserIdObject = new \Algolia\AlgoliaSearch\Model\AssignUserIdObject(); // \Algolia\AlgoliaSearch\Model\AssignUserIdObject + +try { + $result = $apiInstance->assignUserId($xAlgoliaUserID, $assignUserIdObject); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->assignUserId: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xAlgoliaUserID** | [**object**](../Model/.md)| userID to assign. | + **assignUserIdObject** | [**\Algolia\AlgoliaSearch\Model\AssignUserIdObject**](../Model/AssignUserIdObject.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\CreatedAtResponse**](../Model/CreatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `batch()` + +```php +batch($indexName, $batchWriteObject): \Algolia\AlgoliaSearch\Model\BatchResponse +``` + + + +Performs multiple write operations in a single API call. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$batchWriteObject = new \Algolia\AlgoliaSearch\Model\BatchWriteObject(); // \Algolia\AlgoliaSearch\Model\BatchWriteObject + +try { + $result = $apiInstance->batch($indexName, $batchWriteObject); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->batch: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **batchWriteObject** | [**\Algolia\AlgoliaSearch\Model\BatchWriteObject**](../Model/BatchWriteObject.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\BatchResponse**](../Model/BatchResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `batchAssignUserIds()` + +```php +batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject): \Algolia\AlgoliaSearch\Model\CreatedAtResponse +``` + +Batch assign userIDs + +Assign multiple userIDs to a cluster. Upon success, the response is 200 OK. A successful response indicates that the operation has been taken into account, and the userIDs are directly usable. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$xAlgoliaUserID = new \stdClass; // object | userID to assign. +$batchAssignUserIdsObject = new \Algolia\AlgoliaSearch\Model\BatchAssignUserIdsObject(); // \Algolia\AlgoliaSearch\Model\BatchAssignUserIdsObject + +try { + $result = $apiInstance->batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->batchAssignUserIds: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xAlgoliaUserID** | [**object**](../Model/.md)| userID to assign. | + **batchAssignUserIdsObject** | [**\Algolia\AlgoliaSearch\Model\BatchAssignUserIdsObject**](../Model/BatchAssignUserIdsObject.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\CreatedAtResponse**](../Model/CreatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `batchDictionaryEntries()` + +```php +batchDictionaryEntries($dictionaryName, $batchDictionaryEntries): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse +``` + +Send a batch of dictionary entries. + +Send a batch of dictionary entries. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$dictionaryName = 'dictionaryName_example'; // string | The dictionary to search in. +$batchDictionaryEntries = new \Algolia\AlgoliaSearch\Model\BatchDictionaryEntries(); // \Algolia\AlgoliaSearch\Model\BatchDictionaryEntries + +try { + $result = $apiInstance->batchDictionaryEntries($dictionaryName, $batchDictionaryEntries); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->batchDictionaryEntries: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dictionaryName** | **string**| The dictionary to search in. | + **batchDictionaryEntries** | [**\Algolia\AlgoliaSearch\Model\BatchDictionaryEntries**](../Model/BatchDictionaryEntries.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `batchRules()` + +```php +batchRules($indexName, $rule, $forwardToReplicas, $clearExistingRules): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse +``` + +Batch Rules. + +Create or update a batch of Rules. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$rule = array(new \Algolia\AlgoliaSearch\Model\Rule()); // \Algolia\AlgoliaSearch\Model\Rule[] +$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. +$clearExistingRules = True; // bool | When true, existing Rules are cleared before adding this batch. When false, existing Rules are kept. + +try { + $result = $apiInstance->batchRules($indexName, $rule, $forwardToReplicas, $clearExistingRules); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->batchRules: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **rule** | [**\Algolia\AlgoliaSearch\Model\Rule[]**](../Model/Rule.md)| | + **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] + **clearExistingRules** | **bool**| When true, existing Rules are cleared before adding this batch. When false, existing Rules are kept. | [optional] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `browse()` + +```php +browse($indexName, $browseRequest): \Algolia\AlgoliaSearch\Model\BrowseResponse +``` + +Retrieve all index content. + +This method allows you to retrieve all index content. It can retrieve up to 1,000 records per call and supports full text search and filters. For performance reasons, some features are not supported, including `distinct`, sorting by `typos`, `words` or `geo distance`. When there is more content to be browsed, the response contains a cursor field. This cursor has to be passed to the subsequent call to browse in order to get the next page of results. When the end of the index has been reached, the cursor field is absent from the response. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$browseRequest = new \Algolia\AlgoliaSearch\Model\BrowseRequest(); // \Algolia\AlgoliaSearch\Model\BrowseRequest + +try { + $result = $apiInstance->browse($indexName, $browseRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->browse: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **browseRequest** | [**\Algolia\AlgoliaSearch\Model\BrowseRequest**](../Model/BrowseRequest.md)| | [optional] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\BrowseResponse**](../Model/BrowseResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `clearAllSynonyms()` + +```php +clearAllSynonyms($indexName, $forwardToReplicas): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse +``` + +Clear all synonyms. + +Remove all synonyms from an index. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. + +try { + $result = $apiInstance->clearAllSynonyms($indexName, $forwardToReplicas); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->clearAllSynonyms: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `clearObjects()` + +```php +clearObjects($indexName): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse +``` + +clear all objects from an index. + +Delete an index's content, but leave settings and index-specific API keys untouched. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. + +try { + $result = $apiInstance->clearObjects($indexName); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->clearObjects: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `clearRules()` + +```php +clearRules($indexName, $forwardToReplicas): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse +``` + +Clear Rules. + +Delete all Rules in the index. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. + +try { + $result = $apiInstance->clearRules($indexName, $forwardToReplicas); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->clearRules: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteApiKey()` + +```php +deleteApiKey($key): \Algolia\AlgoliaSearch\Model\DeleteApiKeyResponse +``` + +Delete an API key. + +Delete an existing API Key. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$key = myAPIKey; // string | API Key string. + +try { + $result = $apiInstance->deleteApiKey($key); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->deleteApiKey: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **key** | **string**| API Key string. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\DeleteApiKeyResponse**](../Model/DeleteApiKeyResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteBy()` + +```php +deleteBy($indexName, $searchParams): \Algolia\AlgoliaSearch\Model\DeletedAtResponse +``` + +Delete all records matching the query. + +Remove all objects matching a filter (including geo filters). This method enables you to delete one or more objects based on filters (numeric, facet, tag or geo queries). It doesn't accept empty filters or a query. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$searchParams = new \Algolia\AlgoliaSearch\Model\SearchParams(); // \Algolia\AlgoliaSearch\Model\SearchParams + +try { + $result = $apiInstance->deleteBy($indexName, $searchParams); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->deleteBy: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **searchParams** | [**\Algolia\AlgoliaSearch\Model\SearchParams**](../Model/SearchParams.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\DeletedAtResponse**](../Model/DeletedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteIndex()` + +```php +deleteIndex($indexName): \Algolia\AlgoliaSearch\Model\DeletedAtResponse +``` + +Delete index. + +Delete an existing index. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. + +try { + $result = $apiInstance->deleteIndex($indexName); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->deleteIndex: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\DeletedAtResponse**](../Model/DeletedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteObject()` + +```php +deleteObject($indexName, $objectID): \Algolia\AlgoliaSearch\Model\DeletedAtResponse +``` + +Delete object. + +Delete an existing object. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$objectID = 123; // string | Unique identifier of an object. + +try { + $result = $apiInstance->deleteObject($indexName, $objectID); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->deleteObject: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **objectID** | **string**| Unique identifier of an object. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\DeletedAtResponse**](../Model/DeletedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteRule()` + +```php +deleteRule($indexName, $objectID, $forwardToReplicas): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse +``` + +Delete a rule. + +Delete the Rule with the specified objectID. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$objectID = 123; // string | Unique identifier of an object. +$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. + +try { + $result = $apiInstance->deleteRule($indexName, $objectID, $forwardToReplicas); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->deleteRule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **objectID** | **string**| Unique identifier of an object. | + **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteSource()` + +```php +deleteSource($source): \Algolia\AlgoliaSearch\Model\DeleteSourceResponse +``` + + + +Remove a single source from the list of allowed sources. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$source = 10.0.0.1/32; // string | The IP range of the source. + +try { + $result = $apiInstance->deleteSource($source); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->deleteSource: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **source** | **string**| The IP range of the source. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\DeleteSourceResponse**](../Model/DeleteSourceResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `deleteSynonym()` + +```php +deleteSynonym($indexName, $objectID, $forwardToReplicas): \Algolia\AlgoliaSearch\Model\DeletedAtResponse +``` + +Delete synonym. + +Delete a single synonyms set, identified by the given objectID. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$objectID = 123; // string | Unique identifier of an object. +$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. + +try { + $result = $apiInstance->deleteSynonym($indexName, $objectID, $forwardToReplicas); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->deleteSynonym: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **objectID** | **string**| Unique identifier of an object. | + **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\DeletedAtResponse**](../Model/DeletedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getApiKey()` + +```php +getApiKey($key): \Algolia\AlgoliaSearch\Model\KeyObject +``` + +Get an API key. + +Get the permissions of an API key. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$key = myAPIKey; // string | API Key string. + +try { + $result = $apiInstance->getApiKey($key); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->getApiKey: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **key** | **string**| API Key string. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\KeyObject**](../Model/KeyObject.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDictionaryLanguages()` + +```php +getDictionaryLanguages(): array +``` + +List dictionaries supported per language. + +List dictionaries supported per language. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->getDictionaryLanguages(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->getDictionaryLanguages: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**array**](../Model/Languages.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getDictionarySettings()` + +```php +getDictionarySettings(): \Algolia\AlgoliaSearch\Model\GetDictionarySettingsResponse +``` + +Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values. + +Retrieve dictionaries settings. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->getDictionarySettings(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->getDictionarySettings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Algolia\AlgoliaSearch\Model\GetDictionarySettingsResponse**](../Model/GetDictionarySettingsResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getLogs()` + +```php +getLogs($offset, $length, $indexName, $type): \Algolia\AlgoliaSearch\Model\GetLogsResponse +``` + + + +Return the lastest log entries. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$offset = 0; // int | First entry to retrieve (zero-based). Log entries are sorted by decreasing date, therefore 0 designates the most recent log entry. +$length = 10; // int | Maximum number of entries to retrieve. The maximum allowed value is 1000. +$indexName = 'indexName_example'; // string | Index for which log entries should be retrieved. When omitted, log entries are retrieved across all indices. +$type = 'all'; // string | Type of log entries to retrieve. When omitted, all log entries are retrieved. + +try { + $result = $apiInstance->getLogs($offset, $length, $indexName, $type); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->getLogs: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **offset** | **int**| First entry to retrieve (zero-based). Log entries are sorted by decreasing date, therefore 0 designates the most recent log entry. | [optional] [default to 0] + **length** | **int**| Maximum number of entries to retrieve. The maximum allowed value is 1000. | [optional] [default to 10] + **indexName** | **string**| Index for which log entries should be retrieved. When omitted, log entries are retrieved across all indices. | [optional] + **type** | **string**| Type of log entries to retrieve. When omitted, all log entries are retrieved. | [optional] [default to 'all'] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\GetLogsResponse**](../Model/GetLogsResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getObject()` + +```php +getObject($indexName, $objectID, $attributesToRetrieve): array +``` + +Retrieve one object from the index. + +Retrieve one object from the index. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$objectID = 123; // string | Unique identifier of an object. +$attributesToRetrieve = array('attributesToRetrieve_example'); // string[] + +try { + $result = $apiInstance->getObject($indexName, $objectID, $attributesToRetrieve); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->getObject: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **objectID** | **string**| Unique identifier of an object. | + **attributesToRetrieve** | [**string[]**](../Model/string.md)| | [optional] + +### Return type + +**array** + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getObjects()` + +```php +getObjects($getObjectsObject): \Algolia\AlgoliaSearch\Model\GetObjectsResponse +``` + +Retrieve one or more objects. + +Retrieve one or more objects, potentially from different indices, in a single API call. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$getObjectsObject = new \Algolia\AlgoliaSearch\Model\GetObjectsObject(); // \Algolia\AlgoliaSearch\Model\GetObjectsObject + +try { + $result = $apiInstance->getObjects($getObjectsObject); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->getObjects: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **getObjectsObject** | [**\Algolia\AlgoliaSearch\Model\GetObjectsObject**](../Model/GetObjectsObject.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\GetObjectsResponse**](../Model/GetObjectsResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getRule()` + +```php +getRule($indexName, $objectID): \Algolia\AlgoliaSearch\Model\Rule +``` + +Get a rule. + +Retrieve the Rule with the specified objectID. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$objectID = 123; // string | Unique identifier of an object. + +try { + $result = $apiInstance->getRule($indexName, $objectID); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->getRule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **objectID** | **string**| Unique identifier of an object. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\Rule**](../Model/Rule.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSettings()` + +```php +getSettings($indexName): \Algolia\AlgoliaSearch\Model\IndexSettings +``` + + + +Retrieve settings of a given indexName. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. + +try { + $result = $apiInstance->getSettings($indexName); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->getSettings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\IndexSettings**](../Model/IndexSettings.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSources()` + +```php +getSources(): \Algolia\AlgoliaSearch\Model\Source[] +``` + + + +List all allowed sources. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->getSources(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->getSources: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Algolia\AlgoliaSearch\Model\Source[]**](../Model/Source.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getSynonym()` + +```php +getSynonym($indexName, $objectID): \Algolia\AlgoliaSearch\Model\SynonymHit +``` + +Get synonym. + +Fetch a synonym object identified by its objectID. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$objectID = 123; // string | Unique identifier of an object. + +try { + $result = $apiInstance->getSynonym($indexName, $objectID); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->getSynonym: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **objectID** | **string**| Unique identifier of an object. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\SynonymHit**](../Model/SynonymHit.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getTask()` + +```php +getTask($indexName, $taskID): \Algolia\AlgoliaSearch\Model\GetTaskResponse +``` + + + +Check the current status of a given task. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$taskID = 13235; // int | Unique identifier of an task. Numeric value (up to 64bits) + +try { + $result = $apiInstance->getTask($indexName, $taskID); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->getTask: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **taskID** | **int**| Unique identifier of an task. Numeric value (up to 64bits) | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\GetTaskResponse**](../Model/GetTaskResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getTopUserIds()` + +```php +getTopUserIds(): \Algolia\AlgoliaSearch\Model\GetTopUserIdsResponse +``` + +Get top userID + +Get the top 10 userIDs with the highest number of records per cluster. The data returned will usually be a few seconds behind real time, because userID usage may take up to a few seconds to propagate to the different clusters. Upon success, the response is 200 OK and contains the following array of userIDs and clusters. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->getTopUserIds(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->getTopUserIds: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Algolia\AlgoliaSearch\Model\GetTopUserIdsResponse**](../Model/GetTopUserIdsResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `getUserId()` + +```php +getUserId($userID): \Algolia\AlgoliaSearch\Model\UserId +``` + +Get userID + +Returns the userID data stored in the mapping. The data returned will usually be a few seconds behind real time, because userID usage may take up to a few seconds to propagate to the different clusters. Upon success, the response is 200 OK and contains the following userID data. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$userID = new \stdClass; // object | userID to assign. + +try { + $result = $apiInstance->getUserId($userID); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->getUserId: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userID** | [**object**](../Model/.md)| userID to assign. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UserId**](../Model/UserId.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `hasPendingMappings()` + +```php +hasPendingMappings($getClusters): \Algolia\AlgoliaSearch\Model\CreatedAtResponse +``` + +Has pending mappings + +Get the status of your clusters' migrations or user creations. Creating a large batch of users or migrating your multi-cluster may take quite some time. This method lets you retrieve the status of the migration, so you can know when it's done. Upon success, the response is 200 OK. A successful response indicates that the operation has been taken into account, and the userIDs are directly usable. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$getClusters = True; // bool + +try { + $result = $apiInstance->hasPendingMappings($getClusters); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->hasPendingMappings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **getClusters** | **bool**| | [optional] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\CreatedAtResponse**](../Model/CreatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listApiKeys()` + +```php +listApiKeys(): \Algolia\AlgoliaSearch\Model\ListApiKeysResponse +``` + +Get the full list of API Keys. + +List API keys, along with their associated rights. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->listApiKeys(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->listApiKeys: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Algolia\AlgoliaSearch\Model\ListApiKeysResponse**](../Model/ListApiKeysResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listClusters()` + +```php +listClusters(): \Algolia\AlgoliaSearch\Model\ListClustersResponse +``` + +List clusters + +List the clusters available in a multi-clusters setup for a single appID. Upon success, the response is 200 OK and contains the following clusters. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->listClusters(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->listClusters: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\Algolia\AlgoliaSearch\Model\ListClustersResponse**](../Model/ListClustersResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listIndices()` + +```php +listIndices($page): \Algolia\AlgoliaSearch\Model\ListIndicesResponse +``` + +List existing indexes. + +List existing indexes from an application. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$page = 56; // int | Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). + +try { + $result = $apiInstance->listIndices($page); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->listIndices: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int**| Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). | [optional] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\ListIndicesResponse**](../Model/ListIndicesResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `listUserIds()` + +```php +listUserIds($page, $hitsPerPage): \Algolia\AlgoliaSearch\Model\ListUserIdsResponse +``` + +List userIDs + +List the userIDs assigned to a multi-clusters appID. The data returned will usually be a few seconds behind real time, because userID usage may take up to a few seconds to propagate to the different clusters. Upon success, the response is 200 OK and contains the following userIDs data. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$page = 56; // int | Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). +$hitsPerPage = 100; // int | Maximum number of objects to retrieve. + +try { + $result = $apiInstance->listUserIds($page, $hitsPerPage); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->listUserIds: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int**| Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). | [optional] + **hitsPerPage** | **int**| Maximum number of objects to retrieve. | [optional] [default to 100] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\ListUserIdsResponse**](../Model/ListUserIdsResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `multipleBatch()` + +```php +multipleBatch($batchObject): \Algolia\AlgoliaSearch\Model\MultipleBatchResponse +``` + + + +Perform multiple write operations, potentially targeting multiple indices, in a single API call. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$batchObject = new \Algolia\AlgoliaSearch\Model\BatchObject(); // \Algolia\AlgoliaSearch\Model\BatchObject + +try { + $result = $apiInstance->multipleBatch($batchObject); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->multipleBatch: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **batchObject** | [**\Algolia\AlgoliaSearch\Model\BatchObject**](../Model/BatchObject.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\MultipleBatchResponse**](../Model/MultipleBatchResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `multipleQueries()` + +```php +multipleQueries($multipleQueriesObject): \Algolia\AlgoliaSearch\Model\MultipleQueriesResponse +``` + + + +Get search results for the given requests. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$multipleQueriesObject = new \Algolia\AlgoliaSearch\Model\MultipleQueriesObject(); // \Algolia\AlgoliaSearch\Model\MultipleQueriesObject + +try { + $result = $apiInstance->multipleQueries($multipleQueriesObject); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->multipleQueries: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **multipleQueriesObject** | [**\Algolia\AlgoliaSearch\Model\MultipleQueriesObject**](../Model/MultipleQueriesObject.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\MultipleQueriesResponse**](../Model/MultipleQueriesResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `operationIndex()` + +```php +operationIndex($indexName, $operationIndexObject): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse +``` + +Copy/move index. + +Peforms a copy or a move operation on a index. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$operationIndexObject = new \Algolia\AlgoliaSearch\Model\OperationIndexObject(); // \Algolia\AlgoliaSearch\Model\OperationIndexObject + +try { + $result = $apiInstance->operationIndex($indexName, $operationIndexObject); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->operationIndex: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **operationIndexObject** | [**\Algolia\AlgoliaSearch\Model\OperationIndexObject**](../Model/OperationIndexObject.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `partialUpdateObject()` + +```php +partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOperation, $createIfNotExists): \Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse +``` + +Partially update an object. + +Update one or more attributes of an existing object. This method lets you update only a part of an existing object, either by adding new attributes or updating existing ones. You can partially update several objects in a single method call. If the index targeted by this operation doesn't exist yet, it's automatically created. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$objectID = 123; // string | Unique identifier of an object. +$oneOfStringBuildInOperation = NULL; // array[] | The Algolia object. +$createIfNotExists = true; // bool | Creates the record if it does not exist yet. + +try { + $result = $apiInstance->partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOperation, $createIfNotExists); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->partialUpdateObject: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **objectID** | **string**| Unique identifier of an object. | + **oneOfStringBuildInOperation** | [**array[]**](../Model/array.md)| The Algolia object. | + **createIfNotExists** | **bool**| Creates the record if it does not exist yet. | [optional] [default to true] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse**](../Model/UpdatedAtWithObjectIdResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `removeUserId()` + +```php +removeUserId($userID): \Algolia\AlgoliaSearch\Model\RemoveUserIdResponse +``` + +Remove userID + +Remove a userID and its associated data from the multi-clusters. Upon success, the response is 200 OK and a task is created to remove the userID data and mapping. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$userID = new \stdClass; // object | userID to assign. + +try { + $result = $apiInstance->removeUserId($userID); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->removeUserId: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **userID** | [**object**](../Model/.md)| userID to assign. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\RemoveUserIdResponse**](../Model/RemoveUserIdResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `replaceSources()` + +```php +replaceSources($source): \Algolia\AlgoliaSearch\Model\ReplaceSourceResponse +``` + + + +Replace all allowed sources. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$source = array(new \Algolia\AlgoliaSearch\Model\Source()); // \Algolia\AlgoliaSearch\Model\Source[] | The sources to allow. + +try { + $result = $apiInstance->replaceSources($source); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->replaceSources: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **source** | [**\Algolia\AlgoliaSearch\Model\Source[]**](../Model/Source.md)| The sources to allow. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\ReplaceSourceResponse**](../Model/ReplaceSourceResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `restoreApiKey()` + +```php +restoreApiKey($key): \Algolia\AlgoliaSearch\Model\AddApiKeyResponse +``` + +Restore an API key. + +Restore a deleted API key, along with its associated rights. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$key = myAPIKey; // string | API Key string. + +try { + $result = $apiInstance->restoreApiKey($key); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->restoreApiKey: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **key** | **string**| API Key string. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\AddApiKeyResponse**](../Model/AddApiKeyResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `saveObject()` + +```php +saveObject($indexName, $requestBody): \Algolia\AlgoliaSearch\Model\SaveObjectResponse +``` + + + +Add an object to the index, automatically assigning it an object ID. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$requestBody = array('key' => new \stdClass); // array | The Algolia object. + +try { + $result = $apiInstance->saveObject($indexName, $requestBody); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->saveObject: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **requestBody** | [**array**](../Model/object.md)| The Algolia object. | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\SaveObjectResponse**](../Model/SaveObjectResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `saveRule()` + +```php +saveRule($indexName, $objectID, $rule, $forwardToReplicas): \Algolia\AlgoliaSearch\Model\UpdatedRuleResponse +``` + +Save/Update a rule. + +Create or update the Rule with the specified objectID. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$objectID = 123; // string | Unique identifier of an object. +$rule = new \Algolia\AlgoliaSearch\Model\Rule(); // \Algolia\AlgoliaSearch\Model\Rule +$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. + +try { + $result = $apiInstance->saveRule($indexName, $objectID, $rule, $forwardToReplicas); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->saveRule: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **objectID** | **string**| Unique identifier of an object. | + **rule** | [**\Algolia\AlgoliaSearch\Model\Rule**](../Model/Rule.md)| | + **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdatedRuleResponse**](../Model/UpdatedRuleResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `saveSynonym()` + +```php +saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplicas): \Algolia\AlgoliaSearch\Model\SaveSynonymResponse +``` + +Save synonym. + +Create a new synonym object or update the existing synonym object with the given object ID. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$objectID = 123; // string | Unique identifier of an object. +$synonymHit = new \Algolia\AlgoliaSearch\Model\SynonymHit(); // \Algolia\AlgoliaSearch\Model\SynonymHit +$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. + +try { + $result = $apiInstance->saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplicas); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->saveSynonym: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **objectID** | **string**| Unique identifier of an object. | + **synonymHit** | [**\Algolia\AlgoliaSearch\Model\SynonymHit**](../Model/SynonymHit.md)| | + **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\SaveSynonymResponse**](../Model/SaveSynonymResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `saveSynonyms()` + +```php +saveSynonyms($indexName, $synonymHit, $forwardToReplicas, $replaceExistingSynonyms): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse +``` + +Save a batch of synonyms. + +Create/update multiple synonym objects at once, potentially replacing the entire list of synonyms if replaceExistingSynonyms is true. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$synonymHit = array(new \Algolia\AlgoliaSearch\Model\SynonymHit()); // \Algolia\AlgoliaSearch\Model\SynonymHit[] +$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. +$replaceExistingSynonyms = True; // bool | Replace all synonyms of the index with the ones sent with this request. + +try { + $result = $apiInstance->saveSynonyms($indexName, $synonymHit, $forwardToReplicas, $replaceExistingSynonyms); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->saveSynonyms: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **synonymHit** | [**\Algolia\AlgoliaSearch\Model\SynonymHit[]**](../Model/SynonymHit.md)| | + **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] + **replaceExistingSynonyms** | **bool**| Replace all synonyms of the index with the ones sent with this request. | [optional] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `search()` + +```php +search($indexName, $searchParams): \Algolia\AlgoliaSearch\Model\SearchResponse +``` + + + +Get search results. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$searchParams = new \Algolia\AlgoliaSearch\Model\SearchParams(); // \Algolia\AlgoliaSearch\Model\SearchParams + +try { + $result = $apiInstance->search($indexName, $searchParams); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->search: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **searchParams** | [**\Algolia\AlgoliaSearch\Model\SearchParams**](../Model/SearchParams.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\SearchResponse**](../Model/SearchResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `searchDictionaryEntries()` + +```php +searchDictionaryEntries($dictionaryName, $searchDictionaryEntries): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse +``` + +Search the dictionary entries. + +Search the dictionary entries. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$dictionaryName = 'dictionaryName_example'; // string | The dictionary to search in. +$searchDictionaryEntries = new \Algolia\AlgoliaSearch\Model\SearchDictionaryEntries(); // \Algolia\AlgoliaSearch\Model\SearchDictionaryEntries + +try { + $result = $apiInstance->searchDictionaryEntries($dictionaryName, $searchDictionaryEntries); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->searchDictionaryEntries: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dictionaryName** | **string**| The dictionary to search in. | + **searchDictionaryEntries** | [**\Algolia\AlgoliaSearch\Model\SearchDictionaryEntries**](../Model/SearchDictionaryEntries.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `searchForFacetValues()` + +```php +searchForFacetValues($indexName, $facetName, $searchForFacetValuesRequest): \Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponse +``` + +Search for values of a given facet + +Search for values of a given facet, optionally restricting the returned values to those contained in objects matching other search criteria. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$facetName = 'facetName_example'; // string | The facet name. +$searchForFacetValuesRequest = new \Algolia\AlgoliaSearch\Model\SearchForFacetValuesRequest(); // \Algolia\AlgoliaSearch\Model\SearchForFacetValuesRequest + +try { + $result = $apiInstance->searchForFacetValues($indexName, $facetName, $searchForFacetValuesRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->searchForFacetValues: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **facetName** | **string**| The facet name. | + **searchForFacetValuesRequest** | [**\Algolia\AlgoliaSearch\Model\SearchForFacetValuesRequest**](../Model/SearchForFacetValuesRequest.md)| | [optional] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponse**](../Model/SearchForFacetValuesResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `searchRules()` + +```php +searchRules($indexName, $searchRulesParams): \Algolia\AlgoliaSearch\Model\SearchRulesResponse +``` + +Search for rules. + +Search for rules matching various criteria. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$searchRulesParams = new \Algolia\AlgoliaSearch\Model\SearchRulesParams(); // \Algolia\AlgoliaSearch\Model\SearchRulesParams + +try { + $result = $apiInstance->searchRules($indexName, $searchRulesParams); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->searchRules: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **searchRulesParams** | [**\Algolia\AlgoliaSearch\Model\SearchRulesParams**](../Model/SearchRulesParams.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\SearchRulesResponse**](../Model/SearchRulesResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `searchSynonyms()` + +```php +searchSynonyms($indexName, $query, $type, $page, $hitsPerPage): \Algolia\AlgoliaSearch\Model\SearchSynonymsResponse +``` + +Get all synonyms that match a query. + +Search or browse all synonyms, optionally filtering them by type. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$query = ''; // string | Search for specific synonyms matching this string. +$type = 'type_example'; // string | Only search for specific types of synonyms. +$page = 0; // int | Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). +$hitsPerPage = 100; // int | Maximum number of objects to retrieve. + +try { + $result = $apiInstance->searchSynonyms($indexName, $query, $type, $page, $hitsPerPage); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->searchSynonyms: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **query** | **string**| Search for specific synonyms matching this string. | [optional] [default to ''] + **type** | **string**| Only search for specific types of synonyms. | [optional] + **page** | **int**| Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). | [optional] [default to 0] + **hitsPerPage** | **int**| Maximum number of objects to retrieve. | [optional] [default to 100] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\SearchSynonymsResponse**](../Model/SearchSynonymsResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `searchUserIds()` + +```php +searchUserIds($searchUserIdsObject): \Algolia\AlgoliaSearch\Model\SearchUserIdsResponse +``` + +Search userID + +Search for userIDs. The data returned will usually be a few seconds behind real time, because userID usage may take up to a few seconds propagate to the different clusters. To keep updates moving quickly, the index of userIDs isn't built synchronously with the mapping. Instead, the index is built once every 12h, at the same time as the update of userID usage. For example, when you perform a modification like adding or moving a userID, the search will report an outdated value until the next rebuild of the mapping, which takes place every 12h. Upon success, the response is 200 OK and contains the following userIDs data. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$searchUserIdsObject = new \Algolia\AlgoliaSearch\Model\SearchUserIdsObject(); // \Algolia\AlgoliaSearch\Model\SearchUserIdsObject + +try { + $result = $apiInstance->searchUserIds($searchUserIdsObject); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->searchUserIds: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **searchUserIdsObject** | [**\Algolia\AlgoliaSearch\Model\SearchUserIdsObject**](../Model/SearchUserIdsObject.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\SearchUserIdsResponse**](../Model/SearchUserIdsResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setDictionarySettings()` + +```php +setDictionarySettings($dictionarySettingsRequest): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse +``` + +Set dictionary settings. + +Set dictionary settings. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$dictionarySettingsRequest = new \Algolia\AlgoliaSearch\Model\DictionarySettingsRequest(); // \Algolia\AlgoliaSearch\Model\DictionarySettingsRequest + +try { + $result = $apiInstance->setDictionarySettings($dictionarySettingsRequest); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->setDictionarySettings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dictionarySettingsRequest** | [**\Algolia\AlgoliaSearch\Model\DictionarySettingsRequest**](../Model/DictionarySettingsRequest.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `setSettings()` + +```php +setSettings($indexName, $indexSettings, $forwardToReplicas): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse +``` + + + +Update settings of a given indexName. Only specified settings are overridden; unspecified settings are left unchanged. Specifying null for a setting resets it to its default value. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$indexName = myIndexName; // string | The index in which to perform the request. +$indexSettings = new \Algolia\AlgoliaSearch\Model\IndexSettings(); // \Algolia\AlgoliaSearch\Model\IndexSettings +$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. + +try { + $result = $apiInstance->setSettings($indexName, $indexSettings, $forwardToReplicas); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->setSettings: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **indexName** | **string**| The index in which to perform the request. | + **indexSettings** | [**\Algolia\AlgoliaSearch\Model\IndexSettings**](../Model/IndexSettings.md)| | + **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `updateApiKey()` + +```php +updateApiKey($key, $apiKey): \Algolia\AlgoliaSearch\Model\UpdateApiKeyResponse +``` + +Update an API key. + +Replace every permission of an existing API key. + +### Example + +```php +setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); + +// Configure API key authorization: appId +$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); + + +$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$key = myAPIKey; // string | API Key string. +$apiKey = new \Algolia\AlgoliaSearch\Model\ApiKey(); // \Algolia\AlgoliaSearch\Model\ApiKey + +try { + $result = $apiInstance->updateApiKey($key, $apiKey); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SearchApi->updateApiKey: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **key** | **string**| API Key string. | + **apiKey** | [**\Algolia\AlgoliaSearch\Model\ApiKey**](../Model/ApiKey.md)| | + +### Return type + +[**\Algolia\AlgoliaSearch\Model\UpdateApiKeyResponse**](../Model/UpdateApiKeyResponse.md) + +### Authorization + +[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Action.md b/clients/algoliasearch-client-php/docs/Model/Action.md new file mode 100644 index 0000000000..20944a88df --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/Action.md @@ -0,0 +1,8 @@ +# # Action + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/AddApiKeyResponse.md b/clients/algoliasearch-client-php/docs/Model/AddApiKeyResponse.md new file mode 100644 index 0000000000..dc44bb95b5 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/AddApiKeyResponse.md @@ -0,0 +1,10 @@ +# # AddApiKeyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **string** | Key string. | +**createdAt** | **\DateTime** | Date of creation (ISO-8601 format). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Anchoring.md b/clients/algoliasearch-client-php/docs/Model/Anchoring.md new file mode 100644 index 0000000000..05dfe6abf6 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/Anchoring.md @@ -0,0 +1,8 @@ +# # Anchoring + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ApiKey.md b/clients/algoliasearch-client-php/docs/Model/ApiKey.md new file mode 100644 index 0000000000..4c37f19fd1 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/ApiKey.md @@ -0,0 +1,16 @@ +# # ApiKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**acl** | **string[]** | Set of permissions associated with the key. | +**description** | **string** | A comment used to identify a key more easily in the dashboard. It is not interpreted by the API. | [optional] [default to ''] +**indexes** | **string[]** | Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed. | [optional] +**maxHitsPerQuery** | **int** | Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. | [optional] [default to 0] +**maxQueriesPerIPPerHour** | **int** | Maximum number of API calls per hour allowed from a given IP address or a user token. | [optional] [default to 0] +**queryParameters** | **string** | URL-encoded query string. Force some query parameters to be applied for each query made with this API key. | [optional] [default to ''] +**referers** | **string[]** | Restrict this new API key to specific referers. If empty or blank, defaults to all referers. | [optional] +**validity** | **int** | Validity limit for this key in seconds. The key will automatically be removed after this period of time. | [optional] [default to 0] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/AssignUserIdObject.md b/clients/algoliasearch-client-php/docs/Model/AssignUserIdObject.md new file mode 100644 index 0000000000..f80f845e4d --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/AssignUserIdObject.md @@ -0,0 +1,9 @@ +# # AssignUserIdObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cluster** | **string** | Name of the cluster. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/AutomaticFacetFilter.md b/clients/algoliasearch-client-php/docs/Model/AutomaticFacetFilter.md new file mode 100644 index 0000000000..8c9839016e --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/AutomaticFacetFilter.md @@ -0,0 +1,11 @@ +# # AutomaticFacetFilter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**facet** | **string** | Attribute to filter on. This must match a facet placeholder in the Rule's pattern. | +**score** | **int** | Score for the filter. Typically used for optional or disjunctive filters. | [optional] [default to 1] +**disjunctive** | **bool** | Whether the filter is disjunctive (true) or conjunctive (false). | [optional] [default to false] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BaseBrowseResponse.md b/clients/algoliasearch-client-php/docs/Model/BaseBrowseResponse.md new file mode 100644 index 0000000000..c6a2891c64 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/BaseBrowseResponse.md @@ -0,0 +1,9 @@ +# # BaseBrowseResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cursor** | **string** | Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BaseIndexSettings.md b/clients/algoliasearch-client-php/docs/Model/BaseIndexSettings.md new file mode 100644 index 0000000000..365891b00a --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/BaseIndexSettings.md @@ -0,0 +1,20 @@ +# # BaseIndexSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**replicas** | **string[]** | Creates replicas, exact copies of an index. | [optional] +**paginationLimitedTo** | **int** | Set the maximum number of hits accessible via pagination. | [optional] [default to 1000] +**disableTypoToleranceOnWords** | **string[]** | A list of words for which you want to turn off typo tolerance. | [optional] +**attributesToTransliterate** | **string[]** | Specify on which attributes to apply transliteration. | [optional] +**camelCaseAttributes** | **string[]** | List of attributes on which to do a decomposition of camel case words. | [optional] +**decompoundedAttributes** | **array** | Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding. | [optional] +**indexLanguages** | **string[]** | Sets the languages at the index level for language-specific processing such as tokenization and normalization. | [optional] +**filterPromotes** | **bool** | Whether promoted results should match the filters of the current search, except for geographic filters. | [optional] [default to false] +**disablePrefixOnAttributes** | **string[]** | List of attributes on which you want to disable prefix matching. | [optional] +**allowCompressionOfIntegerArray** | **bool** | Enables compression of large integer arrays. | [optional] [default to false] +**numericAttributesForFiltering** | **string[]** | List of numeric attributes that can be used as numerical filters. | [optional] +**userData** | **array** | Lets you store custom data in your indices. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BaseSearchParams.md b/clients/algoliasearch-client-php/docs/Model/BaseSearchParams.md new file mode 100644 index 0000000000..62c616a889 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/BaseSearchParams.md @@ -0,0 +1,40 @@ +# # BaseSearchParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**similarQuery** | **string** | Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. | [optional] [default to ''] +**filters** | **string** | Filter the query with numeric, facet and/or tag filters. | [optional] [default to ''] +**facetFilters** | **string[]** | Filter hits by facet value. | [optional] +**optionalFilters** | **string[]** | Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. | [optional] +**numericFilters** | **string[]** | Filter on numeric attributes. | [optional] +**tagFilters** | **string[]** | Filter hits by tags. | [optional] +**sumOrFiltersScores** | **bool** | Determines how to calculate the total score for filtering. | [optional] [default to false] +**facets** | **string[]** | Retrieve facets and their facet values. | [optional] +**maxValuesPerFacet** | **int** | Maximum number of facet values to return for each facet during a regular search. | [optional] [default to 100] +**facetingAfterDistinct** | **bool** | Force faceting to be applied after de-duplication (via the Distinct setting). | [optional] [default to false] +**sortFacetValuesBy** | **string** | Controls how facet values are fetched. | [optional] [default to 'count'] +**page** | **int** | Specify the page to retrieve. | [optional] [default to 0] +**offset** | **int** | Specify the offset of the first hit to return. | [optional] +**length** | **int** | Set the number of hits to retrieve (used only with offset). | [optional] +**aroundLatLng** | **string** | Search for entries around a central geolocation, enabling a geo search within a circular area. | [optional] [default to ''] +**aroundLatLngViaIP** | **bool** | Search for entries around a given location automatically computed from the requester's IP address. | [optional] [default to false] +**aroundRadius** | [**OneOfIntegerString**](OneOfIntegerString.md) | Define the maximum radius for a geo search (in meters). | [optional] +**aroundPrecision** | **int** | Precision of geo search (in meters), to add grouping by geo location to the ranking formula. | [optional] [default to 10] +**minimumAroundRadius** | **int** | Minimum radius (in meters) used for a geo search when aroundRadius is not set. | [optional] +**insideBoundingBox** | **float[]** | Search inside a rectangular area (in geo coordinates). | [optional] +**insidePolygon** | **float[]** | Search inside a polygon (in geo coordinates). | [optional] +**naturalLanguages** | **string[]** | This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. | [optional] +**ruleContexts** | **string[]** | Enables contextual rules. | [optional] +**personalizationImpact** | **int** | Define the impact of the Personalization feature. | [optional] [default to 100] +**userToken** | **string** | Associates a certain user token with the current search. | [optional] +**getRankingInfo** | **bool** | Retrieve detailed ranking information. | [optional] [default to false] +**clickAnalytics** | **bool** | Enable the Click Analytics feature. | [optional] [default to false] +**analytics** | **bool** | Whether the current query will be taken into account in the Analytics. | [optional] [default to true] +**analyticsTags** | **string[]** | List of tags to apply to the query for analytics purposes. | [optional] +**percentileComputation** | **bool** | Whether to include or exclude a query from the processing-time percentile computation. | [optional] [default to true] +**enableABTest** | **bool** | Whether this search should participate in running AB tests. | [optional] [default to true] +**enableReRanking** | **bool** | Whether this search should use AI Re-Ranking. | [optional] [default to true] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BaseSearchResponse.md b/clients/algoliasearch-client-php/docs/Model/BaseSearchResponse.md new file mode 100644 index 0000000000..c3785c4563 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/BaseSearchResponse.md @@ -0,0 +1,32 @@ +# # BaseSearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**abTestID** | **int** | If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID. | [optional] +**abTestVariantID** | **int** | If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used. | [optional] +**aroundLatLng** | **string** | The computed geo location. | [optional] +**automaticRadius** | **string** | The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. | [optional] +**exhaustiveFacetsCount** | **bool** | Whether the facet count is exhaustive or approximate. | [optional] +**exhaustiveNbHits** | **bool** | Indicate if the nbHits count was exhaustive or approximate | +**exhaustiveTypo** | **bool** | Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) | +**facets** | **array>** | A mapping of each facet name to the corresponding facet counts. | [optional] +**facetsStats** | [**array**](BaseSearchResponseFacetsStats.md) | Statistics for numerical facets. | [optional] +**hitsPerPage** | **int** | Set the number of hits per page. | [default to 20] +**index** | **string** | Index name used for the query. | [optional] +**indexUsed** | **string** | Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. | [optional] +**message** | **string** | Used to return warnings about the query. | [optional] +**nbHits** | **int** | Number of hits that the search query matched. | +**nbPages** | **int** | Number of pages available for the current query | +**nbSortedHits** | **int** | The number of hits selected and sorted by the relevant sort algorithm | [optional] +**page** | **int** | Specify the page to retrieve. | [default to 0] +**params** | **string** | A url-encoded string of all search parameters. | +**parsedQuery** | **string** | The query string that will be searched, after normalization. | [optional] +**processingTimeMS** | **int** | Time the server took to process the request, in milliseconds. | +**query** | **string** | The text to search in the index. | [default to ''] +**queryAfterRemoval** | **string** | A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. | [optional] +**serverUsed** | **string** | Actual host name of the server that processed the request. | [optional] +**userData** | **array** | Lets you store custom data in your indices. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BaseSearchResponseFacetsStats.md b/clients/algoliasearch-client-php/docs/Model/BaseSearchResponseFacetsStats.md new file mode 100644 index 0000000000..b7e8d1fbeb --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/BaseSearchResponseFacetsStats.md @@ -0,0 +1,12 @@ +# # BaseSearchResponseFacetsStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**min** | **int** | The minimum value in the result set. | [optional] +**max** | **int** | The maximum value in the result set. | [optional] +**avg** | **int** | The average facet value in the result set. | [optional] +**sum** | **int** | The sum of all values in the result set. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BatchAssignUserIdsObject.md b/clients/algoliasearch-client-php/docs/Model/BatchAssignUserIdsObject.md new file mode 100644 index 0000000000..a0c4f91756 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/BatchAssignUserIdsObject.md @@ -0,0 +1,10 @@ +# # BatchAssignUserIdsObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cluster** | **string** | Name of the cluster. | +**users** | **string[]** | userIDs to assign. Note you cannot move users with this method. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntries.md b/clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntries.md new file mode 100644 index 0000000000..ba997c56e8 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntries.md @@ -0,0 +1,10 @@ +# # BatchDictionaryEntries + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**clearExistingDictionaryEntries** | **bool** | When `true`, start the batch by removing all the custom entries from the dictionary. | [optional] [default to false] +**requests** | [**\Algolia\AlgoliaSearch\Model\BatchDictionaryEntriesRequest[]**](BatchDictionaryEntriesRequest.md) | List of operations to batch. Each operation is described by an `action` and a `body`. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntriesRequest.md b/clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntriesRequest.md new file mode 100644 index 0000000000..b963945028 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntriesRequest.md @@ -0,0 +1,10 @@ +# # BatchDictionaryEntriesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **string** | Actions to perform. | +**body** | [**\Algolia\AlgoliaSearch\Model\DictionaryEntry**](DictionaryEntry.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BatchObject.md b/clients/algoliasearch-client-php/docs/Model/BatchObject.md new file mode 100644 index 0000000000..bb6546224c --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/BatchObject.md @@ -0,0 +1,9 @@ +# # BatchObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requests** | [**\Algolia\AlgoliaSearch\Model\Operation[]**](Operation.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BatchResponse.md b/clients/algoliasearch-client-php/docs/Model/BatchResponse.md new file mode 100644 index 0000000000..c4688672ab --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/BatchResponse.md @@ -0,0 +1,10 @@ +# # BatchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taskID** | **int** | taskID of the indexing task to wait for. | [optional] +**objectIDs** | **string[]** | List of objectID. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BatchWriteObject.md b/clients/algoliasearch-client-php/docs/Model/BatchWriteObject.md new file mode 100644 index 0000000000..30502cb8fb --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/BatchWriteObject.md @@ -0,0 +1,9 @@ +# # BatchWriteObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requests** | [**\Algolia\AlgoliaSearch\Model\Operation[]**](Operation.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BrowseRequest.md b/clients/algoliasearch-client-php/docs/Model/BrowseRequest.md new file mode 100644 index 0000000000..aa4af2b1e4 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/BrowseRequest.md @@ -0,0 +1,10 @@ +# # BrowseRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**params** | **string** | Search parameters as URL-encoded query string. | [optional] [default to ''] +**cursor** | **string** | Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BrowseResponse.md b/clients/algoliasearch-client-php/docs/Model/BrowseResponse.md new file mode 100644 index 0000000000..e49a3f5daf --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/BrowseResponse.md @@ -0,0 +1,34 @@ +# # BrowseResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**abTestID** | **int** | If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID. | [optional] +**abTestVariantID** | **int** | If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used. | [optional] +**aroundLatLng** | **string** | The computed geo location. | [optional] +**automaticRadius** | **string** | The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. | [optional] +**exhaustiveFacetsCount** | **bool** | Whether the facet count is exhaustive or approximate. | [optional] +**exhaustiveNbHits** | **bool** | Indicate if the nbHits count was exhaustive or approximate | +**exhaustiveTypo** | **bool** | Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) | +**facets** | **array>** | A mapping of each facet name to the corresponding facet counts. | [optional] +**facetsStats** | [**array**](BaseSearchResponseFacetsStats.md) | Statistics for numerical facets. | [optional] +**hitsPerPage** | **int** | Set the number of hits per page. | [default to 20] +**index** | **string** | Index name used for the query. | [optional] +**indexUsed** | **string** | Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. | [optional] +**message** | **string** | Used to return warnings about the query. | [optional] +**nbHits** | **int** | Number of hits that the search query matched. | +**nbPages** | **int** | Number of pages available for the current query | +**nbSortedHits** | **int** | The number of hits selected and sorted by the relevant sort algorithm | [optional] +**page** | **int** | Specify the page to retrieve. | [default to 0] +**params** | **string** | A url-encoded string of all search parameters. | +**parsedQuery** | **string** | The query string that will be searched, after normalization. | [optional] +**processingTimeMS** | **int** | Time the server took to process the request, in milliseconds. | +**query** | **string** | The text to search in the index. | [default to ''] +**queryAfterRemoval** | **string** | A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. | [optional] +**serverUsed** | **string** | Actual host name of the server that processed the request. | [optional] +**userData** | **array** | Lets you store custom data in your indices. | [optional] +**hits** | [**\Algolia\AlgoliaSearch\Model\Record[]**](Record.md) | | +**cursor** | **string** | Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BuildInOperation.md b/clients/algoliasearch-client-php/docs/Model/BuildInOperation.md new file mode 100644 index 0000000000..44258e1acd --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/BuildInOperation.md @@ -0,0 +1,10 @@ +# # BuildInOperation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**operation** | **string** | The operation to apply on the attribute. | +**value** | **string** | the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Condition.md b/clients/algoliasearch-client-php/docs/Model/Condition.md new file mode 100644 index 0000000000..29cfc785ab --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/Condition.md @@ -0,0 +1,12 @@ +# # Condition + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pattern** | **string** | Query pattern syntax | [optional] +**anchoring** | [**\Algolia\AlgoliaSearch\Model\Anchoring**](Anchoring.md) | | [optional] +**alternatives** | **bool** | Whether the pattern matches on plurals, synonyms, and typos. | [optional] [default to false] +**context** | **string** | Rule context format: [A-Za-z0-9_-]+). | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Consequence.md b/clients/algoliasearch-client-php/docs/Model/Consequence.md new file mode 100644 index 0000000000..44d97b2323 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/Consequence.md @@ -0,0 +1,13 @@ +# # Consequence + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**params** | [**\Algolia\AlgoliaSearch\Model\ConsequenceParams**](ConsequenceParams.md) | | [optional] +**promote** | [**\Algolia\AlgoliaSearch\Model\Promote[]**](Promote.md) | Objects to promote as hits. | [optional] +**filterPromotes** | **bool** | Only use in combination with the promote consequence. When true, promoted results will be restricted to match the filters of the current search. When false, the promoted results will show up regardless of the filters. | [optional] [default to false] +**hide** | [**\Algolia\AlgoliaSearch\Model\ConsequenceHide[]**](ConsequenceHide.md) | Objects to hide from hits. Each object must contain an objectID field. By default, you can hide up to 50 items per rule. | [optional] +**userData** | **array** | Custom JSON object that will be appended to the userData array in the response. This object isn't interpreted by the API. It's limited to 1kB of minified JSON. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ConsequenceHide.md b/clients/algoliasearch-client-php/docs/Model/ConsequenceHide.md new file mode 100644 index 0000000000..ae79a1a832 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/ConsequenceHide.md @@ -0,0 +1,9 @@ +# # ConsequenceHide + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**objectID** | **string** | Unique identifier of the object. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ConsequenceParams.md b/clients/algoliasearch-client-php/docs/Model/ConsequenceParams.md new file mode 100644 index 0000000000..888b29c966 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/ConsequenceParams.md @@ -0,0 +1,87 @@ +# # ConsequenceParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query** | **string** | Query string. | [optional] +**automaticFacetFilters** | [**\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]**](AutomaticFacetFilter.md) | Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern. | [optional] +**automaticOptionalFacetFilters** | [**\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]**](AutomaticFacetFilter.md) | Same syntax as automaticFacetFilters, but the engine treats the filters as optional. | [optional] +**similarQuery** | **string** | Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. | [optional] [default to ''] +**filters** | **string** | Filter the query with numeric, facet and/or tag filters. | [optional] [default to ''] +**facetFilters** | **string[]** | Filter hits by facet value. | [optional] +**optionalFilters** | **string[]** | Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. | [optional] +**numericFilters** | **string[]** | Filter on numeric attributes. | [optional] +**tagFilters** | **string[]** | Filter hits by tags. | [optional] +**sumOrFiltersScores** | **bool** | Determines how to calculate the total score for filtering. | [optional] [default to false] +**facets** | **string[]** | Retrieve facets and their facet values. | [optional] +**maxValuesPerFacet** | **int** | Maximum number of facet values to return for each facet during a regular search. | [optional] [default to 100] +**facetingAfterDistinct** | **bool** | Force faceting to be applied after de-duplication (via the Distinct setting). | [optional] [default to false] +**sortFacetValuesBy** | **string** | Controls how facet values are fetched. | [optional] [default to 'count'] +**page** | **int** | Specify the page to retrieve. | [optional] [default to 0] +**offset** | **int** | Specify the offset of the first hit to return. | [optional] +**length** | **int** | Set the number of hits to retrieve (used only with offset). | [optional] +**aroundLatLng** | **string** | Search for entries around a central geolocation, enabling a geo search within a circular area. | [optional] [default to ''] +**aroundLatLngViaIP** | **bool** | Search for entries around a given location automatically computed from the requester's IP address. | [optional] [default to false] +**aroundRadius** | [**OneOfIntegerString**](OneOfIntegerString.md) | Define the maximum radius for a geo search (in meters). | [optional] +**aroundPrecision** | **int** | Precision of geo search (in meters), to add grouping by geo location to the ranking formula. | [optional] [default to 10] +**minimumAroundRadius** | **int** | Minimum radius (in meters) used for a geo search when aroundRadius is not set. | [optional] +**insideBoundingBox** | **float[]** | Search inside a rectangular area (in geo coordinates). | [optional] +**insidePolygon** | **float[]** | Search inside a polygon (in geo coordinates). | [optional] +**naturalLanguages** | **string[]** | This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. | [optional] +**ruleContexts** | **string[]** | Enables contextual rules. | [optional] +**personalizationImpact** | **int** | Define the impact of the Personalization feature. | [optional] [default to 100] +**userToken** | **string** | Associates a certain user token with the current search. | [optional] +**getRankingInfo** | **bool** | Retrieve detailed ranking information. | [optional] [default to false] +**clickAnalytics** | **bool** | Enable the Click Analytics feature. | [optional] [default to false] +**analytics** | **bool** | Whether the current query will be taken into account in the Analytics. | [optional] [default to true] +**analyticsTags** | **string[]** | List of tags to apply to the query for analytics purposes. | [optional] +**percentileComputation** | **bool** | Whether to include or exclude a query from the processing-time percentile computation. | [optional] [default to true] +**enableABTest** | **bool** | Whether this search should participate in running AB tests. | [optional] [default to true] +**enableReRanking** | **bool** | Whether this search should use AI Re-Ranking. | [optional] [default to true] +**searchableAttributes** | **string[]** | The complete list of attributes used for searching. | [optional] +**attributesForFaceting** | **string[]** | The complete list of attributes that will be used for faceting. | [optional] +**unretrievableAttributes** | **string[]** | List of attributes that can't be retrieved at query time. | [optional] +**attributesToRetrieve** | **string[]** | This parameter controls which attributes to retrieve and which not to retrieve. | [optional] +**restrictSearchableAttributes** | **string[]** | Restricts a given query to look in only a subset of your searchable attributes. | [optional] +**ranking** | **string[]** | Controls how Algolia should sort your results. | [optional] +**customRanking** | **string[]** | Specifies the custom ranking criterion. | [optional] +**relevancyStrictness** | **int** | Controls the relevancy threshold below which less relevant results aren't included in the results. | [optional] [default to 100] +**attributesToHighlight** | **string[]** | List of attributes to highlight. | [optional] +**attributesToSnippet** | **string[]** | List of attributes to snippet, with an optional maximum number of words to snippet. | [optional] +**highlightPreTag** | **string** | The HTML string to insert before the highlighted parts in all highlight and snippet results. | [optional] [default to ''] +**highlightPostTag** | **string** | The HTML string to insert after the highlighted parts in all highlight and snippet results. | [optional] [default to ''] +**snippetEllipsisText** | **string** | String used as an ellipsis indicator when a snippet is truncated. | [optional] [default to '…'] +**restrictHighlightAndSnippetArrays** | **bool** | Restrict highlighting and snippeting to items that matched the query. | [optional] [default to false] +**hitsPerPage** | **int** | Set the number of hits per page. | [optional] [default to 20] +**minWordSizefor1Typo** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 1 typo. | [optional] [default to 4] +**minWordSizefor2Typos** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 2 typos. | [optional] [default to 8] +**typoTolerance** | **string** | Controls whether typo tolerance is enabled and how it is applied. | [optional] [default to 'true'] +**allowTyposOnNumericTokens** | **bool** | Whether to allow typos on numbers (\"numeric tokens\") in the query string. | [optional] [default to true] +**disableTypoToleranceOnAttributes** | **string[]** | List of attributes on which you want to disable typo tolerance. | [optional] +**separatorsToIndex** | **string** | Control which separators are indexed. | [optional] [default to ''] +**ignorePlurals** | **string** | Treats singular, plurals, and other forms of declensions as matching terms. | [optional] [default to 'false'] +**removeStopWords** | **string** | Removes stop (common) words from the query before executing it. | [optional] [default to 'false'] +**keepDiacriticsOnCharacters** | **string** | List of characters that the engine shouldn't automatically normalize. | [optional] [default to ''] +**queryLanguages** | **string[]** | Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. | [optional] +**decompoundQuery** | **bool** | Splits compound words into their composing atoms in the query. | [optional] [default to true] +**enableRules** | **bool** | Whether Rules should be globally enabled. | [optional] [default to true] +**enablePersonalization** | **bool** | Enable the Personalization feature. | [optional] [default to false] +**queryType** | **string** | Controls if and how query words are interpreted as prefixes. | [optional] [default to 'prefixLast'] +**removeWordsIfNoResults** | **string** | Selects a strategy to remove words from the query when it doesn't match any hits. | [optional] [default to 'none'] +**advancedSyntax** | **bool** | Enables the advanced query syntax. | [optional] [default to false] +**optionalWords** | **string[]** | A list of words that should be considered as optional when found in the query. | [optional] +**disableExactOnAttributes** | **string[]** | List of attributes on which you want to disable the exact ranking criterion. | [optional] +**exactOnSingleWordQuery** | **string** | Controls how the exact ranking criterion is computed when the query contains only one word. | [optional] [default to 'attribute'] +**alternativesAsExact** | **string[]** | List of alternatives that should be considered an exact match by the exact ranking criterion. | [optional] +**advancedSyntaxFeatures** | **string[]** | Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. | [optional] +**distinct** | **int** | Enables de-duplication or grouping of results. | [optional] [default to 0] +**synonyms** | **bool** | Whether to take into account an index's synonyms for a particular search. | [optional] [default to true] +**replaceSynonymsInHighlight** | **bool** | Whether to highlight and snippet the original word that matches the synonym or the synonym itself. | [optional] [default to false] +**minProximity** | **int** | Precision of the proximity ranking criterion. | [optional] [default to 1] +**responseFields** | **string[]** | Choose which fields to return in the API response. This parameters applies to search and browse queries. | [optional] +**maxFacetHits** | **int** | Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. | [optional] [default to 10] +**attributeCriteriaComputedByMinProximity** | **bool** | When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. | [optional] [default to false] +**renderingContent** | **object** | Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/CreatedAtObject.md b/clients/algoliasearch-client-php/docs/Model/CreatedAtObject.md new file mode 100644 index 0000000000..d4e28dd37a --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/CreatedAtObject.md @@ -0,0 +1,9 @@ +# # CreatedAtObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createdAt** | **\DateTime** | Date of creation (ISO-8601 format). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/CreatedAtResponse.md b/clients/algoliasearch-client-php/docs/Model/CreatedAtResponse.md new file mode 100644 index 0000000000..63b0903777 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/CreatedAtResponse.md @@ -0,0 +1,9 @@ +# # CreatedAtResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createdAt** | **\DateTime** | Date of creation (ISO-8601 format). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/DeleteApiKeyResponse.md b/clients/algoliasearch-client-php/docs/Model/DeleteApiKeyResponse.md new file mode 100644 index 0000000000..c2a976c61f --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/DeleteApiKeyResponse.md @@ -0,0 +1,9 @@ +# # DeleteApiKeyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deletedAt** | **\DateTime** | Date of deletion (ISO-8601 format). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/DeleteSourceResponse.md b/clients/algoliasearch-client-php/docs/Model/DeleteSourceResponse.md new file mode 100644 index 0000000000..52fe48f01a --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/DeleteSourceResponse.md @@ -0,0 +1,9 @@ +# # DeleteSourceResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deletedAt** | **\DateTime** | Date of deletion (ISO-8601 format). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/DeletedAtResponse.md b/clients/algoliasearch-client-php/docs/Model/DeletedAtResponse.md new file mode 100644 index 0000000000..193e9681f9 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/DeletedAtResponse.md @@ -0,0 +1,10 @@ +# # DeletedAtResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taskID** | **int** | taskID of the indexing task to wait for. | +**deletedAt** | **\DateTime** | Date of deletion (ISO-8601 format). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/DictionaryEntry.md b/clients/algoliasearch-client-php/docs/Model/DictionaryEntry.md new file mode 100644 index 0000000000..9b82059ebb --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/DictionaryEntry.md @@ -0,0 +1,14 @@ +# # DictionaryEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**objectID** | **string** | Unique identifier of the object. | +**language** | **string** | Language ISO code supported by the dictionary (e.g., \"en\" for English). | +**word** | **string** | The word of the dictionary entry. | [optional] +**words** | **string[]** | The words of the dictionary entry. | [optional] +**decomposition** | **string[]** | A decomposition of the word of the dictionary entry. | [optional] +**state** | **string** | The state of the dictionary entry. | [optional] [default to 'enabled'] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/DictionaryLanguage.md b/clients/algoliasearch-client-php/docs/Model/DictionaryLanguage.md new file mode 100644 index 0000000000..ea5d112dbc --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/DictionaryLanguage.md @@ -0,0 +1,9 @@ +# # DictionaryLanguage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nbCustomEntires** | **int** | When nbCustomEntries is set to 0, the user didn't customize the dictionary. The dictionary is still supported with standard, Algolia-provided entries. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/DictionarySettingsRequest.md b/clients/algoliasearch-client-php/docs/Model/DictionarySettingsRequest.md new file mode 100644 index 0000000000..20543a7edc --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/DictionarySettingsRequest.md @@ -0,0 +1,9 @@ +# # DictionarySettingsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**disableStandardEntries** | [**\Algolia\AlgoliaSearch\Model\StandardEntries**](StandardEntries.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ErrorBase.md b/clients/algoliasearch-client-php/docs/Model/ErrorBase.md new file mode 100644 index 0000000000..3e7fb2b482 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/ErrorBase.md @@ -0,0 +1,9 @@ +# # ErrorBase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetDictionarySettingsResponse.md b/clients/algoliasearch-client-php/docs/Model/GetDictionarySettingsResponse.md new file mode 100644 index 0000000000..8b9d0a3831 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/GetDictionarySettingsResponse.md @@ -0,0 +1,9 @@ +# # GetDictionarySettingsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**disableStandardEntries** | [**\Algolia\AlgoliaSearch\Model\StandardEntries**](StandardEntries.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetLogsResponse.md b/clients/algoliasearch-client-php/docs/Model/GetLogsResponse.md new file mode 100644 index 0000000000..fe065fe89b --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/GetLogsResponse.md @@ -0,0 +1,9 @@ +# # GetLogsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**logs** | [**\Algolia\AlgoliaSearch\Model\GetLogsResponseLogs[]**](GetLogsResponseLogs.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetLogsResponseInnerQueries.md b/clients/algoliasearch-client-php/docs/Model/GetLogsResponseInnerQueries.md new file mode 100644 index 0000000000..42016555a7 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/GetLogsResponseInnerQueries.md @@ -0,0 +1,11 @@ +# # GetLogsResponseInnerQueries + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**indexName** | **string** | Index targeted by the query. | [optional] +**userToken** | **string** | User identifier. | [optional] +**queryId** | **string** | QueryID for the given query. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetLogsResponseLogs.md b/clients/algoliasearch-client-php/docs/Model/GetLogsResponseLogs.md new file mode 100644 index 0000000000..4fbc7559f0 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/GetLogsResponseLogs.md @@ -0,0 +1,23 @@ +# # GetLogsResponseLogs + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **string** | Timestamp in ISO-8601 format. | +**method** | **string** | HTTP method of the perfomed request. | +**answerCode** | **string** | HTTP response code. | +**queryBody** | **string** | Request body. Truncated after 1000 characters. | +**answer** | **string** | Answer body. Truncated after 1000 characters. | +**url** | **string** | Request URL. | +**ip** | **string** | IP of the client which perfomed the request. | +**queryHeaders** | **string** | Request Headers (API Key is obfuscated). | +**sha1** | **string** | SHA1 signature of the log entry. | +**nbApiCalls** | **string** | Number of API calls. | +**processingTimeMs** | **string** | Processing time for the query. It doesn't include network time. | +**index** | **string** | Index targeted by the query. | [optional] +**queryParams** | **string** | Query parameters sent with the request. | [optional] +**queryNbHits** | **string** | Number of hits returned for the query. | [optional] +**innerQueries** | [**\Algolia\AlgoliaSearch\Model\GetLogsResponseInnerQueries[]**](GetLogsResponseInnerQueries.md) | Array of all performed queries for the given request. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetObjectsObject.md b/clients/algoliasearch-client-php/docs/Model/GetObjectsObject.md new file mode 100644 index 0000000000..7694ac8a06 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/GetObjectsObject.md @@ -0,0 +1,9 @@ +# # GetObjectsObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requests** | [**\Algolia\AlgoliaSearch\Model\MultipleGetObjectsObject[]**](MultipleGetObjectsObject.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetObjectsResponse.md b/clients/algoliasearch-client-php/docs/Model/GetObjectsResponse.md new file mode 100644 index 0000000000..9717b71167 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/GetObjectsResponse.md @@ -0,0 +1,9 @@ +# # GetObjectsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | **array[]** | List of results fetched. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetTaskResponse.md b/clients/algoliasearch-client-php/docs/Model/GetTaskResponse.md new file mode 100644 index 0000000000..3f35342bf1 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/GetTaskResponse.md @@ -0,0 +1,9 @@ +# # GetTaskResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetTopUserIdsResponse.md b/clients/algoliasearch-client-php/docs/Model/GetTopUserIdsResponse.md new file mode 100644 index 0000000000..e3cc337811 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/GetTopUserIdsResponse.md @@ -0,0 +1,9 @@ +# # GetTopUserIdsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**topUsers** | **array[]** | Mapping of cluster names to top users. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/HighlightResult.md b/clients/algoliasearch-client-php/docs/Model/HighlightResult.md new file mode 100644 index 0000000000..7586bba50a --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/HighlightResult.md @@ -0,0 +1,12 @@ +# # HighlightResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **string** | Markup text with occurrences highlighted. | [optional] +**matchLevel** | **string** | Indicates how well the attribute matched the search query. | [optional] +**matchedWords** | **string[]** | List of words from the query that matched the object. | [optional] +**fullyHighlighted** | **bool** | Whether the entire attribute value is highlighted. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Index.md b/clients/algoliasearch-client-php/docs/Model/Index.md new file mode 100644 index 0000000000..9f3c2cb90a --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/Index.md @@ -0,0 +1,19 @@ +# # Index + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Index name. | +**createdAt** | **\DateTime** | Index creation date. An empty string means that the index has no records. | +**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | +**entries** | **int** | Number of records contained in the index. | +**dataSize** | **int** | Number of bytes of the index in minified format. | +**fileSize** | **int** | Number of bytes of the index binary file. | +**lastBuildTimeS** | **int** | Last build time | +**numberOfPendingTask** | **int** | Number of pending indexing operations. This value is deprecated and should not be used. | [optional] +**pendingTask** | **bool** | A boolean which says whether the index has pending tasks. This value is deprecated and should not be used. | +**primary** | **string** | Only present if the index is a replica. Contains the name of the related primary index. | [optional] +**replicas** | **string[]** | Only present if the index is a primary index with replicas. Contains the names of all linked replicas. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/IndexSettings.md b/clients/algoliasearch-client-php/docs/Model/IndexSettings.md new file mode 100644 index 0000000000..84090e742c --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/IndexSettings.md @@ -0,0 +1,64 @@ +# # IndexSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**replicas** | **string[]** | Creates replicas, exact copies of an index. | [optional] +**paginationLimitedTo** | **int** | Set the maximum number of hits accessible via pagination. | [optional] [default to 1000] +**disableTypoToleranceOnWords** | **string[]** | A list of words for which you want to turn off typo tolerance. | [optional] +**attributesToTransliterate** | **string[]** | Specify on which attributes to apply transliteration. | [optional] +**camelCaseAttributes** | **string[]** | List of attributes on which to do a decomposition of camel case words. | [optional] +**decompoundedAttributes** | **array** | Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding. | [optional] +**indexLanguages** | **string[]** | Sets the languages at the index level for language-specific processing such as tokenization and normalization. | [optional] +**filterPromotes** | **bool** | Whether promoted results should match the filters of the current search, except for geographic filters. | [optional] [default to false] +**disablePrefixOnAttributes** | **string[]** | List of attributes on which you want to disable prefix matching. | [optional] +**allowCompressionOfIntegerArray** | **bool** | Enables compression of large integer arrays. | [optional] [default to false] +**numericAttributesForFiltering** | **string[]** | List of numeric attributes that can be used as numerical filters. | [optional] +**userData** | **array** | Lets you store custom data in your indices. | [optional] +**searchableAttributes** | **string[]** | The complete list of attributes used for searching. | [optional] +**attributesForFaceting** | **string[]** | The complete list of attributes that will be used for faceting. | [optional] +**unretrievableAttributes** | **string[]** | List of attributes that can't be retrieved at query time. | [optional] +**attributesToRetrieve** | **string[]** | This parameter controls which attributes to retrieve and which not to retrieve. | [optional] +**restrictSearchableAttributes** | **string[]** | Restricts a given query to look in only a subset of your searchable attributes. | [optional] +**ranking** | **string[]** | Controls how Algolia should sort your results. | [optional] +**customRanking** | **string[]** | Specifies the custom ranking criterion. | [optional] +**relevancyStrictness** | **int** | Controls the relevancy threshold below which less relevant results aren't included in the results. | [optional] [default to 100] +**attributesToHighlight** | **string[]** | List of attributes to highlight. | [optional] +**attributesToSnippet** | **string[]** | List of attributes to snippet, with an optional maximum number of words to snippet. | [optional] +**highlightPreTag** | **string** | The HTML string to insert before the highlighted parts in all highlight and snippet results. | [optional] [default to ''] +**highlightPostTag** | **string** | The HTML string to insert after the highlighted parts in all highlight and snippet results. | [optional] [default to ''] +**snippetEllipsisText** | **string** | String used as an ellipsis indicator when a snippet is truncated. | [optional] [default to '…'] +**restrictHighlightAndSnippetArrays** | **bool** | Restrict highlighting and snippeting to items that matched the query. | [optional] [default to false] +**hitsPerPage** | **int** | Set the number of hits per page. | [optional] [default to 20] +**minWordSizefor1Typo** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 1 typo. | [optional] [default to 4] +**minWordSizefor2Typos** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 2 typos. | [optional] [default to 8] +**typoTolerance** | **string** | Controls whether typo tolerance is enabled and how it is applied. | [optional] [default to 'true'] +**allowTyposOnNumericTokens** | **bool** | Whether to allow typos on numbers (\"numeric tokens\") in the query string. | [optional] [default to true] +**disableTypoToleranceOnAttributes** | **string[]** | List of attributes on which you want to disable typo tolerance. | [optional] +**separatorsToIndex** | **string** | Control which separators are indexed. | [optional] [default to ''] +**ignorePlurals** | **string** | Treats singular, plurals, and other forms of declensions as matching terms. | [optional] [default to 'false'] +**removeStopWords** | **string** | Removes stop (common) words from the query before executing it. | [optional] [default to 'false'] +**keepDiacriticsOnCharacters** | **string** | List of characters that the engine shouldn't automatically normalize. | [optional] [default to ''] +**queryLanguages** | **string[]** | Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. | [optional] +**decompoundQuery** | **bool** | Splits compound words into their composing atoms in the query. | [optional] [default to true] +**enableRules** | **bool** | Whether Rules should be globally enabled. | [optional] [default to true] +**enablePersonalization** | **bool** | Enable the Personalization feature. | [optional] [default to false] +**queryType** | **string** | Controls if and how query words are interpreted as prefixes. | [optional] [default to 'prefixLast'] +**removeWordsIfNoResults** | **string** | Selects a strategy to remove words from the query when it doesn't match any hits. | [optional] [default to 'none'] +**advancedSyntax** | **bool** | Enables the advanced query syntax. | [optional] [default to false] +**optionalWords** | **string[]** | A list of words that should be considered as optional when found in the query. | [optional] +**disableExactOnAttributes** | **string[]** | List of attributes on which you want to disable the exact ranking criterion. | [optional] +**exactOnSingleWordQuery** | **string** | Controls how the exact ranking criterion is computed when the query contains only one word. | [optional] [default to 'attribute'] +**alternativesAsExact** | **string[]** | List of alternatives that should be considered an exact match by the exact ranking criterion. | [optional] +**advancedSyntaxFeatures** | **string[]** | Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. | [optional] +**distinct** | **int** | Enables de-duplication or grouping of results. | [optional] [default to 0] +**synonyms** | **bool** | Whether to take into account an index's synonyms for a particular search. | [optional] [default to true] +**replaceSynonymsInHighlight** | **bool** | Whether to highlight and snippet the original word that matches the synonym or the synonym itself. | [optional] [default to false] +**minProximity** | **int** | Precision of the proximity ranking criterion. | [optional] [default to 1] +**responseFields** | **string[]** | Choose which fields to return in the API response. This parameters applies to search and browse queries. | [optional] +**maxFacetHits** | **int** | Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. | [optional] [default to 10] +**attributeCriteriaComputedByMinProximity** | **bool** | When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. | [optional] [default to false] +**renderingContent** | **object** | Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/IndexSettingsAsSearchParams.md b/clients/algoliasearch-client-php/docs/Model/IndexSettingsAsSearchParams.md new file mode 100644 index 0000000000..4a42360a65 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/IndexSettingsAsSearchParams.md @@ -0,0 +1,52 @@ +# # IndexSettingsAsSearchParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**searchableAttributes** | **string[]** | The complete list of attributes used for searching. | [optional] +**attributesForFaceting** | **string[]** | The complete list of attributes that will be used for faceting. | [optional] +**unretrievableAttributes** | **string[]** | List of attributes that can't be retrieved at query time. | [optional] +**attributesToRetrieve** | **string[]** | This parameter controls which attributes to retrieve and which not to retrieve. | [optional] +**restrictSearchableAttributes** | **string[]** | Restricts a given query to look in only a subset of your searchable attributes. | [optional] +**ranking** | **string[]** | Controls how Algolia should sort your results. | [optional] +**customRanking** | **string[]** | Specifies the custom ranking criterion. | [optional] +**relevancyStrictness** | **int** | Controls the relevancy threshold below which less relevant results aren't included in the results. | [optional] [default to 100] +**attributesToHighlight** | **string[]** | List of attributes to highlight. | [optional] +**attributesToSnippet** | **string[]** | List of attributes to snippet, with an optional maximum number of words to snippet. | [optional] +**highlightPreTag** | **string** | The HTML string to insert before the highlighted parts in all highlight and snippet results. | [optional] [default to ''] +**highlightPostTag** | **string** | The HTML string to insert after the highlighted parts in all highlight and snippet results. | [optional] [default to ''] +**snippetEllipsisText** | **string** | String used as an ellipsis indicator when a snippet is truncated. | [optional] [default to '…'] +**restrictHighlightAndSnippetArrays** | **bool** | Restrict highlighting and snippeting to items that matched the query. | [optional] [default to false] +**hitsPerPage** | **int** | Set the number of hits per page. | [optional] [default to 20] +**minWordSizefor1Typo** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 1 typo. | [optional] [default to 4] +**minWordSizefor2Typos** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 2 typos. | [optional] [default to 8] +**typoTolerance** | **string** | Controls whether typo tolerance is enabled and how it is applied. | [optional] [default to 'true'] +**allowTyposOnNumericTokens** | **bool** | Whether to allow typos on numbers (\"numeric tokens\") in the query string. | [optional] [default to true] +**disableTypoToleranceOnAttributes** | **string[]** | List of attributes on which you want to disable typo tolerance. | [optional] +**separatorsToIndex** | **string** | Control which separators are indexed. | [optional] [default to ''] +**ignorePlurals** | **string** | Treats singular, plurals, and other forms of declensions as matching terms. | [optional] [default to 'false'] +**removeStopWords** | **string** | Removes stop (common) words from the query before executing it. | [optional] [default to 'false'] +**keepDiacriticsOnCharacters** | **string** | List of characters that the engine shouldn't automatically normalize. | [optional] [default to ''] +**queryLanguages** | **string[]** | Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. | [optional] +**decompoundQuery** | **bool** | Splits compound words into their composing atoms in the query. | [optional] [default to true] +**enableRules** | **bool** | Whether Rules should be globally enabled. | [optional] [default to true] +**enablePersonalization** | **bool** | Enable the Personalization feature. | [optional] [default to false] +**queryType** | **string** | Controls if and how query words are interpreted as prefixes. | [optional] [default to 'prefixLast'] +**removeWordsIfNoResults** | **string** | Selects a strategy to remove words from the query when it doesn't match any hits. | [optional] [default to 'none'] +**advancedSyntax** | **bool** | Enables the advanced query syntax. | [optional] [default to false] +**optionalWords** | **string[]** | A list of words that should be considered as optional when found in the query. | [optional] +**disableExactOnAttributes** | **string[]** | List of attributes on which you want to disable the exact ranking criterion. | [optional] +**exactOnSingleWordQuery** | **string** | Controls how the exact ranking criterion is computed when the query contains only one word. | [optional] [default to 'attribute'] +**alternativesAsExact** | **string[]** | List of alternatives that should be considered an exact match by the exact ranking criterion. | [optional] +**advancedSyntaxFeatures** | **string[]** | Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. | [optional] +**distinct** | **int** | Enables de-duplication or grouping of results. | [optional] [default to 0] +**synonyms** | **bool** | Whether to take into account an index's synonyms for a particular search. | [optional] [default to true] +**replaceSynonymsInHighlight** | **bool** | Whether to highlight and snippet the original word that matches the synonym or the synonym itself. | [optional] [default to false] +**minProximity** | **int** | Precision of the proximity ranking criterion. | [optional] [default to 1] +**responseFields** | **string[]** | Choose which fields to return in the API response. This parameters applies to search and browse queries. | [optional] +**maxFacetHits** | **int** | Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. | [optional] [default to 10] +**attributeCriteriaComputedByMinProximity** | **bool** | When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. | [optional] [default to false] +**renderingContent** | **object** | Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/KeyObject.md b/clients/algoliasearch-client-php/docs/Model/KeyObject.md new file mode 100644 index 0000000000..ae9fd12b35 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/KeyObject.md @@ -0,0 +1,17 @@ +# # KeyObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**acl** | **string[]** | Set of permissions associated with the key. | +**description** | **string** | A comment used to identify a key more easily in the dashboard. It is not interpreted by the API. | [optional] [default to ''] +**indexes** | **string[]** | Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed. | [optional] +**maxHitsPerQuery** | **int** | Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. | [optional] [default to 0] +**maxQueriesPerIPPerHour** | **int** | Maximum number of API calls per hour allowed from a given IP address or a user token. | [optional] [default to 0] +**queryParameters** | **string** | URL-encoded query string. Force some query parameters to be applied for each query made with this API key. | [optional] [default to ''] +**referers** | **string[]** | Restrict this new API key to specific referers. If empty or blank, defaults to all referers. | [optional] +**validity** | **int** | Validity limit for this key in seconds. The key will automatically be removed after this period of time. | [optional] [default to 0] +**createdAt** | **\DateTime** | Date of creation (ISO-8601 format). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Languages.md b/clients/algoliasearch-client-php/docs/Model/Languages.md new file mode 100644 index 0000000000..e773db9f3e --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/Languages.md @@ -0,0 +1,11 @@ +# # Languages + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**plurals** | [**\Algolia\AlgoliaSearch\Model\DictionaryLanguage**](DictionaryLanguage.md) | | +**stopwords** | [**\Algolia\AlgoliaSearch\Model\DictionaryLanguage**](DictionaryLanguage.md) | | +**compounds** | [**\Algolia\AlgoliaSearch\Model\DictionaryLanguage**](DictionaryLanguage.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ListApiKeysResponse.md b/clients/algoliasearch-client-php/docs/Model/ListApiKeysResponse.md new file mode 100644 index 0000000000..58e3c50712 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/ListApiKeysResponse.md @@ -0,0 +1,9 @@ +# # ListApiKeysResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**keys** | [**\Algolia\AlgoliaSearch\Model\KeyObject[]**](KeyObject.md) | List of api keys. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ListClustersResponse.md b/clients/algoliasearch-client-php/docs/Model/ListClustersResponse.md new file mode 100644 index 0000000000..fef1cbdf5e --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/ListClustersResponse.md @@ -0,0 +1,9 @@ +# # ListClustersResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**topUsers** | **string[]** | Mapping of cluster names to top users. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ListIndicesResponse.md b/clients/algoliasearch-client-php/docs/Model/ListIndicesResponse.md new file mode 100644 index 0000000000..5155de572b --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/ListIndicesResponse.md @@ -0,0 +1,10 @@ +# # ListIndicesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**\Algolia\AlgoliaSearch\Model\Index[]**](Index.md) | List of the fetched indices. | [optional] +**nbPages** | **int** | Number of pages. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ListUserIdsResponse.md b/clients/algoliasearch-client-php/docs/Model/ListUserIdsResponse.md new file mode 100644 index 0000000000..669e0339af --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/ListUserIdsResponse.md @@ -0,0 +1,9 @@ +# # ListUserIdsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userIDs** | [**\Algolia\AlgoliaSearch\Model\UserId[]**](UserId.md) | List of userIDs. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/MultipleBatchResponse.md b/clients/algoliasearch-client-php/docs/Model/MultipleBatchResponse.md new file mode 100644 index 0000000000..edf260187f --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/MultipleBatchResponse.md @@ -0,0 +1,10 @@ +# # MultipleBatchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taskID** | **array** | List of tasksIDs per index. | [optional] +**objectIDs** | **string[]** | List of objectID. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/MultipleGetObjectsObject.md b/clients/algoliasearch-client-php/docs/Model/MultipleGetObjectsObject.md new file mode 100644 index 0000000000..298e7b0a18 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/MultipleGetObjectsObject.md @@ -0,0 +1,11 @@ +# # MultipleGetObjectsObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributesToRetrieve** | **string[]** | List of attributes to retrieve. By default, all retrievable attributes are returned. | [optional] +**objectID** | **string** | ID of the object within that index. | +**indexName** | **string** | name of the index containing the object. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/MultipleQueries.md b/clients/algoliasearch-client-php/docs/Model/MultipleQueries.md new file mode 100644 index 0000000000..32369cc025 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/MultipleQueries.md @@ -0,0 +1,13 @@ +# # MultipleQueries + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**indexName** | **string** | The Algolia index name. | +**query** | **string** | The text to search in the index. | [optional] [default to ''] +**type** | **string** | Perform a search query with `default`, will search for facet values if `facet` is given. | [optional] [default to 'default'] +**facet** | **string** | The `facet` name. | [optional] +**params** | **string** | A query string of search parameters. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/MultipleQueriesObject.md b/clients/algoliasearch-client-php/docs/Model/MultipleQueriesObject.md new file mode 100644 index 0000000000..33aa884adf --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/MultipleQueriesObject.md @@ -0,0 +1,10 @@ +# # MultipleQueriesObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requests** | [**\Algolia\AlgoliaSearch\Model\MultipleQueries[]**](MultipleQueries.md) | | +**strategy** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/MultipleQueriesResponse.md b/clients/algoliasearch-client-php/docs/Model/MultipleQueriesResponse.md new file mode 100644 index 0000000000..38a30d184a --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/MultipleQueriesResponse.md @@ -0,0 +1,9 @@ +# # MultipleQueriesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**\Algolia\AlgoliaSearch\Model\SearchResponse[]**](SearchResponse.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Operation.md b/clients/algoliasearch-client-php/docs/Model/Operation.md new file mode 100644 index 0000000000..e0cde21a6f --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/Operation.md @@ -0,0 +1,11 @@ +# # Operation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | [**\Algolia\AlgoliaSearch\Model\Action**](Action.md) | | [optional] +**body** | **array** | arguments to the operation (depends on the type of the operation). | [optional] +**indexName** | **string** | Index to target for this operation. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/OperationIndexObject.md b/clients/algoliasearch-client-php/docs/Model/OperationIndexObject.md new file mode 100644 index 0000000000..e841be9638 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/OperationIndexObject.md @@ -0,0 +1,11 @@ +# # OperationIndexObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**operation** | **string** | Type of operation to perform (move or copy). | +**destination** | **string** | The Algolia index name. | +**scope** | **string[]** | Scope of the data to copy. When absent, a full copy is performed. When present, only the selected scopes are copied. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Params.md b/clients/algoliasearch-client-php/docs/Model/Params.md new file mode 100644 index 0000000000..17733ef9b3 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/Params.md @@ -0,0 +1,11 @@ +# # Params + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query** | **string** | Query string. | [optional] +**automaticFacetFilters** | [**\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]**](AutomaticFacetFilter.md) | Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern. | [optional] +**automaticOptionalFacetFilters** | [**\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]**](AutomaticFacetFilter.md) | Same syntax as automaticFacetFilters, but the engine treats the filters as optional. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Promote.md b/clients/algoliasearch-client-php/docs/Model/Promote.md new file mode 100644 index 0000000000..b4994e9856 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/Promote.md @@ -0,0 +1,11 @@ +# # Promote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**objectID** | **string** | Unique identifier of the object to promote. | [optional] +**objectIDs** | **string[]** | Array of unique identifiers of the objects to promote. | [optional] +**position** | **int** | The position to promote the objects to (zero-based). If you pass objectIDs, the objects are placed at this position as a group. For example, if you pass four objectIDs to position 0, the objects take the first four positions. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/RankingInfo.md b/clients/algoliasearch-client-php/docs/Model/RankingInfo.md new file mode 100644 index 0000000000..fe506ae957 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/RankingInfo.md @@ -0,0 +1,19 @@ +# # RankingInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filters** | **int** | This field is reserved for advanced usage. | [optional] +**firstMatchedWord** | **int** | Position of the most important matched attribute in the attributes to index list. | [optional] +**geoDistance** | **int** | Distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters). | [optional] +**geoPrecision** | **int** | Precision used when computing the geo distance, in meters. | [optional] +**matchedGeoLocation** | [**array**](RankingInfoMatchedGeoLocation.md) | | [optional] +**nbExactWords** | **int** | Number of exactly matched words. | [optional] +**nbTypos** | **int** | Number of typos encountered when matching the record. | [optional] +**promoted** | **bool** | Present and set to true if a Rule promoted the hit. | [optional] +**proximityDistance** | **int** | When the query contains more than one word, the sum of the distances between matched words (in meters). | [optional] +**userScore** | **int** | Custom ranking for the object, expressed as a single integer value. | [optional] +**word** | **int** | Number of matched words, including prefixes and typos. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/RankingInfoMatchedGeoLocation.md b/clients/algoliasearch-client-php/docs/Model/RankingInfoMatchedGeoLocation.md new file mode 100644 index 0000000000..e2656bdd7a --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/RankingInfoMatchedGeoLocation.md @@ -0,0 +1,11 @@ +# # RankingInfoMatchedGeoLocation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**lat** | **double** | Latitude of the matched location. | [optional] +**lng** | **double** | Longitude of the matched location. | [optional] +**distance** | **int** | Distance between the matched location and the search location (in meters). | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Record.md b/clients/algoliasearch-client-php/docs/Model/Record.md new file mode 100644 index 0000000000..35d17fdd4e --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/Record.md @@ -0,0 +1,13 @@ +# # Record + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**objectID** | **string** | Unique identifier of the object. | +**highlightResult** | [**\Algolia\AlgoliaSearch\Model\HighlightResult**](HighlightResult.md) | | [optional] +**snippetResult** | [**\Algolia\AlgoliaSearch\Model\SnippetResult**](SnippetResult.md) | | [optional] +**rankingInfo** | [**\Algolia\AlgoliaSearch\Model\RankingInfo**](RankingInfo.md) | | [optional] +**distinctSeqID** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/RemoveUserIdResponse.md b/clients/algoliasearch-client-php/docs/Model/RemoveUserIdResponse.md new file mode 100644 index 0000000000..b87a842977 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/RemoveUserIdResponse.md @@ -0,0 +1,9 @@ +# # RemoveUserIdResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deletedAt** | **\DateTime** | Date of deletion (ISO-8601 format). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ReplaceSourceResponse.md b/clients/algoliasearch-client-php/docs/Model/ReplaceSourceResponse.md new file mode 100644 index 0000000000..1317d81ebc --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/ReplaceSourceResponse.md @@ -0,0 +1,9 @@ +# # ReplaceSourceResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/RequiredSearchParams.md b/clients/algoliasearch-client-php/docs/Model/RequiredSearchParams.md new file mode 100644 index 0000000000..69b2d4b1fc --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/RequiredSearchParams.md @@ -0,0 +1,9 @@ +# # RequiredSearchParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query** | **string** | The text to search in the index. | [default to ''] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Rule.md b/clients/algoliasearch-client-php/docs/Model/Rule.md new file mode 100644 index 0000000000..1a8258509d --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/Rule.md @@ -0,0 +1,14 @@ +# # Rule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**objectID** | **string** | Unique identifier of the object. | +**conditions** | [**\Algolia\AlgoliaSearch\Model\Condition[]**](Condition.md) | A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule. | [optional] +**consequence** | [**\Algolia\AlgoliaSearch\Model\Consequence**](Consequence.md) | | +**description** | **string** | This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It's not interpreted by the API. | [optional] +**enabled** | **bool** | Whether the Rule is enabled. Disabled Rules remain in the index, but aren't applied at query time. | [optional] [default to true] +**validity** | [**\Algolia\AlgoliaSearch\Model\TimeRange[]**](TimeRange.md) | By default, Rules are permanently valid. When validity periods are specified, the Rule applies only during those periods; it's ignored the rest of the time. The list must not be empty. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SaveObjectResponse.md b/clients/algoliasearch-client-php/docs/Model/SaveObjectResponse.md new file mode 100644 index 0000000000..78b5687749 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SaveObjectResponse.md @@ -0,0 +1,11 @@ +# # SaveObjectResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**createdAt** | **string** | | [optional] +**taskID** | **int** | taskID of the indexing task to wait for. | [optional] +**objectID** | **string** | Unique identifier of the object. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SaveSynonymResponse.md b/clients/algoliasearch-client-php/docs/Model/SaveSynonymResponse.md new file mode 100644 index 0000000000..fabf0b890f --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SaveSynonymResponse.md @@ -0,0 +1,11 @@ +# # SaveSynonymResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taskID** | **int** | taskID of the indexing task to wait for. | +**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | +**id** | **string** | objectID of the inserted object. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchDictionaryEntries.md b/clients/algoliasearch-client-php/docs/Model/SearchDictionaryEntries.md new file mode 100644 index 0000000000..5d7a8b0157 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchDictionaryEntries.md @@ -0,0 +1,12 @@ +# # SearchDictionaryEntries + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query** | **string** | The text to search in the index. | [default to ''] +**page** | **int** | Specify the page to retrieve. | [optional] [default to 0] +**hitsPerPage** | **int** | Set the number of hits per page. | [optional] [default to 20] +**language** | **string** | Language ISO code supported by the dictionary (e.g., \"en\" for English). | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesRequest.md b/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesRequest.md new file mode 100644 index 0000000000..f8d9590d0b --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesRequest.md @@ -0,0 +1,11 @@ +# # SearchForFacetValuesRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**params** | **string** | Search parameters as URL-encoded query string. | [optional] [default to ''] +**facetQuery** | **string** | Text to search inside the facet's values. | [optional] [default to ''] +**maxFacetHits** | **int** | Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. | [optional] [default to 10] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponse.md b/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponse.md new file mode 100644 index 0000000000..1a755869e9 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponse.md @@ -0,0 +1,9 @@ +# # SearchForFacetValuesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**facetHits** | [**\Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponseFacetHits[]**](SearchForFacetValuesResponseFacetHits.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponseFacetHits.md b/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponseFacetHits.md new file mode 100644 index 0000000000..35d97604d6 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponseFacetHits.md @@ -0,0 +1,11 @@ +# # SearchForFacetValuesResponseFacetHits + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **string** | Raw value of the facet. | +**highlighted** | **string** | Markup text with occurrences highlighted. | +**count** | **int** | How many objects contain this facet value. This takes into account the extra search parameters specified in the query. Like for a regular search query, the counts may not be exhaustive. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchHits.md b/clients/algoliasearch-client-php/docs/Model/SearchHits.md new file mode 100644 index 0000000000..7ceaf3e1a1 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchHits.md @@ -0,0 +1,9 @@ +# # SearchHits + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hits** | [**\Algolia\AlgoliaSearch\Model\Record[]**](Record.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchParams.md b/clients/algoliasearch-client-php/docs/Model/SearchParams.md new file mode 100644 index 0000000000..b6b8430a54 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchParams.md @@ -0,0 +1,86 @@ +# # SearchParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**params** | **string** | Search parameters as URL-encoded query string. | [optional] [default to ''] +**similarQuery** | **string** | Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. | [optional] [default to ''] +**filters** | **string** | Filter the query with numeric, facet and/or tag filters. | [optional] [default to ''] +**facetFilters** | **string[]** | Filter hits by facet value. | [optional] +**optionalFilters** | **string[]** | Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. | [optional] +**numericFilters** | **string[]** | Filter on numeric attributes. | [optional] +**tagFilters** | **string[]** | Filter hits by tags. | [optional] +**sumOrFiltersScores** | **bool** | Determines how to calculate the total score for filtering. | [optional] [default to false] +**facets** | **string[]** | Retrieve facets and their facet values. | [optional] +**maxValuesPerFacet** | **int** | Maximum number of facet values to return for each facet during a regular search. | [optional] [default to 100] +**facetingAfterDistinct** | **bool** | Force faceting to be applied after de-duplication (via the Distinct setting). | [optional] [default to false] +**sortFacetValuesBy** | **string** | Controls how facet values are fetched. | [optional] [default to 'count'] +**page** | **int** | Specify the page to retrieve. | [optional] [default to 0] +**offset** | **int** | Specify the offset of the first hit to return. | [optional] +**length** | **int** | Set the number of hits to retrieve (used only with offset). | [optional] +**aroundLatLng** | **string** | Search for entries around a central geolocation, enabling a geo search within a circular area. | [optional] [default to ''] +**aroundLatLngViaIP** | **bool** | Search for entries around a given location automatically computed from the requester's IP address. | [optional] [default to false] +**aroundRadius** | [**OneOfIntegerString**](OneOfIntegerString.md) | Define the maximum radius for a geo search (in meters). | [optional] +**aroundPrecision** | **int** | Precision of geo search (in meters), to add grouping by geo location to the ranking formula. | [optional] [default to 10] +**minimumAroundRadius** | **int** | Minimum radius (in meters) used for a geo search when aroundRadius is not set. | [optional] +**insideBoundingBox** | **float[]** | Search inside a rectangular area (in geo coordinates). | [optional] +**insidePolygon** | **float[]** | Search inside a polygon (in geo coordinates). | [optional] +**naturalLanguages** | **string[]** | This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. | [optional] +**ruleContexts** | **string[]** | Enables contextual rules. | [optional] +**personalizationImpact** | **int** | Define the impact of the Personalization feature. | [optional] [default to 100] +**userToken** | **string** | Associates a certain user token with the current search. | [optional] +**getRankingInfo** | **bool** | Retrieve detailed ranking information. | [optional] [default to false] +**clickAnalytics** | **bool** | Enable the Click Analytics feature. | [optional] [default to false] +**analytics** | **bool** | Whether the current query will be taken into account in the Analytics. | [optional] [default to true] +**analyticsTags** | **string[]** | List of tags to apply to the query for analytics purposes. | [optional] +**percentileComputation** | **bool** | Whether to include or exclude a query from the processing-time percentile computation. | [optional] [default to true] +**enableABTest** | **bool** | Whether this search should participate in running AB tests. | [optional] [default to true] +**enableReRanking** | **bool** | Whether this search should use AI Re-Ranking. | [optional] [default to true] +**query** | **string** | The text to search in the index. | [default to ''] +**searchableAttributes** | **string[]** | The complete list of attributes used for searching. | [optional] +**attributesForFaceting** | **string[]** | The complete list of attributes that will be used for faceting. | [optional] +**unretrievableAttributes** | **string[]** | List of attributes that can't be retrieved at query time. | [optional] +**attributesToRetrieve** | **string[]** | This parameter controls which attributes to retrieve and which not to retrieve. | [optional] +**restrictSearchableAttributes** | **string[]** | Restricts a given query to look in only a subset of your searchable attributes. | [optional] +**ranking** | **string[]** | Controls how Algolia should sort your results. | [optional] +**customRanking** | **string[]** | Specifies the custom ranking criterion. | [optional] +**relevancyStrictness** | **int** | Controls the relevancy threshold below which less relevant results aren't included in the results. | [optional] [default to 100] +**attributesToHighlight** | **string[]** | List of attributes to highlight. | [optional] +**attributesToSnippet** | **string[]** | List of attributes to snippet, with an optional maximum number of words to snippet. | [optional] +**highlightPreTag** | **string** | The HTML string to insert before the highlighted parts in all highlight and snippet results. | [optional] [default to ''] +**highlightPostTag** | **string** | The HTML string to insert after the highlighted parts in all highlight and snippet results. | [optional] [default to ''] +**snippetEllipsisText** | **string** | String used as an ellipsis indicator when a snippet is truncated. | [optional] [default to '…'] +**restrictHighlightAndSnippetArrays** | **bool** | Restrict highlighting and snippeting to items that matched the query. | [optional] [default to false] +**hitsPerPage** | **int** | Set the number of hits per page. | [optional] [default to 20] +**minWordSizefor1Typo** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 1 typo. | [optional] [default to 4] +**minWordSizefor2Typos** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 2 typos. | [optional] [default to 8] +**typoTolerance** | **string** | Controls whether typo tolerance is enabled and how it is applied. | [optional] [default to 'true'] +**allowTyposOnNumericTokens** | **bool** | Whether to allow typos on numbers (\"numeric tokens\") in the query string. | [optional] [default to true] +**disableTypoToleranceOnAttributes** | **string[]** | List of attributes on which you want to disable typo tolerance. | [optional] +**separatorsToIndex** | **string** | Control which separators are indexed. | [optional] [default to ''] +**ignorePlurals** | **string** | Treats singular, plurals, and other forms of declensions as matching terms. | [optional] [default to 'false'] +**removeStopWords** | **string** | Removes stop (common) words from the query before executing it. | [optional] [default to 'false'] +**keepDiacriticsOnCharacters** | **string** | List of characters that the engine shouldn't automatically normalize. | [optional] [default to ''] +**queryLanguages** | **string[]** | Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. | [optional] +**decompoundQuery** | **bool** | Splits compound words into their composing atoms in the query. | [optional] [default to true] +**enableRules** | **bool** | Whether Rules should be globally enabled. | [optional] [default to true] +**enablePersonalization** | **bool** | Enable the Personalization feature. | [optional] [default to false] +**queryType** | **string** | Controls if and how query words are interpreted as prefixes. | [optional] [default to 'prefixLast'] +**removeWordsIfNoResults** | **string** | Selects a strategy to remove words from the query when it doesn't match any hits. | [optional] [default to 'none'] +**advancedSyntax** | **bool** | Enables the advanced query syntax. | [optional] [default to false] +**optionalWords** | **string[]** | A list of words that should be considered as optional when found in the query. | [optional] +**disableExactOnAttributes** | **string[]** | List of attributes on which you want to disable the exact ranking criterion. | [optional] +**exactOnSingleWordQuery** | **string** | Controls how the exact ranking criterion is computed when the query contains only one word. | [optional] [default to 'attribute'] +**alternativesAsExact** | **string[]** | List of alternatives that should be considered an exact match by the exact ranking criterion. | [optional] +**advancedSyntaxFeatures** | **string[]** | Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. | [optional] +**distinct** | **int** | Enables de-duplication or grouping of results. | [optional] [default to 0] +**synonyms** | **bool** | Whether to take into account an index's synonyms for a particular search. | [optional] [default to true] +**replaceSynonymsInHighlight** | **bool** | Whether to highlight and snippet the original word that matches the synonym or the synonym itself. | [optional] [default to false] +**minProximity** | **int** | Precision of the proximity ranking criterion. | [optional] [default to 1] +**responseFields** | **string[]** | Choose which fields to return in the API response. This parameters applies to search and browse queries. | [optional] +**maxFacetHits** | **int** | Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. | [optional] [default to 10] +**attributeCriteriaComputedByMinProximity** | **bool** | When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. | [optional] [default to false] +**renderingContent** | **object** | Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchParamsObject.md b/clients/algoliasearch-client-php/docs/Model/SearchParamsObject.md new file mode 100644 index 0000000000..8df35e3b47 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchParamsObject.md @@ -0,0 +1,85 @@ +# # SearchParamsObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**similarQuery** | **string** | Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. | [optional] [default to ''] +**filters** | **string** | Filter the query with numeric, facet and/or tag filters. | [optional] [default to ''] +**facetFilters** | **string[]** | Filter hits by facet value. | [optional] +**optionalFilters** | **string[]** | Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. | [optional] +**numericFilters** | **string[]** | Filter on numeric attributes. | [optional] +**tagFilters** | **string[]** | Filter hits by tags. | [optional] +**sumOrFiltersScores** | **bool** | Determines how to calculate the total score for filtering. | [optional] [default to false] +**facets** | **string[]** | Retrieve facets and their facet values. | [optional] +**maxValuesPerFacet** | **int** | Maximum number of facet values to return for each facet during a regular search. | [optional] [default to 100] +**facetingAfterDistinct** | **bool** | Force faceting to be applied after de-duplication (via the Distinct setting). | [optional] [default to false] +**sortFacetValuesBy** | **string** | Controls how facet values are fetched. | [optional] [default to 'count'] +**page** | **int** | Specify the page to retrieve. | [optional] [default to 0] +**offset** | **int** | Specify the offset of the first hit to return. | [optional] +**length** | **int** | Set the number of hits to retrieve (used only with offset). | [optional] +**aroundLatLng** | **string** | Search for entries around a central geolocation, enabling a geo search within a circular area. | [optional] [default to ''] +**aroundLatLngViaIP** | **bool** | Search for entries around a given location automatically computed from the requester's IP address. | [optional] [default to false] +**aroundRadius** | [**OneOfIntegerString**](OneOfIntegerString.md) | Define the maximum radius for a geo search (in meters). | [optional] +**aroundPrecision** | **int** | Precision of geo search (in meters), to add grouping by geo location to the ranking formula. | [optional] [default to 10] +**minimumAroundRadius** | **int** | Minimum radius (in meters) used for a geo search when aroundRadius is not set. | [optional] +**insideBoundingBox** | **float[]** | Search inside a rectangular area (in geo coordinates). | [optional] +**insidePolygon** | **float[]** | Search inside a polygon (in geo coordinates). | [optional] +**naturalLanguages** | **string[]** | This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. | [optional] +**ruleContexts** | **string[]** | Enables contextual rules. | [optional] +**personalizationImpact** | **int** | Define the impact of the Personalization feature. | [optional] [default to 100] +**userToken** | **string** | Associates a certain user token with the current search. | [optional] +**getRankingInfo** | **bool** | Retrieve detailed ranking information. | [optional] [default to false] +**clickAnalytics** | **bool** | Enable the Click Analytics feature. | [optional] [default to false] +**analytics** | **bool** | Whether the current query will be taken into account in the Analytics. | [optional] [default to true] +**analyticsTags** | **string[]** | List of tags to apply to the query for analytics purposes. | [optional] +**percentileComputation** | **bool** | Whether to include or exclude a query from the processing-time percentile computation. | [optional] [default to true] +**enableABTest** | **bool** | Whether this search should participate in running AB tests. | [optional] [default to true] +**enableReRanking** | **bool** | Whether this search should use AI Re-Ranking. | [optional] [default to true] +**query** | **string** | The text to search in the index. | [default to ''] +**searchableAttributes** | **string[]** | The complete list of attributes used for searching. | [optional] +**attributesForFaceting** | **string[]** | The complete list of attributes that will be used for faceting. | [optional] +**unretrievableAttributes** | **string[]** | List of attributes that can't be retrieved at query time. | [optional] +**attributesToRetrieve** | **string[]** | This parameter controls which attributes to retrieve and which not to retrieve. | [optional] +**restrictSearchableAttributes** | **string[]** | Restricts a given query to look in only a subset of your searchable attributes. | [optional] +**ranking** | **string[]** | Controls how Algolia should sort your results. | [optional] +**customRanking** | **string[]** | Specifies the custom ranking criterion. | [optional] +**relevancyStrictness** | **int** | Controls the relevancy threshold below which less relevant results aren't included in the results. | [optional] [default to 100] +**attributesToHighlight** | **string[]** | List of attributes to highlight. | [optional] +**attributesToSnippet** | **string[]** | List of attributes to snippet, with an optional maximum number of words to snippet. | [optional] +**highlightPreTag** | **string** | The HTML string to insert before the highlighted parts in all highlight and snippet results. | [optional] [default to ''] +**highlightPostTag** | **string** | The HTML string to insert after the highlighted parts in all highlight and snippet results. | [optional] [default to ''] +**snippetEllipsisText** | **string** | String used as an ellipsis indicator when a snippet is truncated. | [optional] [default to '…'] +**restrictHighlightAndSnippetArrays** | **bool** | Restrict highlighting and snippeting to items that matched the query. | [optional] [default to false] +**hitsPerPage** | **int** | Set the number of hits per page. | [optional] [default to 20] +**minWordSizefor1Typo** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 1 typo. | [optional] [default to 4] +**minWordSizefor2Typos** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 2 typos. | [optional] [default to 8] +**typoTolerance** | **string** | Controls whether typo tolerance is enabled and how it is applied. | [optional] [default to 'true'] +**allowTyposOnNumericTokens** | **bool** | Whether to allow typos on numbers (\"numeric tokens\") in the query string. | [optional] [default to true] +**disableTypoToleranceOnAttributes** | **string[]** | List of attributes on which you want to disable typo tolerance. | [optional] +**separatorsToIndex** | **string** | Control which separators are indexed. | [optional] [default to ''] +**ignorePlurals** | **string** | Treats singular, plurals, and other forms of declensions as matching terms. | [optional] [default to 'false'] +**removeStopWords** | **string** | Removes stop (common) words from the query before executing it. | [optional] [default to 'false'] +**keepDiacriticsOnCharacters** | **string** | List of characters that the engine shouldn't automatically normalize. | [optional] [default to ''] +**queryLanguages** | **string[]** | Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. | [optional] +**decompoundQuery** | **bool** | Splits compound words into their composing atoms in the query. | [optional] [default to true] +**enableRules** | **bool** | Whether Rules should be globally enabled. | [optional] [default to true] +**enablePersonalization** | **bool** | Enable the Personalization feature. | [optional] [default to false] +**queryType** | **string** | Controls if and how query words are interpreted as prefixes. | [optional] [default to 'prefixLast'] +**removeWordsIfNoResults** | **string** | Selects a strategy to remove words from the query when it doesn't match any hits. | [optional] [default to 'none'] +**advancedSyntax** | **bool** | Enables the advanced query syntax. | [optional] [default to false] +**optionalWords** | **string[]** | A list of words that should be considered as optional when found in the query. | [optional] +**disableExactOnAttributes** | **string[]** | List of attributes on which you want to disable the exact ranking criterion. | [optional] +**exactOnSingleWordQuery** | **string** | Controls how the exact ranking criterion is computed when the query contains only one word. | [optional] [default to 'attribute'] +**alternativesAsExact** | **string[]** | List of alternatives that should be considered an exact match by the exact ranking criterion. | [optional] +**advancedSyntaxFeatures** | **string[]** | Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. | [optional] +**distinct** | **int** | Enables de-duplication or grouping of results. | [optional] [default to 0] +**synonyms** | **bool** | Whether to take into account an index's synonyms for a particular search. | [optional] [default to true] +**replaceSynonymsInHighlight** | **bool** | Whether to highlight and snippet the original word that matches the synonym or the synonym itself. | [optional] [default to false] +**minProximity** | **int** | Precision of the proximity ranking criterion. | [optional] [default to 1] +**responseFields** | **string[]** | Choose which fields to return in the API response. This parameters applies to search and browse queries. | [optional] +**maxFacetHits** | **int** | Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. | [optional] [default to 10] +**attributeCriteriaComputedByMinProximity** | **bool** | When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. | [optional] [default to false] +**renderingContent** | **object** | Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchParamsString.md b/clients/algoliasearch-client-php/docs/Model/SearchParamsString.md new file mode 100644 index 0000000000..3e0dbbd57a --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchParamsString.md @@ -0,0 +1,9 @@ +# # SearchParamsString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**params** | **string** | Search parameters as URL-encoded query string. | [optional] [default to ''] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchResponse.md b/clients/algoliasearch-client-php/docs/Model/SearchResponse.md new file mode 100644 index 0000000000..bd035d4f1a --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchResponse.md @@ -0,0 +1,33 @@ +# # SearchResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**abTestID** | **int** | If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID. | [optional] +**abTestVariantID** | **int** | If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used. | [optional] +**aroundLatLng** | **string** | The computed geo location. | [optional] +**automaticRadius** | **string** | The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. | [optional] +**exhaustiveFacetsCount** | **bool** | Whether the facet count is exhaustive or approximate. | [optional] +**exhaustiveNbHits** | **bool** | Indicate if the nbHits count was exhaustive or approximate | +**exhaustiveTypo** | **bool** | Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) | +**facets** | **array>** | A mapping of each facet name to the corresponding facet counts. | [optional] +**facetsStats** | [**array**](BaseSearchResponseFacetsStats.md) | Statistics for numerical facets. | [optional] +**hitsPerPage** | **int** | Set the number of hits per page. | [default to 20] +**index** | **string** | Index name used for the query. | [optional] +**indexUsed** | **string** | Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. | [optional] +**message** | **string** | Used to return warnings about the query. | [optional] +**nbHits** | **int** | Number of hits that the search query matched. | +**nbPages** | **int** | Number of pages available for the current query | +**nbSortedHits** | **int** | The number of hits selected and sorted by the relevant sort algorithm | [optional] +**page** | **int** | Specify the page to retrieve. | [default to 0] +**params** | **string** | A url-encoded string of all search parameters. | +**parsedQuery** | **string** | The query string that will be searched, after normalization. | [optional] +**processingTimeMS** | **int** | Time the server took to process the request, in milliseconds. | +**query** | **string** | The text to search in the index. | [default to ''] +**queryAfterRemoval** | **string** | A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. | [optional] +**serverUsed** | **string** | Actual host name of the server that processed the request. | [optional] +**userData** | **array** | Lets you store custom data in your indices. | [optional] +**hits** | [**\Algolia\AlgoliaSearch\Model\Record[]**](Record.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchRulesParams.md b/clients/algoliasearch-client-php/docs/Model/SearchRulesParams.md new file mode 100644 index 0000000000..239d32e40d --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchRulesParams.md @@ -0,0 +1,15 @@ +# # SearchRulesParams + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query** | **string** | Full text query. | [optional] [default to ''] +**anchoring** | [**\Algolia\AlgoliaSearch\Model\Anchoring**](Anchoring.md) | | [optional] +**context** | **string** | Restricts matches to contextual rules with a specific context (exact match). | [optional] +**page** | **int** | Requested page (zero-based). | [optional] [default to 0] +**hitsPerPage** | **int** | Maximum number of hits in a page. Minimum is 1, maximum is 1000. | [optional] [default to 20] +**enabled** | **bool** | When specified, restricts matches to rules with a specific enabled status. When absent (default), all rules are retrieved, regardless of their enabled status. | [optional] +**requestOptions** | **array[]** | A mapping of requestOptions to send along with the request. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchRulesResponse.md b/clients/algoliasearch-client-php/docs/Model/SearchRulesResponse.md new file mode 100644 index 0000000000..ff916fc82e --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchRulesResponse.md @@ -0,0 +1,12 @@ +# # SearchRulesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hits** | [**\Algolia\AlgoliaSearch\Model\Rule[]**](Rule.md) | Fetched rules. | +**nbHits** | **int** | Number of fetched rules. | +**page** | **int** | Current page. | +**nbPages** | **int** | Number of pages. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchSynonymsResponse.md b/clients/algoliasearch-client-php/docs/Model/SearchSynonymsResponse.md new file mode 100644 index 0000000000..9a160e8c7d --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchSynonymsResponse.md @@ -0,0 +1,10 @@ +# # SearchSynonymsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hits** | [**\Algolia\AlgoliaSearch\Model\SynonymHit[]**](SynonymHit.md) | Array of synonym objects. | +**nbHits** | **int** | Number of hits that the search query matched. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchUserIdsObject.md b/clients/algoliasearch-client-php/docs/Model/SearchUserIdsObject.md new file mode 100644 index 0000000000..f0e986492e --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchUserIdsObject.md @@ -0,0 +1,12 @@ +# # SearchUserIdsObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**query** | **string** | Query to search. The search is a prefix search with typoTolerance. Use empty query to retrieve all users. | +**clusterName** | **string** | Name of the cluster. | [optional] +**page** | **int** | Specify the page to retrieve. | [optional] [default to 0] +**hitsPerPage** | **int** | Set the number of hits per page. | [optional] [default to 20] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponse.md b/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponse.md new file mode 100644 index 0000000000..fcf15b69a1 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponse.md @@ -0,0 +1,13 @@ +# # SearchUserIdsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hits** | [**\Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHits[]**](SearchUserIdsResponseHits.md) | List of user object matching the query. | +**nbHits** | **int** | Number of hits that the search query matched. | +**page** | **int** | Specify the page to retrieve. | [default to 0] +**hitsPerPage** | **int** | Maximum number of hits in a page. Minimum is 1, maximum is 1000. | [default to 20] +**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHighlightResult.md b/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHighlightResult.md new file mode 100644 index 0000000000..191fc1f7c3 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHighlightResult.md @@ -0,0 +1,10 @@ +# # SearchUserIdsResponseHighlightResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userID** | [**\Algolia\AlgoliaSearch\Model\HighlightResult**](HighlightResult.md) | | +**clusterName** | [**\Algolia\AlgoliaSearch\Model\HighlightResult**](HighlightResult.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHits.md b/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHits.md new file mode 100644 index 0000000000..9b49743086 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHits.md @@ -0,0 +1,14 @@ +# # SearchUserIdsResponseHits + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userID** | [**\Algolia\AlgoliaSearch\Model\UserId**](UserId.md) | | +**clusterName** | **string** | Name of the cluster. | +**nbRecords** | **int** | Number of records in the cluster. | +**dataSize** | **int** | Data size taken by all the users assigned to the cluster. | +**objectID** | **string** | userID of the requested user. Same as userID. | +**highlightResult** | [**\Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHighlightResult**](SearchUserIdsResponseHighlightResult.md) | | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SnippetResult.md b/clients/algoliasearch-client-php/docs/Model/SnippetResult.md new file mode 100644 index 0000000000..a706605139 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SnippetResult.md @@ -0,0 +1,10 @@ +# # SnippetResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **string** | Markup text with occurrences highlighted. | [optional] +**matchLevel** | **string** | Indicates how well the attribute matched the search query. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Source.md b/clients/algoliasearch-client-php/docs/Model/Source.md new file mode 100644 index 0000000000..e76b64d7f2 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/Source.md @@ -0,0 +1,10 @@ +# # Source + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source** | **string** | The IP range of the source. | +**description** | **string** | The description of the source. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/StandardEntries.md b/clients/algoliasearch-client-php/docs/Model/StandardEntries.md new file mode 100644 index 0000000000..7209819299 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/StandardEntries.md @@ -0,0 +1,11 @@ +# # StandardEntries + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**plurals** | **array** | Language ISO code. | [optional] +**stopwords** | **array** | Language ISO code. | [optional] +**compounds** | **array** | Language ISO code. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SynonymHit.md b/clients/algoliasearch-client-php/docs/Model/SynonymHit.md new file mode 100644 index 0000000000..10a89ddc6c --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SynonymHit.md @@ -0,0 +1,17 @@ +# # SynonymHit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**objectID** | **string** | Unique identifier of the synonym object to be created or updated. | +**type** | **string** | Type of the synonym object. | +**synonyms** | **string[]** | Words or phrases to be considered equivalent. | [optional] +**input** | **string** | Word or phrase to appear in query strings (for onewaysynonym). | [optional] +**word** | **string** | Word or phrase to appear in query strings (for altcorrection1 and altcorrection2). | [optional] +**corrections** | **string[]** | Words to be matched in records. | [optional] +**placeholder** | **string** | Token to be put inside records. | [optional] +**replacements** | **string[]** | List of query words that will match the token. | [optional] +**highlightResult** | [**\Algolia\AlgoliaSearch\Model\SynonymHitHighlightResult**](SynonymHitHighlightResult.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SynonymHitHighlightResult.md b/clients/algoliasearch-client-php/docs/Model/SynonymHitHighlightResult.md new file mode 100644 index 0000000000..b2da6899e8 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/SynonymHitHighlightResult.md @@ -0,0 +1,10 @@ +# # SynonymHitHighlightResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**\Algolia\AlgoliaSearch\Model\HighlightResult**](HighlightResult.md) | | [optional] +**synonyms** | [**\Algolia\AlgoliaSearch\Model\HighlightResult[]**](HighlightResult.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/TimeRange.md b/clients/algoliasearch-client-php/docs/Model/TimeRange.md new file mode 100644 index 0000000000..8ae75b967e --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/TimeRange.md @@ -0,0 +1,10 @@ +# # TimeRange + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**from** | **int** | Lower bound of the time range (Unix timestamp). | +**until** | **int** | Upper bound of the time range (Unix timestamp). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/UpdateApiKeyResponse.md b/clients/algoliasearch-client-php/docs/Model/UpdateApiKeyResponse.md new file mode 100644 index 0000000000..48ed38b6d6 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/UpdateApiKeyResponse.md @@ -0,0 +1,10 @@ +# # UpdateApiKeyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **string** | Key string. | +**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/UpdatedAtResponse.md b/clients/algoliasearch-client-php/docs/Model/UpdatedAtResponse.md new file mode 100644 index 0000000000..3eef1fee3b --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/UpdatedAtResponse.md @@ -0,0 +1,10 @@ +# # UpdatedAtResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taskID** | **int** | taskID of the indexing task to wait for. | +**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/UpdatedAtWithObjectIdResponse.md b/clients/algoliasearch-client-php/docs/Model/UpdatedAtWithObjectIdResponse.md new file mode 100644 index 0000000000..49b3a91d06 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/UpdatedAtWithObjectIdResponse.md @@ -0,0 +1,11 @@ +# # UpdatedAtWithObjectIdResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**taskID** | **int** | taskID of the indexing task to wait for. | [optional] +**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | [optional] +**objectID** | **string** | Unique identifier of the object. | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/UpdatedRuleResponse.md b/clients/algoliasearch-client-php/docs/Model/UpdatedRuleResponse.md new file mode 100644 index 0000000000..77ea91d585 --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/UpdatedRuleResponse.md @@ -0,0 +1,11 @@ +# # UpdatedRuleResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**objectID** | **string** | Unique identifier of the object. | +**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | +**taskID** | **int** | taskID of the indexing task to wait for. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/UserId.md b/clients/algoliasearch-client-php/docs/Model/UserId.md new file mode 100644 index 0000000000..8a176f16af --- /dev/null +++ b/clients/algoliasearch-client-php/docs/Model/UserId.md @@ -0,0 +1,12 @@ +# # UserId + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userID** | **string** | userID of the user. | +**clusterName** | **string** | Cluster on which the user is assigned. | +**nbRecords** | **int** | Number of records belonging to the user. | +**dataSize** | **int** | Data size used by the user. | + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/git_push.sh b/clients/algoliasearch-client-php/git_push.sh new file mode 100644 index 0000000000..6e0e3126c4 --- /dev/null +++ b/clients/algoliasearch-client-php/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="algolia" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="algolia" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="algoliasearch-client-php" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/clients/algoliasearch-client-php/lib/Api/SearchApi.php b/clients/algoliasearch-client-php/lib/Api/SearchApi.php new file mode 100644 index 0000000000..000794e58b --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Api/SearchApi.php @@ -0,0 +1,4755 @@ +config = $config ?: new Configuration(); + + $this->client = new Client(); + $this->headerSelector = new HeaderSelector(); + $this->hostIndex = 0; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation addApiKey + * + * Create a new API key. + * + * @param \Algolia\AlgoliaSearch\Model\ApiKey $apiKey apiKey (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\AddApiKeyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function addApiKey($apiKey) + { + // verify the required parameter 'apiKey' is set + if ($apiKey === null || (is_array($apiKey) && count($apiKey) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $apiKey when calling addApiKey' + ); + } + + $resourcePath = '/1/keys'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($apiKey)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($apiKey)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\AddApiKeyResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation addOrUpdateObject + * + * Add or replace an object with a given object ID. + * + * @param string $indexName The index in which to perform the request. (required) + * @param string $objectID Unique identifier of an object. (required) + * @param array $requestBody The Algolia object. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function addOrUpdateObject($indexName, $objectID, $requestBody) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling addOrUpdateObject' + ); + } + // verify the required parameter 'objectID' is set + if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $objectID when calling addOrUpdateObject' + ); + } + // verify the required parameter 'requestBody' is set + if ($requestBody === null || (is_array($requestBody) && count($requestBody) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $requestBody when calling addOrUpdateObject' + ); + } + + $resourcePath = '/1/indexes/{indexName}/{objectID}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + // path params + if ($objectID !== null) { + $resourcePath = str_replace( + '{' . 'objectID' . '}', + ObjectSerializer::toPathValue($objectID), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($requestBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($requestBody)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation appendSource + * + * @param \Algolia\AlgoliaSearch\Model\Source $source The source to add. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse + */ + public function appendSource($source) + { + // verify the required parameter 'source' is set + if ($source === null || (is_array($source) && count($source) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $source when calling appendSource' + ); + } + + $resourcePath = '/1/security/sources/append'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($source)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($source)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\CreatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation assignUserId + * + * Assign or Move userID + * + * @param object $xAlgoliaUserID userID to assign. (required) + * @param \Algolia\AlgoliaSearch\Model\AssignUserIdObject $assignUserIdObject assignUserIdObject (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function assignUserId($xAlgoliaUserID, $assignUserIdObject) + { + // verify the required parameter 'xAlgoliaUserID' is set + if ($xAlgoliaUserID === null || (is_array($xAlgoliaUserID) && count($xAlgoliaUserID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $xAlgoliaUserID when calling assignUserId' + ); + } + // verify the required parameter 'assignUserIdObject' is set + if ($assignUserIdObject === null || (is_array($assignUserIdObject) && count($assignUserIdObject) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $assignUserIdObject when calling assignUserId' + ); + } + + $resourcePath = '/1/clusters/mapping'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($xAlgoliaUserID)) { + $xAlgoliaUserID = ObjectSerializer::serializeCollection($xAlgoliaUserID, '', true); + } + if ($xAlgoliaUserID !== null) { + $queryParams['X-Algolia-User-ID'] = $xAlgoliaUserID; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($assignUserIdObject)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($assignUserIdObject)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\CreatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation batch + * + * @param string $indexName The index in which to perform the request. (required) + * @param \Algolia\AlgoliaSearch\Model\BatchWriteObject $batchWriteObject batchWriteObject (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\BatchResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function batch($indexName, $batchWriteObject) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling batch' + ); + } + // verify the required parameter 'batchWriteObject' is set + if ($batchWriteObject === null || (is_array($batchWriteObject) && count($batchWriteObject) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $batchWriteObject when calling batch' + ); + } + + $resourcePath = '/1/indexes/{indexName}/batch'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($batchWriteObject)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($batchWriteObject)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\BatchResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation batchAssignUserIds + * + * Batch assign userIDs + * + * @param object $xAlgoliaUserID userID to assign. (required) + * @param \Algolia\AlgoliaSearch\Model\BatchAssignUserIdsObject $batchAssignUserIdsObject batchAssignUserIdsObject (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject) + { + // verify the required parameter 'xAlgoliaUserID' is set + if ($xAlgoliaUserID === null || (is_array($xAlgoliaUserID) && count($xAlgoliaUserID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $xAlgoliaUserID when calling batchAssignUserIds' + ); + } + // verify the required parameter 'batchAssignUserIdsObject' is set + if ($batchAssignUserIdsObject === null || (is_array($batchAssignUserIdsObject) && count($batchAssignUserIdsObject) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $batchAssignUserIdsObject when calling batchAssignUserIds' + ); + } + + $resourcePath = '/1/clusters/mapping/batch'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($xAlgoliaUserID)) { + $xAlgoliaUserID = ObjectSerializer::serializeCollection($xAlgoliaUserID, '', true); + } + if ($xAlgoliaUserID !== null) { + $queryParams['X-Algolia-User-ID'] = $xAlgoliaUserID; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($batchAssignUserIdsObject)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($batchAssignUserIdsObject)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\CreatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation batchDictionaryEntries + * + * Send a batch of dictionary entries. + * + * @param string $dictionaryName The dictionary to search in. (required) + * @param \Algolia\AlgoliaSearch\Model\BatchDictionaryEntries $batchDictionaryEntries batchDictionaryEntries (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntries) + { + // verify the required parameter 'dictionaryName' is set + if ($dictionaryName === null || (is_array($dictionaryName) && count($dictionaryName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $dictionaryName when calling batchDictionaryEntries' + ); + } + // verify the required parameter 'batchDictionaryEntries' is set + if ($batchDictionaryEntries === null || (is_array($batchDictionaryEntries) && count($batchDictionaryEntries) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $batchDictionaryEntries when calling batchDictionaryEntries' + ); + } + + $resourcePath = '/1/dictionaries/{dictionaryName}/batch'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($dictionaryName !== null) { + $resourcePath = str_replace( + '{' . 'dictionaryName' . '}', + ObjectSerializer::toPathValue($dictionaryName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($batchDictionaryEntries)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($batchDictionaryEntries)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation batchRules + * + * Batch Rules. + * + * @param string $indexName The index in which to perform the request. (required) + * @param \Algolia\AlgoliaSearch\Model\Rule[] $rule rule (required) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * @param bool $clearExistingRules When true, existing Rules are cleared before adding this batch. When false, existing Rules are kept. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearExistingRules = null) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling batchRules' + ); + } + // verify the required parameter 'rule' is set + if ($rule === null || (is_array($rule) && count($rule) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $rule when calling batchRules' + ); + } + + $resourcePath = '/1/indexes/{indexName}/rules/batch'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($forwardToReplicas)) { + $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); + } + if ($forwardToReplicas !== null) { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } + // query params + if (is_array($clearExistingRules)) { + $clearExistingRules = ObjectSerializer::serializeCollection($clearExistingRules, '', true); + } + if ($clearExistingRules !== null) { + $queryParams['clearExistingRules'] = $clearExistingRules; + } + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($rule)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($rule)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation browse + * + * Retrieve all index content. + * + * @param string $indexName The index in which to perform the request. (required) + * @param \Algolia\AlgoliaSearch\Model\BrowseRequest $browseRequest browseRequest (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\BrowseResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function browse($indexName, $browseRequest = null) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling browse' + ); + } + + $resourcePath = '/1/indexes/{indexName}/browse'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($browseRequest)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($browseRequest)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\BrowseResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation clearAllSynonyms + * + * Clear all synonyms. + * + * @param string $indexName The index in which to perform the request. (required) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function clearAllSynonyms($indexName, $forwardToReplicas = null) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling clearAllSynonyms' + ); + } + + $resourcePath = '/1/indexes/{indexName}/synonyms/clear'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($forwardToReplicas)) { + $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); + } + if ($forwardToReplicas !== null) { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation clearObjects + * + * clear all objects from an index. + * + * @param string $indexName The index in which to perform the request. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function clearObjects($indexName) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling clearObjects' + ); + } + + $resourcePath = '/1/indexes/{indexName}/clear'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation clearRules + * + * Clear Rules. + * + * @param string $indexName The index in which to perform the request. (required) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function clearRules($indexName, $forwardToReplicas = null) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling clearRules' + ); + } + + $resourcePath = '/1/indexes/{indexName}/rules/clear'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($forwardToReplicas)) { + $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); + } + if ($forwardToReplicas !== null) { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation deleteApiKey + * + * Delete an API key. + * + * @param string $key API Key string. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\DeleteApiKeyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function deleteApiKey($key) + { + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling deleteApiKey' + ); + } + + $resourcePath = '/1/keys/{key}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($key !== null) { + $resourcePath = str_replace( + '{' . 'key' . '}', + ObjectSerializer::toPathValue($key), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeleteApiKeyResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation deleteBy + * + * Delete all records matching the query. + * + * @param string $indexName The index in which to perform the request. (required) + * @param \Algolia\AlgoliaSearch\Model\SearchParams $searchParams searchParams (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function deleteBy($indexName, $searchParams) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling deleteBy' + ); + } + // verify the required parameter 'searchParams' is set + if ($searchParams === null || (is_array($searchParams) && count($searchParams) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $searchParams when calling deleteBy' + ); + } + + $resourcePath = '/1/indexes/{indexName}/deleteByQuery'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($searchParams)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchParams)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeletedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation deleteIndex + * + * Delete index. + * + * @param string $indexName The index in which to perform the request. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function deleteIndex($indexName) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling deleteIndex' + ); + } + + $resourcePath = '/1/indexes/{indexName}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeletedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation deleteObject + * + * Delete object. + * + * @param string $indexName The index in which to perform the request. (required) + * @param string $objectID Unique identifier of an object. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function deleteObject($indexName, $objectID) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling deleteObject' + ); + } + // verify the required parameter 'objectID' is set + if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $objectID when calling deleteObject' + ); + } + + $resourcePath = '/1/indexes/{indexName}/{objectID}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + // path params + if ($objectID !== null) { + $resourcePath = str_replace( + '{' . 'objectID' . '}', + ObjectSerializer::toPathValue($objectID), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeletedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation deleteRule + * + * Delete a rule. + * + * @param string $indexName The index in which to perform the request. (required) + * @param string $objectID Unique identifier of an object. (required) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function deleteRule($indexName, $objectID, $forwardToReplicas = null) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling deleteRule' + ); + } + // verify the required parameter 'objectID' is set + if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $objectID when calling deleteRule' + ); + } + + $resourcePath = '/1/indexes/{indexName}/rules/{objectID}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($forwardToReplicas)) { + $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); + } + if ($forwardToReplicas !== null) { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + // path params + if ($objectID !== null) { + $resourcePath = str_replace( + '{' . 'objectID' . '}', + ObjectSerializer::toPathValue($objectID), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation deleteSource + * + * @param string $source The IP range of the source. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\DeleteSourceResponse + */ + public function deleteSource($source) + { + // verify the required parameter 'source' is set + if ($source === null || (is_array($source) && count($source) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $source when calling deleteSource' + ); + } + + $resourcePath = '/1/security/sources/{source}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($source !== null) { + $resourcePath = str_replace( + '{' . 'source' . '}', + ObjectSerializer::toPathValue($source), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeleteSourceResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation deleteSynonym + * + * Delete synonym. + * + * @param string $indexName The index in which to perform the request. (required) + * @param string $objectID Unique identifier of an object. (required) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling deleteSynonym' + ); + } + // verify the required parameter 'objectID' is set + if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $objectID when calling deleteSynonym' + ); + } + + $resourcePath = '/1/indexes/{indexName}/synonyms/{objectID}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($forwardToReplicas)) { + $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); + } + if ($forwardToReplicas !== null) { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + // path params + if ($objectID !== null) { + $resourcePath = str_replace( + '{' . 'objectID' . '}', + ObjectSerializer::toPathValue($objectID), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeletedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation getApiKey + * + * Get an API key. + * + * @param string $key API Key string. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\KeyObject|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getApiKey($key) + { + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling getApiKey' + ); + } + + $resourcePath = '/1/keys/{key}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($key !== null) { + $resourcePath = str_replace( + '{' . 'key' . '}', + ObjectSerializer::toPathValue($key), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\KeyObject'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation getDictionaryLanguages + * + * List dictionaries supported per language. + * + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getDictionaryLanguages() + { + + $resourcePath = '/1/dictionaries/*/languages'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = 'array<string,\Algolia\AlgoliaSearch\Model\Languages>'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation getDictionarySettings + * + * Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values. + * + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\GetDictionarySettingsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getDictionarySettings() + { + + $resourcePath = '/1/dictionaries/*/settings'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetDictionarySettingsResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation getLogs + * + * @param int $offset First entry to retrieve (zero-based). Log entries are sorted by decreasing date, therefore 0 designates the most recent log entry. (optional, default to 0) + * @param int $length Maximum number of entries to retrieve. The maximum allowed value is 1000. (optional, default to 10) + * @param string $indexName Index for which log entries should be retrieved. When omitted, log entries are retrieved across all indices. (optional) + * @param string $type Type of log entries to retrieve. When omitted, all log entries are retrieved. (optional, default to 'all') + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\GetLogsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getLogs($offset = 0, $length = 10, $indexName = null, $type = 'all') + { + if ($length !== null && $length > 1000) { + throw new \InvalidArgumentException('invalid value for "$length" when calling SearchApi.getLogs, must be smaller than or equal to 1000.'); + } + + + $resourcePath = '/1/logs'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($offset)) { + $offset = ObjectSerializer::serializeCollection($offset, '', true); + } + if ($offset !== null) { + $queryParams['offset'] = $offset; + } + // query params + if (is_array($length)) { + $length = ObjectSerializer::serializeCollection($length, '', true); + } + if ($length !== null) { + $queryParams['length'] = $length; + } + // query params + if (is_array($indexName)) { + $indexName = ObjectSerializer::serializeCollection($indexName, '', true); + } + if ($indexName !== null) { + $queryParams['indexName'] = $indexName; + } + // query params + if (is_array($type)) { + $type = ObjectSerializer::serializeCollection($type, '', true); + } + if ($type !== null) { + $queryParams['type'] = $type; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetLogsResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation getObject + * + * Retrieve one object from the index. + * + * @param string $indexName The index in which to perform the request. (required) + * @param string $objectID Unique identifier of an object. (required) + * @param string[] $attributesToRetrieve attributesToRetrieve (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getObject($indexName, $objectID, $attributesToRetrieve = null) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling getObject' + ); + } + // verify the required parameter 'objectID' is set + if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $objectID when calling getObject' + ); + } + + $resourcePath = '/1/indexes/{indexName}/{objectID}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($attributesToRetrieve)) { + $attributesToRetrieve = ObjectSerializer::serializeCollection($attributesToRetrieve, 'csv', true); + } + if ($attributesToRetrieve !== null) { + $queryParams['attributesToRetrieve'] = $attributesToRetrieve; + } + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + // path params + if ($objectID !== null) { + $resourcePath = str_replace( + '{' . 'objectID' . '}', + ObjectSerializer::toPathValue($objectID), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = 'array<string,string>'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation getObjects + * + * Retrieve one or more objects. + * + * @param \Algolia\AlgoliaSearch\Model\GetObjectsObject $getObjectsObject getObjectsObject (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\GetObjectsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getObjects($getObjectsObject) + { + // verify the required parameter 'getObjectsObject' is set + if ($getObjectsObject === null || (is_array($getObjectsObject) && count($getObjectsObject) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $getObjectsObject when calling getObjects' + ); + } + + $resourcePath = '/1/indexes/*/objects'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($getObjectsObject)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($getObjectsObject)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetObjectsResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation getRule + * + * Get a rule. + * + * @param string $indexName The index in which to perform the request. (required) + * @param string $objectID Unique identifier of an object. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\Rule|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getRule($indexName, $objectID) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling getRule' + ); + } + // verify the required parameter 'objectID' is set + if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $objectID when calling getRule' + ); + } + + $resourcePath = '/1/indexes/{indexName}/rules/{objectID}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + // path params + if ($objectID !== null) { + $resourcePath = str_replace( + '{' . 'objectID' . '}', + ObjectSerializer::toPathValue($objectID), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\Rule'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation getSettings + * + * @param string $indexName The index in which to perform the request. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\IndexSettings|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getSettings($indexName) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling getSettings' + ); + } + + $resourcePath = '/1/indexes/{indexName}/settings'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\IndexSettings'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation getSources + * + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\Source[] + */ + public function getSources() + { + + $resourcePath = '/1/security/sources'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\Source[]'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation getSynonym + * + * Get synonym. + * + * @param string $indexName The index in which to perform the request. (required) + * @param string $objectID Unique identifier of an object. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\SynonymHit|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getSynonym($indexName, $objectID) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling getSynonym' + ); + } + // verify the required parameter 'objectID' is set + if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $objectID when calling getSynonym' + ); + } + + $resourcePath = '/1/indexes/{indexName}/synonyms/{objectID}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + // path params + if ($objectID !== null) { + $resourcePath = str_replace( + '{' . 'objectID' . '}', + ObjectSerializer::toPathValue($objectID), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\SynonymHit'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation getTask + * + * @param string $indexName The index in which to perform the request. (required) + * @param int $taskID Unique identifier of an task. Numeric value (up to 64bits) (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\GetTaskResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getTask($indexName, $taskID) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling getTask' + ); + } + // verify the required parameter 'taskID' is set + if ($taskID === null || (is_array($taskID) && count($taskID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $taskID when calling getTask' + ); + } + + $resourcePath = '/1/indexes/{indexName}/task/{taskID}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + // path params + if ($taskID !== null) { + $resourcePath = str_replace( + '{' . 'taskID' . '}', + ObjectSerializer::toPathValue($taskID), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetTaskResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation getTopUserIds + * + * Get top userID + * + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\GetTopUserIdsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getTopUserIds() + { + + $resourcePath = '/1/clusters/mapping/top'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetTopUserIdsResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation getUserId + * + * Get userID + * + * @param object $userID userID to assign. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UserId|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getUserId($userID) + { + // verify the required parameter 'userID' is set + if ($userID === null || (is_array($userID) && count($userID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $userID when calling getUserId' + ); + } + + $resourcePath = '/1/clusters/mapping/{userID}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($userID !== null) { + $resourcePath = str_replace( + '{' . 'userID' . '}', + ObjectSerializer::toPathValue($userID), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UserId'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation hasPendingMappings + * + * Has pending mappings + * + * @param bool $getClusters getClusters (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function hasPendingMappings($getClusters = null) + { + + $resourcePath = '/1/clusters/mapping/pending'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($getClusters)) { + $getClusters = ObjectSerializer::serializeCollection($getClusters, '', true); + } + if ($getClusters !== null) { + $queryParams['getClusters'] = $getClusters; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\CreatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation listApiKeys + * + * Get the full list of API Keys. + * + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\ListApiKeysResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function listApiKeys() + { + + $resourcePath = '/1/keys'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\ListApiKeysResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation listClusters + * + * List clusters + * + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\ListClustersResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function listClusters() + { + + $resourcePath = '/1/clusters'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\ListClustersResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation listIndices + * + * List existing indexes. + * + * @param int $page Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\ListIndicesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function listIndices($page = null) + { + + $resourcePath = '/1/indexes'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($page)) { + $page = ObjectSerializer::serializeCollection($page, '', true); + } + if ($page !== null) { + $queryParams['Page'] = $page; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\ListIndicesResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation listUserIds + * + * List userIDs + * + * @param int $page Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). (optional) + * @param int $hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\ListUserIdsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function listUserIds($page = null, $hitsPerPage = 100) + { + + $resourcePath = '/1/clusters/mapping'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($page)) { + $page = ObjectSerializer::serializeCollection($page, '', true); + } + if ($page !== null) { + $queryParams['Page'] = $page; + } + // query params + if (is_array($hitsPerPage)) { + $hitsPerPage = ObjectSerializer::serializeCollection($hitsPerPage, '', true); + } + if ($hitsPerPage !== null) { + $queryParams['hitsPerPage'] = $hitsPerPage; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\ListUserIdsResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation multipleBatch + * + * @param \Algolia\AlgoliaSearch\Model\BatchObject $batchObject batchObject (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\MultipleBatchResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function multipleBatch($batchObject) + { + // verify the required parameter 'batchObject' is set + if ($batchObject === null || (is_array($batchObject) && count($batchObject) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $batchObject when calling multipleBatch' + ); + } + + $resourcePath = '/1/indexes/*/batch'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($batchObject)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($batchObject)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\MultipleBatchResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation multipleQueries + * + * @param \Algolia\AlgoliaSearch\Model\MultipleQueriesObject $multipleQueriesObject multipleQueriesObject (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\MultipleQueriesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function multipleQueries($multipleQueriesObject) + { + // verify the required parameter 'multipleQueriesObject' is set + if ($multipleQueriesObject === null || (is_array($multipleQueriesObject) && count($multipleQueriesObject) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $multipleQueriesObject when calling multipleQueries' + ); + } + + $resourcePath = '/1/indexes/*/queries'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($multipleQueriesObject)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($multipleQueriesObject)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\MultipleQueriesResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation operationIndex + * + * Copy/move index. + * + * @param string $indexName The index in which to perform the request. (required) + * @param \Algolia\AlgoliaSearch\Model\OperationIndexObject $operationIndexObject operationIndexObject (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function operationIndex($indexName, $operationIndexObject) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling operationIndex' + ); + } + // verify the required parameter 'operationIndexObject' is set + if ($operationIndexObject === null || (is_array($operationIndexObject) && count($operationIndexObject) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $operationIndexObject when calling operationIndex' + ); + } + + $resourcePath = '/1/indexes/{indexName}/operation'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($operationIndexObject)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($operationIndexObject)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation partialUpdateObject + * + * Partially update an object. + * + * @param string $indexName The index in which to perform the request. (required) + * @param string $objectID Unique identifier of an object. (required) + * @param array[] $oneOfStringBuildInOperation The Algolia object. (required) + * @param bool $createIfNotExists Creates the record if it does not exist yet. (optional, default to true) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOperation, $createIfNotExists = true) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling partialUpdateObject' + ); + } + // verify the required parameter 'objectID' is set + if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $objectID when calling partialUpdateObject' + ); + } + // verify the required parameter 'oneOfStringBuildInOperation' is set + if ($oneOfStringBuildInOperation === null || (is_array($oneOfStringBuildInOperation) && count($oneOfStringBuildInOperation) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $oneOfStringBuildInOperation when calling partialUpdateObject' + ); + } + + $resourcePath = '/1/indexes/{indexName}/{objectID}/partial'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($createIfNotExists)) { + $createIfNotExists = ObjectSerializer::serializeCollection($createIfNotExists, '', true); + } + if ($createIfNotExists !== null) { + $queryParams['createIfNotExists'] = $createIfNotExists; + } + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + // path params + if ($objectID !== null) { + $resourcePath = str_replace( + '{' . 'objectID' . '}', + ObjectSerializer::toPathValue($objectID), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($oneOfStringBuildInOperation)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($oneOfStringBuildInOperation)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation removeUserId + * + * Remove userID + * + * @param object $userID userID to assign. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\RemoveUserIdResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function removeUserId($userID) + { + // verify the required parameter 'userID' is set + if ($userID === null || (is_array($userID) && count($userID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $userID when calling removeUserId' + ); + } + + $resourcePath = '/1/clusters/mapping/{userID}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($userID !== null) { + $resourcePath = str_replace( + '{' . 'userID' . '}', + ObjectSerializer::toPathValue($userID), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\RemoveUserIdResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation replaceSources + * + * @param \Algolia\AlgoliaSearch\Model\Source[] $source The sources to allow. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\ReplaceSourceResponse + */ + public function replaceSources($source) + { + // verify the required parameter 'source' is set + if ($source === null || (is_array($source) && count($source) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $source when calling replaceSources' + ); + } + + $resourcePath = '/1/security/sources'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($source)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($source)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\ReplaceSourceResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation restoreApiKey + * + * Restore an API key. + * + * @param string $key API Key string. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\AddApiKeyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function restoreApiKey($key) + { + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling restoreApiKey' + ); + } + + $resourcePath = '/1/keys/{key}/restore'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($key !== null) { + $resourcePath = str_replace( + '{' . 'key' . '}', + ObjectSerializer::toPathValue($key), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\AddApiKeyResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation saveObject + * + * @param string $indexName The index in which to perform the request. (required) + * @param array $requestBody The Algolia object. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\SaveObjectResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function saveObject($indexName, $requestBody) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling saveObject' + ); + } + // verify the required parameter 'requestBody' is set + if ($requestBody === null || (is_array($requestBody) && count($requestBody) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $requestBody when calling saveObject' + ); + } + + $resourcePath = '/1/indexes/{indexName}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($requestBody)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($requestBody)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\SaveObjectResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation saveRule + * + * Save/Update a rule. + * + * @param string $indexName The index in which to perform the request. (required) + * @param string $objectID Unique identifier of an object. (required) + * @param \Algolia\AlgoliaSearch\Model\Rule $rule rule (required) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdatedRuleResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling saveRule' + ); + } + // verify the required parameter 'objectID' is set + if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $objectID when calling saveRule' + ); + } + // verify the required parameter 'rule' is set + if ($rule === null || (is_array($rule) && count($rule) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $rule when calling saveRule' + ); + } + + $resourcePath = '/1/indexes/{indexName}/rules/{objectID}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($forwardToReplicas)) { + $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); + } + if ($forwardToReplicas !== null) { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + // path params + if ($objectID !== null) { + $resourcePath = str_replace( + '{' . 'objectID' . '}', + ObjectSerializer::toPathValue($objectID), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($rule)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($rule)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedRuleResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation saveSynonym + * + * Save synonym. + * + * @param string $indexName The index in which to perform the request. (required) + * @param string $objectID Unique identifier of an object. (required) + * @param \Algolia\AlgoliaSearch\Model\SynonymHit $synonymHit synonymHit (required) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\SaveSynonymResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplicas = null) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling saveSynonym' + ); + } + // verify the required parameter 'objectID' is set + if ($objectID === null || (is_array($objectID) && count($objectID) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $objectID when calling saveSynonym' + ); + } + // verify the required parameter 'synonymHit' is set + if ($synonymHit === null || (is_array($synonymHit) && count($synonymHit) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $synonymHit when calling saveSynonym' + ); + } + + $resourcePath = '/1/indexes/{indexName}/synonyms/{objectID}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($forwardToReplicas)) { + $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); + } + if ($forwardToReplicas !== null) { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + // path params + if ($objectID !== null) { + $resourcePath = str_replace( + '{' . 'objectID' . '}', + ObjectSerializer::toPathValue($objectID), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($synonymHit)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($synonymHit)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\SaveSynonymResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation saveSynonyms + * + * Save a batch of synonyms. + * + * @param string $indexName The index in which to perform the request. (required) + * @param \Algolia\AlgoliaSearch\Model\SynonymHit[] $synonymHit synonymHit (required) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * @param bool $replaceExistingSynonyms Replace all synonyms of the index with the ones sent with this request. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, $replaceExistingSynonyms = null) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling saveSynonyms' + ); + } + // verify the required parameter 'synonymHit' is set + if ($synonymHit === null || (is_array($synonymHit) && count($synonymHit) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $synonymHit when calling saveSynonyms' + ); + } + + $resourcePath = '/1/indexes/{indexName}/synonyms/batch'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($forwardToReplicas)) { + $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); + } + if ($forwardToReplicas !== null) { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } + // query params + if (is_array($replaceExistingSynonyms)) { + $replaceExistingSynonyms = ObjectSerializer::serializeCollection($replaceExistingSynonyms, '', true); + } + if ($replaceExistingSynonyms !== null) { + $queryParams['replaceExistingSynonyms'] = $replaceExistingSynonyms; + } + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($synonymHit)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($synonymHit)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation search + * + * @param string $indexName The index in which to perform the request. (required) + * @param \Algolia\AlgoliaSearch\Model\SearchParams $searchParams searchParams (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\SearchResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function search($indexName, $searchParams) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling search' + ); + } + // verify the required parameter 'searchParams' is set + if ($searchParams === null || (is_array($searchParams) && count($searchParams) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $searchParams when calling search' + ); + } + + $resourcePath = '/1/indexes/{indexName}/query'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($searchParams)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchParams)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation searchDictionaryEntries + * + * Search the dictionary entries. + * + * @param string $dictionaryName The dictionary to search in. (required) + * @param \Algolia\AlgoliaSearch\Model\SearchDictionaryEntries $searchDictionaryEntries searchDictionaryEntries (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntries) + { + // verify the required parameter 'dictionaryName' is set + if ($dictionaryName === null || (is_array($dictionaryName) && count($dictionaryName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $dictionaryName when calling searchDictionaryEntries' + ); + } + // verify the required parameter 'searchDictionaryEntries' is set + if ($searchDictionaryEntries === null || (is_array($searchDictionaryEntries) && count($searchDictionaryEntries) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $searchDictionaryEntries when calling searchDictionaryEntries' + ); + } + + $resourcePath = '/1/dictionaries/{dictionaryName}/search'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($dictionaryName !== null) { + $resourcePath = str_replace( + '{' . 'dictionaryName' . '}', + ObjectSerializer::toPathValue($dictionaryName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($searchDictionaryEntries)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchDictionaryEntries)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation searchForFacetValues + * + * Search for values of a given facet + * + * @param string $indexName The index in which to perform the request. (required) + * @param string $facetName The facet name. (required) + * @param \Algolia\AlgoliaSearch\Model\SearchForFacetValuesRequest $searchForFacetValuesRequest searchForFacetValuesRequest (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function searchForFacetValues($indexName, $facetName, $searchForFacetValuesRequest = null) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling searchForFacetValues' + ); + } + // verify the required parameter 'facetName' is set + if ($facetName === null || (is_array($facetName) && count($facetName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $facetName when calling searchForFacetValues' + ); + } + + $resourcePath = '/1/indexes/{indexName}/facets/{facetName}/query'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + // path params + if ($facetName !== null) { + $resourcePath = str_replace( + '{' . 'facetName' . '}', + ObjectSerializer::toPathValue($facetName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($searchForFacetValuesRequest)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchForFacetValuesRequest)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation searchRules + * + * Search for rules. + * + * @param string $indexName The index in which to perform the request. (required) + * @param \Algolia\AlgoliaSearch\Model\SearchRulesParams $searchRulesParams searchRulesParams (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\SearchRulesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function searchRules($indexName, $searchRulesParams) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling searchRules' + ); + } + // verify the required parameter 'searchRulesParams' is set + if ($searchRulesParams === null || (is_array($searchRulesParams) && count($searchRulesParams) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $searchRulesParams when calling searchRules' + ); + } + + $resourcePath = '/1/indexes/{indexName}/rules/search'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($searchRulesParams)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchRulesParams)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchRulesResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation searchSynonyms + * + * Get all synonyms that match a query. + * + * @param string $indexName The index in which to perform the request. (required) + * @param string $query Search for specific synonyms matching this string. (optional, default to '') + * @param string $type Only search for specific types of synonyms. (optional) + * @param int $page Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). (optional, default to 0) + * @param int $hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\SearchSynonymsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $hitsPerPage = 100) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling searchSynonyms' + ); + } + + $resourcePath = '/1/indexes/{indexName}/synonyms/search'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($query)) { + $query = ObjectSerializer::serializeCollection($query, '', true); + } + if ($query !== null) { + $queryParams['query'] = $query; + } + // query params + if (is_array($type)) { + $type = ObjectSerializer::serializeCollection($type, '', true); + } + if ($type !== null) { + $queryParams['type'] = $type; + } + // query params + if (is_array($page)) { + $page = ObjectSerializer::serializeCollection($page, '', true); + } + if ($page !== null) { + $queryParams['Page'] = $page; + } + // query params + if (is_array($hitsPerPage)) { + $hitsPerPage = ObjectSerializer::serializeCollection($hitsPerPage, '', true); + } + if ($hitsPerPage !== null) { + $queryParams['hitsPerPage'] = $hitsPerPage; + } + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchSynonymsResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation searchUserIds + * + * Search userID + * + * @param \Algolia\AlgoliaSearch\Model\SearchUserIdsObject $searchUserIdsObject searchUserIdsObject (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\SearchUserIdsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function searchUserIds($searchUserIdsObject) + { + // verify the required parameter 'searchUserIdsObject' is set + if ($searchUserIdsObject === null || (is_array($searchUserIdsObject) && count($searchUserIdsObject) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $searchUserIdsObject when calling searchUserIds' + ); + } + + $resourcePath = '/1/clusters/mapping/search'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($searchUserIdsObject)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchUserIdsObject)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchUserIdsResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation setDictionarySettings + * + * Set dictionary settings. + * + * @param \Algolia\AlgoliaSearch\Model\DictionarySettingsRequest $dictionarySettingsRequest dictionarySettingsRequest (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function setDictionarySettings($dictionarySettingsRequest) + { + // verify the required parameter 'dictionarySettingsRequest' is set + if ($dictionarySettingsRequest === null || (is_array($dictionarySettingsRequest) && count($dictionarySettingsRequest) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $dictionarySettingsRequest when calling setDictionarySettings' + ); + } + + $resourcePath = '/1/dictionaries/*/settings'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($dictionarySettingsRequest)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($dictionarySettingsRequest)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation setSettings + * + * @param string $indexName The index in which to perform the request. (required) + * @param \Algolia\AlgoliaSearch\Model\IndexSettings $indexSettings indexSettings (required) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function setSettings($indexName, $indexSettings, $forwardToReplicas = null) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling setSettings' + ); + } + // verify the required parameter 'indexSettings' is set + if ($indexSettings === null || (is_array($indexSettings) && count($indexSettings) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexSettings when calling setSettings' + ); + } + + $resourcePath = '/1/indexes/{indexName}/settings'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // query params + if (is_array($forwardToReplicas)) { + $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); + } + if ($forwardToReplicas !== null) { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($indexSettings)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($indexSettings)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Operation updateApiKey + * + * Update an API key. + * + * @param string $key API Key string. (required) + * @param \Algolia\AlgoliaSearch\Model\ApiKey $apiKey apiKey (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Algolia\AlgoliaSearch\Model\UpdateApiKeyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function updateApiKey($key, $apiKey) + { + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling updateApiKey' + ); + } + // verify the required parameter 'apiKey' is set + if ($apiKey === null || (is_array($apiKey) && count($apiKey) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $apiKey when calling updateApiKey' + ); + } + + $resourcePath = '/1/keys/{key}'; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + // path params + if ($key !== null) { + $resourcePath = str_replace( + '{' . 'key' . '}', + ObjectSerializer::toPathValue($key), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($apiKey)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($apiKey)); + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); + if ($apiKey !== null) { + $headers['X-Algolia-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); + if ($apiKey !== null) { + $headers['X-Algolia-Application-Id'] = $apiKey; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + $request = new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + + $expectedResponse = null; + $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdateApiKeyResponse'; + list($response) = $this->sendRequest($request, $expectedResponse); + + return $response; + } + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + /** + * Send the request and handle the response + * + * @throws \RuntimeException on file opening failure + * @return array + */ + protected function sendRequest($request, $expectedResponse) + { + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ($expectedResponse === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $expectedResponse, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 402: + if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } + + $returnType = $expectedResponse; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + $expectedResponse, + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Algolia\AlgoliaSearch\Model\ErrorBase', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Algolia\AlgoliaSearch\Model\ErrorBase', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Algolia\AlgoliaSearch\Model\ErrorBase', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Algolia\AlgoliaSearch\Model\ErrorBase', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } +} diff --git a/clients/algoliasearch-client-php/lib/ApiException.php b/clients/algoliasearch-client-php/lib/ApiException.php new file mode 100644 index 0000000000..15b171f871 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/ApiException.php @@ -0,0 +1,120 @@ +responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return string[]|null HTTP response header + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Sets the deserialized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deserialized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/clients/algoliasearch-client-php/lib/Configuration.php b/clients/algoliasearch-client-php/lib/Configuration.php new file mode 100644 index 0000000000..7a9d22ba43 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Configuration.php @@ -0,0 +1,492 @@ +tempFolderPath = sys_get_temp_dir(); + + $this->setAlgoliaApiKey($algoliaApiKey); + $this->setApiKey('X-Algolia-API-Key', $algoliaApiKey); + + $this->setAppId($appId); + $this->setApiKey('X-Algolia-Application-Id', $appId); + + $this->setHost("https://{$appId}-1.algolianet.com"); + } + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets the Algolia Application ID + * + * @param string $appId Application ID + * + * @return $this + */ + public function setAppId($appId = '') + { + $this->appId = $appId; + } + + /** + * Gets the Algolia application ID + * + * @return string + */ + public function getAppId() + { + return $this->appId; + } + + /** + * Sets the Algolia API Key + * + * @param string $algoliaApiKey Algolia API Key + * + * @return $this + */ + public function setAlgoliaApiKey($algoliaApiKey = '') + { + $this->algoliaApiKey = $algoliaApiKey; + } + + /** + * Gets the Algolia API Key + * + * @return string + */ + public function getAlgoliaApiKey() + { + return $this->algoliaApiKey; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug($debug) + { + $this->debug = $debug; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile($debugFile) + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile() + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration() + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the default configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config) + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport() + { + $report = 'PHP SDK (Algolia\AlgoliaSearch) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' The version of the OpenAPI document: 0.1.0' . PHP_EOL; + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return null|string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } + + /** + * Returns an array of host settings + * + * @return array an array of host settings + */ + public function getHostSettings() + { + return [ + [ + "url" => "", + "description" => "No description provided", + ] + ]; + } + + /** + * Returns URL based on the index and variables + * + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public function getHostFromSettings($index, $variables = null) + { + if (null === $variables) { + $variables = []; + } + + $hosts = $this->getHostSettings(); + + // check array index out of bound + if ($index < 0 || $index >= sizeof($hosts)) { + throw new \InvalidArgumentException("Invalid index $index when selecting the host. Must be less than ".sizeof($hosts)); + } + + $host = $hosts[$index]; + $url = $host["url"]; + + // go through variable and assign a value + foreach ($host["variables"] ?? [] as $name => $variable) { + if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user + if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum + $url = str_replace("{".$name."}", $variables[$name], $url); + } else { + throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); + } + } else { + // use default value + $url = str_replace("{".$name."}", $variable["default_value"], $url); + } + } + + return $url; + } +} diff --git a/clients/algoliasearch-client-php/lib/HeaderSelector.php b/clients/algoliasearch-client-php/lib/HeaderSelector.php new file mode 100644 index 0000000000..a790756570 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/HeaderSelector.php @@ -0,0 +1,108 @@ +selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); + return $headers; + } + + /** + * @param string[] $accept + * @return array + */ + public function selectHeadersForMultipart($accept) + { + $headers = $this->selectHeaders($accept, []); + + unset($headers['Content-Type']); + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided + * + * @param string[] $accept Array of header + * + * @return null|string Accept (e.g. application/json) + */ + private function selectAcceptHeader($accept) + { + if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + return null; + } elseif ($jsonAccept = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept)) { + return implode(',', $jsonAccept); + } else { + return implode(',', $accept); + } + } + + /** + * Return the content type based on an array of content-type provided + * + * @param string[] $contentType Array fo content-type + * + * @return string Content-Type (e.g. application/json) + */ + private function selectContentTypeHeader($contentType) + { + if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { + return 'application/json'; + } elseif (preg_grep("/application\/json/i", $contentType)) { + return 'application/json'; + } else { + return implode(',', $contentType); + } + } +} diff --git a/clients/algoliasearch-client-php/lib/Model/Action.php b/clients/algoliasearch-client-php/lib/Model/Action.php new file mode 100644 index 0000000000..7033eff778 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Action.php @@ -0,0 +1,78 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'addApiKeyResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'key' => 'string', + 'createdAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'key' => null, + 'createdAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'key' => 'key', + 'createdAt' => 'createdAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'key' => 'setKey', + 'createdAt' => 'setCreatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'key' => 'getKey', + 'createdAt' => 'getCreatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['key'] = $data['key'] ?? null; + $this->container['createdAt'] = $data['createdAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['key'] === null) { + $invalidProperties[] = "'key' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' 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 key + * + * @return string + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string $key Key string. + * + * @return self + */ + public function setKey($key) + { + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Date of creation (ISO-8601 format). + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/Anchoring.php b/clients/algoliasearch-client-php/lib/Model/Anchoring.php new file mode 100644 index 0000000000..c40e959f29 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Anchoring.php @@ -0,0 +1,69 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ApiKey implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'apiKey'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acl' => 'string[]', + 'description' => 'string', + 'indexes' => 'string[]', + 'maxHitsPerQuery' => 'int', + 'maxQueriesPerIPPerHour' => 'int', + 'queryParameters' => 'string', + 'referers' => 'string[]', + 'validity' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acl' => null, + 'description' => null, + 'indexes' => null, + 'maxHitsPerQuery' => null, + 'maxQueriesPerIPPerHour' => null, + 'queryParameters' => null, + 'referers' => null, + 'validity' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'acl' => 'acl', + 'description' => 'description', + 'indexes' => 'indexes', + 'maxHitsPerQuery' => 'maxHitsPerQuery', + 'maxQueriesPerIPPerHour' => 'maxQueriesPerIPPerHour', + 'queryParameters' => 'queryParameters', + 'referers' => 'referers', + 'validity' => 'validity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acl' => 'setAcl', + 'description' => 'setDescription', + 'indexes' => 'setIndexes', + 'maxHitsPerQuery' => 'setMaxHitsPerQuery', + 'maxQueriesPerIPPerHour' => 'setMaxQueriesPerIPPerHour', + 'queryParameters' => 'setQueryParameters', + 'referers' => 'setReferers', + 'validity' => 'setValidity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acl' => 'getAcl', + 'description' => 'getDescription', + 'indexes' => 'getIndexes', + 'maxHitsPerQuery' => 'getMaxHitsPerQuery', + 'maxQueriesPerIPPerHour' => 'getMaxQueriesPerIPPerHour', + 'queryParameters' => 'getQueryParameters', + 'referers' => 'getReferers', + 'validity' => 'getValidity' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const ACL_ADD_OBJECT = 'addObject'; + const ACL_ANALYTICS = 'analytics'; + const ACL_BROWSE = 'browse'; + const ACL_DELETE_OBJECT = 'deleteObject'; + const ACL_DELETE_INDEX = 'deleteIndex'; + const ACL_EDIT_SETTINGS = 'editSettings'; + const ACL_LIST_INDEXES = 'listIndexes'; + const ACL_LOGS = 'logs'; + const ACL_PERSONALIZATION = 'personalization'; + const ACL_RECOMMENDATION = 'recommendation'; + const ACL_SEARCH = 'search'; + const ACL_SEE_UNRETRIEVABLE_ATTRIBUTES = 'seeUnretrievableAttributes'; + const ACL_SETTINGS = 'settings'; + const ACL_USAGE = 'usage'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAclAllowableValues() + { + return [ + self::ACL_ADD_OBJECT, + self::ACL_ANALYTICS, + self::ACL_BROWSE, + self::ACL_DELETE_OBJECT, + self::ACL_DELETE_INDEX, + self::ACL_EDIT_SETTINGS, + self::ACL_LIST_INDEXES, + self::ACL_LOGS, + self::ACL_PERSONALIZATION, + self::ACL_RECOMMENDATION, + self::ACL_SEARCH, + self::ACL_SEE_UNRETRIEVABLE_ATTRIBUTES, + self::ACL_SETTINGS, + self::ACL_USAGE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['acl'] = $data['acl'] ?? null; + $this->container['description'] = $data['description'] ?? ''; + $this->container['indexes'] = $data['indexes'] ?? null; + $this->container['maxHitsPerQuery'] = $data['maxHitsPerQuery'] ?? 0; + $this->container['maxQueriesPerIPPerHour'] = $data['maxQueriesPerIPPerHour'] ?? 0; + $this->container['queryParameters'] = $data['queryParameters'] ?? ''; + $this->container['referers'] = $data['referers'] ?? null; + $this->container['validity'] = $data['validity'] ?? 0; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['acl'] === null) { + $invalidProperties[] = "'acl' 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 acl + * + * @return string[] + */ + public function getAcl() + { + return $this->container['acl']; + } + + /** + * Sets acl + * + * @param string[] $acl Set of permissions associated with the key. + * + * @return self + */ + public function setAcl($acl) + { + $allowedValues = $this->getAclAllowableValues(); + if (array_diff($acl, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'acl', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['acl'] = $acl; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A comment used to identify a key more easily in the dashboard. It is not interpreted by the API. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets indexes + * + * @return string[]|null + */ + public function getIndexes() + { + return $this->container['indexes']; + } + + /** + * Sets indexes + * + * @param string[]|null $indexes Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed. + * + * @return self + */ + public function setIndexes($indexes) + { + $this->container['indexes'] = $indexes; + + return $this; + } + + /** + * Gets maxHitsPerQuery + * + * @return int|null + */ + public function getMaxHitsPerQuery() + { + return $this->container['maxHitsPerQuery']; + } + + /** + * Sets maxHitsPerQuery + * + * @param int|null $maxHitsPerQuery Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. + * + * @return self + */ + public function setMaxHitsPerQuery($maxHitsPerQuery) + { + $this->container['maxHitsPerQuery'] = $maxHitsPerQuery; + + return $this; + } + + /** + * Gets maxQueriesPerIPPerHour + * + * @return int|null + */ + public function getMaxQueriesPerIPPerHour() + { + return $this->container['maxQueriesPerIPPerHour']; + } + + /** + * Sets maxQueriesPerIPPerHour + * + * @param int|null $maxQueriesPerIPPerHour Maximum number of API calls per hour allowed from a given IP address or a user token. + * + * @return self + */ + public function setMaxQueriesPerIPPerHour($maxQueriesPerIPPerHour) + { + $this->container['maxQueriesPerIPPerHour'] = $maxQueriesPerIPPerHour; + + return $this; + } + + /** + * Gets queryParameters + * + * @return string|null + */ + public function getQueryParameters() + { + return $this->container['queryParameters']; + } + + /** + * Sets queryParameters + * + * @param string|null $queryParameters URL-encoded query string. Force some query parameters to be applied for each query made with this API key. + * + * @return self + */ + public function setQueryParameters($queryParameters) + { + $this->container['queryParameters'] = $queryParameters; + + return $this; + } + + /** + * Gets referers + * + * @return string[]|null + */ + public function getReferers() + { + return $this->container['referers']; + } + + /** + * Sets referers + * + * @param string[]|null $referers Restrict this new API key to specific referers. If empty or blank, defaults to all referers. + * + * @return self + */ + public function setReferers($referers) + { + $this->container['referers'] = $referers; + + return $this; + } + + /** + * Gets validity + * + * @return int|null + */ + public function getValidity() + { + return $this->container['validity']; + } + + /** + * Sets validity + * + * @param int|null $validity Validity limit for this key in seconds. The key will automatically be removed after this period of time. + * + * @return self + */ + public function setValidity($validity) + { + $this->container['validity'] = $validity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php b/clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php new file mode 100644 index 0000000000..ded86b4c6a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php @@ -0,0 +1,324 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AssignUserIdObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'assignUserIdObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cluster' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cluster' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cluster' => 'cluster' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cluster' => 'setCluster' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cluster' => 'getCluster' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['cluster'] = $data['cluster'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['cluster'] === null) { + $invalidProperties[] = "'cluster' 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 cluster + * + * @return string + */ + public function getCluster() + { + return $this->container['cluster']; + } + + /** + * Sets cluster + * + * @param string $cluster Name of the cluster. + * + * @return self + */ + public function setCluster($cluster) + { + $this->container['cluster'] = $cluster; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/AutomaticFacetFilter.php b/clients/algoliasearch-client-php/lib/Model/AutomaticFacetFilter.php new file mode 100644 index 0000000000..00dc6ff019 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/AutomaticFacetFilter.php @@ -0,0 +1,384 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AutomaticFacetFilter implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'automaticFacetFilter'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'facet' => 'string', + 'score' => 'int', + 'disjunctive' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'facet' => null, + 'score' => null, + 'disjunctive' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'facet' => 'facet', + 'score' => 'score', + 'disjunctive' => 'disjunctive' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'facet' => 'setFacet', + 'score' => 'setScore', + 'disjunctive' => 'setDisjunctive' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'facet' => 'getFacet', + 'score' => 'getScore', + 'disjunctive' => 'getDisjunctive' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['facet'] = $data['facet'] ?? null; + $this->container['score'] = $data['score'] ?? 1; + $this->container['disjunctive'] = $data['disjunctive'] ?? false; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['facet'] === null) { + $invalidProperties[] = "'facet' 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 facet + * + * @return string + */ + public function getFacet() + { + return $this->container['facet']; + } + + /** + * Sets facet + * + * @param string $facet Attribute to filter on. This must match a facet placeholder in the Rule's pattern. + * + * @return self + */ + public function setFacet($facet) + { + $this->container['facet'] = $facet; + + return $this; + } + + /** + * Gets score + * + * @return int|null + */ + public function getScore() + { + return $this->container['score']; + } + + /** + * Sets score + * + * @param int|null $score Score for the filter. Typically used for optional or disjunctive filters. + * + * @return self + */ + public function setScore($score) + { + $this->container['score'] = $score; + + return $this; + } + + /** + * Gets disjunctive + * + * @return bool|null + */ + public function getDisjunctive() + { + return $this->container['disjunctive']; + } + + /** + * Sets disjunctive + * + * @param bool|null $disjunctive Whether the filter is disjunctive (true) or conjunctive (false). + * + * @return self + */ + public function setDisjunctive($disjunctive) + { + $this->container['disjunctive'] = $disjunctive; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/BaseBrowseResponse.php b/clients/algoliasearch-client-php/lib/Model/BaseBrowseResponse.php new file mode 100644 index 0000000000..178d83ae52 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BaseBrowseResponse.php @@ -0,0 +1,323 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseBrowseResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'baseBrowseResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cursor' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cursor' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cursor' => 'cursor' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cursor' => 'setCursor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cursor' => 'getCursor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['cursor'] = $data['cursor'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['cursor'] === null) { + $invalidProperties[] = "'cursor' 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 cursor + * + * @return string + */ + public function getCursor() + { + return $this->container['cursor']; + } + + /** + * Sets cursor + * + * @param string $cursor Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. + * + * @return self + */ + public function setCursor($cursor) + { + $this->container['cursor'] = $cursor; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/BaseIndexSettings.php b/clients/algoliasearch-client-php/lib/Model/BaseIndexSettings.php new file mode 100644 index 0000000000..de9e79b577 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BaseIndexSettings.php @@ -0,0 +1,650 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseIndexSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'baseIndexSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'replicas' => 'string[]', + 'paginationLimitedTo' => 'int', + 'disableTypoToleranceOnWords' => 'string[]', + 'attributesToTransliterate' => 'string[]', + 'camelCaseAttributes' => 'string[]', + 'decompoundedAttributes' => 'array', + 'indexLanguages' => 'string[]', + 'filterPromotes' => 'bool', + 'disablePrefixOnAttributes' => 'string[]', + 'allowCompressionOfIntegerArray' => 'bool', + 'numericAttributesForFiltering' => 'string[]', + 'userData' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'replicas' => null, + 'paginationLimitedTo' => null, + 'disableTypoToleranceOnWords' => null, + 'attributesToTransliterate' => null, + 'camelCaseAttributes' => null, + 'decompoundedAttributes' => null, + 'indexLanguages' => null, + 'filterPromotes' => null, + 'disablePrefixOnAttributes' => null, + 'allowCompressionOfIntegerArray' => null, + 'numericAttributesForFiltering' => null, + 'userData' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'replicas' => 'replicas', + 'paginationLimitedTo' => 'paginationLimitedTo', + 'disableTypoToleranceOnWords' => 'disableTypoToleranceOnWords', + 'attributesToTransliterate' => 'attributesToTransliterate', + 'camelCaseAttributes' => 'camelCaseAttributes', + 'decompoundedAttributes' => 'decompoundedAttributes', + 'indexLanguages' => 'indexLanguages', + 'filterPromotes' => 'filterPromotes', + 'disablePrefixOnAttributes' => 'disablePrefixOnAttributes', + 'allowCompressionOfIntegerArray' => 'allowCompressionOfIntegerArray', + 'numericAttributesForFiltering' => 'numericAttributesForFiltering', + 'userData' => 'userData' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'replicas' => 'setReplicas', + 'paginationLimitedTo' => 'setPaginationLimitedTo', + 'disableTypoToleranceOnWords' => 'setDisableTypoToleranceOnWords', + 'attributesToTransliterate' => 'setAttributesToTransliterate', + 'camelCaseAttributes' => 'setCamelCaseAttributes', + 'decompoundedAttributes' => 'setDecompoundedAttributes', + 'indexLanguages' => 'setIndexLanguages', + 'filterPromotes' => 'setFilterPromotes', + 'disablePrefixOnAttributes' => 'setDisablePrefixOnAttributes', + 'allowCompressionOfIntegerArray' => 'setAllowCompressionOfIntegerArray', + 'numericAttributesForFiltering' => 'setNumericAttributesForFiltering', + 'userData' => 'setUserData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'replicas' => 'getReplicas', + 'paginationLimitedTo' => 'getPaginationLimitedTo', + 'disableTypoToleranceOnWords' => 'getDisableTypoToleranceOnWords', + 'attributesToTransliterate' => 'getAttributesToTransliterate', + 'camelCaseAttributes' => 'getCamelCaseAttributes', + 'decompoundedAttributes' => 'getDecompoundedAttributes', + 'indexLanguages' => 'getIndexLanguages', + 'filterPromotes' => 'getFilterPromotes', + 'disablePrefixOnAttributes' => 'getDisablePrefixOnAttributes', + 'allowCompressionOfIntegerArray' => 'getAllowCompressionOfIntegerArray', + 'numericAttributesForFiltering' => 'getNumericAttributesForFiltering', + 'userData' => 'getUserData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['replicas'] = $data['replicas'] ?? null; + $this->container['paginationLimitedTo'] = $data['paginationLimitedTo'] ?? 1000; + $this->container['disableTypoToleranceOnWords'] = $data['disableTypoToleranceOnWords'] ?? null; + $this->container['attributesToTransliterate'] = $data['attributesToTransliterate'] ?? null; + $this->container['camelCaseAttributes'] = $data['camelCaseAttributes'] ?? null; + $this->container['decompoundedAttributes'] = $data['decompoundedAttributes'] ?? null; + $this->container['indexLanguages'] = $data['indexLanguages'] ?? null; + $this->container['filterPromotes'] = $data['filterPromotes'] ?? false; + $this->container['disablePrefixOnAttributes'] = $data['disablePrefixOnAttributes'] ?? null; + $this->container['allowCompressionOfIntegerArray'] = $data['allowCompressionOfIntegerArray'] ?? false; + $this->container['numericAttributesForFiltering'] = $data['numericAttributesForFiltering'] ?? null; + $this->container['userData'] = $data['userData'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 string[]|null + */ + public function getReplicas() + { + return $this->container['replicas']; + } + + /** + * Sets replicas + * + * @param string[]|null $replicas Creates replicas, exact copies of an index. + * + * @return self + */ + public function setReplicas($replicas) + { + $this->container['replicas'] = $replicas; + + return $this; + } + + /** + * Gets paginationLimitedTo + * + * @return int|null + */ + public function getPaginationLimitedTo() + { + return $this->container['paginationLimitedTo']; + } + + /** + * Sets paginationLimitedTo + * + * @param int|null $paginationLimitedTo Set the maximum number of hits accessible via pagination. + * + * @return self + */ + public function setPaginationLimitedTo($paginationLimitedTo) + { + $this->container['paginationLimitedTo'] = $paginationLimitedTo; + + return $this; + } + + /** + * Gets disableTypoToleranceOnWords + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnWords() + { + return $this->container['disableTypoToleranceOnWords']; + } + + /** + * Sets disableTypoToleranceOnWords + * + * @param string[]|null $disableTypoToleranceOnWords A list of words for which you want to turn off typo tolerance. + * + * @return self + */ + public function setDisableTypoToleranceOnWords($disableTypoToleranceOnWords) + { + $this->container['disableTypoToleranceOnWords'] = $disableTypoToleranceOnWords; + + return $this; + } + + /** + * Gets attributesToTransliterate + * + * @return string[]|null + */ + public function getAttributesToTransliterate() + { + return $this->container['attributesToTransliterate']; + } + + /** + * Sets attributesToTransliterate + * + * @param string[]|null $attributesToTransliterate Specify on which attributes to apply transliteration. + * + * @return self + */ + public function setAttributesToTransliterate($attributesToTransliterate) + { + $this->container['attributesToTransliterate'] = $attributesToTransliterate; + + return $this; + } + + /** + * Gets camelCaseAttributes + * + * @return string[]|null + */ + public function getCamelCaseAttributes() + { + return $this->container['camelCaseAttributes']; + } + + /** + * Sets camelCaseAttributes + * + * @param string[]|null $camelCaseAttributes List of attributes on which to do a decomposition of camel case words. + * + * @return self + */ + public function setCamelCaseAttributes($camelCaseAttributes) + { + $this->container['camelCaseAttributes'] = $camelCaseAttributes; + + return $this; + } + + /** + * Gets decompoundedAttributes + * + * @return array|null + */ + public function getDecompoundedAttributes() + { + return $this->container['decompoundedAttributes']; + } + + /** + * Sets decompoundedAttributes + * + * @param array|null $decompoundedAttributes Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding. + * + * @return self + */ + public function setDecompoundedAttributes($decompoundedAttributes) + { + $this->container['decompoundedAttributes'] = $decompoundedAttributes; + + return $this; + } + + /** + * Gets indexLanguages + * + * @return string[]|null + */ + public function getIndexLanguages() + { + return $this->container['indexLanguages']; + } + + /** + * Sets indexLanguages + * + * @param string[]|null $indexLanguages Sets the languages at the index level for language-specific processing such as tokenization and normalization. + * + * @return self + */ + public function setIndexLanguages($indexLanguages) + { + $this->container['indexLanguages'] = $indexLanguages; + + return $this; + } + + /** + * Gets filterPromotes + * + * @return bool|null + */ + public function getFilterPromotes() + { + return $this->container['filterPromotes']; + } + + /** + * Sets filterPromotes + * + * @param bool|null $filterPromotes Whether promoted results should match the filters of the current search, except for geographic filters. + * + * @return self + */ + public function setFilterPromotes($filterPromotes) + { + $this->container['filterPromotes'] = $filterPromotes; + + return $this; + } + + /** + * Gets disablePrefixOnAttributes + * + * @return string[]|null + */ + public function getDisablePrefixOnAttributes() + { + return $this->container['disablePrefixOnAttributes']; + } + + /** + * Sets disablePrefixOnAttributes + * + * @param string[]|null $disablePrefixOnAttributes List of attributes on which you want to disable prefix matching. + * + * @return self + */ + public function setDisablePrefixOnAttributes($disablePrefixOnAttributes) + { + $this->container['disablePrefixOnAttributes'] = $disablePrefixOnAttributes; + + return $this; + } + + /** + * Gets allowCompressionOfIntegerArray + * + * @return bool|null + */ + public function getAllowCompressionOfIntegerArray() + { + return $this->container['allowCompressionOfIntegerArray']; + } + + /** + * Sets allowCompressionOfIntegerArray + * + * @param bool|null $allowCompressionOfIntegerArray Enables compression of large integer arrays. + * + * @return self + */ + public function setAllowCompressionOfIntegerArray($allowCompressionOfIntegerArray) + { + $this->container['allowCompressionOfIntegerArray'] = $allowCompressionOfIntegerArray; + + return $this; + } + + /** + * Gets numericAttributesForFiltering + * + * @return string[]|null + */ + public function getNumericAttributesForFiltering() + { + return $this->container['numericAttributesForFiltering']; + } + + /** + * Sets numericAttributesForFiltering + * + * @param string[]|null $numericAttributesForFiltering List of numeric attributes that can be used as numerical filters. + * + * @return self + */ + public function setNumericAttributesForFiltering($numericAttributesForFiltering) + { + $this->container['numericAttributesForFiltering'] = $numericAttributesForFiltering; + + return $this; + } + + /** + * Gets userData + * + * @return array|null + */ + public function getUserData() + { + return $this->container['userData']; + } + + /** + * Sets userData + * + * @param array|null $userData Lets you store custom data in your indices. + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/BaseSearchParams.php b/clients/algoliasearch-client-php/lib/Model/BaseSearchParams.php new file mode 100644 index 0000000000..32b0541ebe --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BaseSearchParams.php @@ -0,0 +1,1275 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseSearchParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'baseSearchParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'similarQuery' => 'string', + 'filters' => 'string', + 'facetFilters' => 'string[]', + 'optionalFilters' => 'string[]', + 'numericFilters' => 'string[]', + 'tagFilters' => 'string[]', + 'sumOrFiltersScores' => 'bool', + 'facets' => 'string[]', + 'maxValuesPerFacet' => 'int', + 'facetingAfterDistinct' => 'bool', + 'sortFacetValuesBy' => 'string', + 'page' => 'int', + 'offset' => 'int', + 'length' => 'int', + 'aroundLatLng' => 'string', + 'aroundLatLngViaIP' => 'bool', + 'aroundRadius' => 'OneOfIntegerString', + 'aroundPrecision' => 'int', + 'minimumAroundRadius' => 'int', + 'insideBoundingBox' => 'float[]', + 'insidePolygon' => 'float[]', + 'naturalLanguages' => 'string[]', + 'ruleContexts' => 'string[]', + 'personalizationImpact' => 'int', + 'userToken' => 'string', + 'getRankingInfo' => 'bool', + 'clickAnalytics' => 'bool', + 'analytics' => 'bool', + 'analyticsTags' => 'string[]', + 'percentileComputation' => 'bool', + 'enableABTest' => 'bool', + 'enableReRanking' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'similarQuery' => null, + 'filters' => null, + 'facetFilters' => null, + 'optionalFilters' => null, + 'numericFilters' => null, + 'tagFilters' => null, + 'sumOrFiltersScores' => null, + 'facets' => null, + 'maxValuesPerFacet' => null, + 'facetingAfterDistinct' => null, + 'sortFacetValuesBy' => null, + 'page' => null, + 'offset' => null, + 'length' => null, + 'aroundLatLng' => null, + 'aroundLatLngViaIP' => null, + 'aroundRadius' => null, + 'aroundPrecision' => null, + 'minimumAroundRadius' => null, + 'insideBoundingBox' => null, + 'insidePolygon' => null, + 'naturalLanguages' => null, + 'ruleContexts' => null, + 'personalizationImpact' => null, + 'userToken' => null, + 'getRankingInfo' => null, + 'clickAnalytics' => null, + 'analytics' => null, + 'analyticsTags' => null, + 'percentileComputation' => null, + 'enableABTest' => null, + 'enableReRanking' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'similarQuery' => 'similarQuery', + 'filters' => 'filters', + 'facetFilters' => 'facetFilters', + 'optionalFilters' => 'optionalFilters', + 'numericFilters' => 'numericFilters', + 'tagFilters' => 'tagFilters', + 'sumOrFiltersScores' => 'sumOrFiltersScores', + 'facets' => 'facets', + 'maxValuesPerFacet' => 'maxValuesPerFacet', + 'facetingAfterDistinct' => 'facetingAfterDistinct', + 'sortFacetValuesBy' => 'sortFacetValuesBy', + 'page' => 'page', + 'offset' => 'offset', + 'length' => 'length', + 'aroundLatLng' => 'aroundLatLng', + 'aroundLatLngViaIP' => 'aroundLatLngViaIP', + 'aroundRadius' => 'aroundRadius', + 'aroundPrecision' => 'aroundPrecision', + 'minimumAroundRadius' => 'minimumAroundRadius', + 'insideBoundingBox' => 'insideBoundingBox', + 'insidePolygon' => 'insidePolygon', + 'naturalLanguages' => 'naturalLanguages', + 'ruleContexts' => 'ruleContexts', + 'personalizationImpact' => 'personalizationImpact', + 'userToken' => 'userToken', + 'getRankingInfo' => 'getRankingInfo', + 'clickAnalytics' => 'clickAnalytics', + 'analytics' => 'analytics', + 'analyticsTags' => 'analyticsTags', + 'percentileComputation' => 'percentileComputation', + 'enableABTest' => 'enableABTest', + 'enableReRanking' => 'enableReRanking' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'similarQuery' => 'setSimilarQuery', + 'filters' => 'setFilters', + 'facetFilters' => 'setFacetFilters', + 'optionalFilters' => 'setOptionalFilters', + 'numericFilters' => 'setNumericFilters', + 'tagFilters' => 'setTagFilters', + 'sumOrFiltersScores' => 'setSumOrFiltersScores', + 'facets' => 'setFacets', + 'maxValuesPerFacet' => 'setMaxValuesPerFacet', + 'facetingAfterDistinct' => 'setFacetingAfterDistinct', + 'sortFacetValuesBy' => 'setSortFacetValuesBy', + 'page' => 'setPage', + 'offset' => 'setOffset', + 'length' => 'setLength', + 'aroundLatLng' => 'setAroundLatLng', + 'aroundLatLngViaIP' => 'setAroundLatLngViaIP', + 'aroundRadius' => 'setAroundRadius', + 'aroundPrecision' => 'setAroundPrecision', + 'minimumAroundRadius' => 'setMinimumAroundRadius', + 'insideBoundingBox' => 'setInsideBoundingBox', + 'insidePolygon' => 'setInsidePolygon', + 'naturalLanguages' => 'setNaturalLanguages', + 'ruleContexts' => 'setRuleContexts', + 'personalizationImpact' => 'setPersonalizationImpact', + 'userToken' => 'setUserToken', + 'getRankingInfo' => 'setGetRankingInfo', + 'clickAnalytics' => 'setClickAnalytics', + 'analytics' => 'setAnalytics', + 'analyticsTags' => 'setAnalyticsTags', + 'percentileComputation' => 'setPercentileComputation', + 'enableABTest' => 'setEnableABTest', + 'enableReRanking' => 'setEnableReRanking' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'similarQuery' => 'getSimilarQuery', + 'filters' => 'getFilters', + 'facetFilters' => 'getFacetFilters', + 'optionalFilters' => 'getOptionalFilters', + 'numericFilters' => 'getNumericFilters', + 'tagFilters' => 'getTagFilters', + 'sumOrFiltersScores' => 'getSumOrFiltersScores', + 'facets' => 'getFacets', + 'maxValuesPerFacet' => 'getMaxValuesPerFacet', + 'facetingAfterDistinct' => 'getFacetingAfterDistinct', + 'sortFacetValuesBy' => 'getSortFacetValuesBy', + 'page' => 'getPage', + 'offset' => 'getOffset', + 'length' => 'getLength', + 'aroundLatLng' => 'getAroundLatLng', + 'aroundLatLngViaIP' => 'getAroundLatLngViaIP', + 'aroundRadius' => 'getAroundRadius', + 'aroundPrecision' => 'getAroundPrecision', + 'minimumAroundRadius' => 'getMinimumAroundRadius', + 'insideBoundingBox' => 'getInsideBoundingBox', + 'insidePolygon' => 'getInsidePolygon', + 'naturalLanguages' => 'getNaturalLanguages', + 'ruleContexts' => 'getRuleContexts', + 'personalizationImpact' => 'getPersonalizationImpact', + 'userToken' => 'getUserToken', + 'getRankingInfo' => 'getGetRankingInfo', + 'clickAnalytics' => 'getClickAnalytics', + 'analytics' => 'getAnalytics', + 'analyticsTags' => 'getAnalyticsTags', + 'percentileComputation' => 'getPercentileComputation', + 'enableABTest' => 'getEnableABTest', + 'enableReRanking' => 'getEnableReRanking' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['similarQuery'] = $data['similarQuery'] ?? ''; + $this->container['filters'] = $data['filters'] ?? ''; + $this->container['facetFilters'] = $data['facetFilters'] ?? null; + $this->container['optionalFilters'] = $data['optionalFilters'] ?? null; + $this->container['numericFilters'] = $data['numericFilters'] ?? null; + $this->container['tagFilters'] = $data['tagFilters'] ?? null; + $this->container['sumOrFiltersScores'] = $data['sumOrFiltersScores'] ?? false; + $this->container['facets'] = $data['facets'] ?? null; + $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet'] ?? 100; + $this->container['facetingAfterDistinct'] = $data['facetingAfterDistinct'] ?? false; + $this->container['sortFacetValuesBy'] = $data['sortFacetValuesBy'] ?? 'count'; + $this->container['page'] = $data['page'] ?? 0; + $this->container['offset'] = $data['offset'] ?? null; + $this->container['length'] = $data['length'] ?? null; + $this->container['aroundLatLng'] = $data['aroundLatLng'] ?? ''; + $this->container['aroundLatLngViaIP'] = $data['aroundLatLngViaIP'] ?? false; + $this->container['aroundRadius'] = $data['aroundRadius'] ?? null; + $this->container['aroundPrecision'] = $data['aroundPrecision'] ?? 10; + $this->container['minimumAroundRadius'] = $data['minimumAroundRadius'] ?? null; + $this->container['insideBoundingBox'] = $data['insideBoundingBox'] ?? null; + $this->container['insidePolygon'] = $data['insidePolygon'] ?? null; + $this->container['naturalLanguages'] = $data['naturalLanguages'] ?? null; + $this->container['ruleContexts'] = $data['ruleContexts'] ?? null; + $this->container['personalizationImpact'] = $data['personalizationImpact'] ?? 100; + $this->container['userToken'] = $data['userToken'] ?? null; + $this->container['getRankingInfo'] = $data['getRankingInfo'] ?? false; + $this->container['clickAnalytics'] = $data['clickAnalytics'] ?? false; + $this->container['analytics'] = $data['analytics'] ?? true; + $this->container['analyticsTags'] = $data['analyticsTags'] ?? null; + $this->container['percentileComputation'] = $data['percentileComputation'] ?? true; + $this->container['enableABTest'] = $data['enableABTest'] ?? true; + $this->container['enableReRanking'] = $data['enableReRanking'] ?? true; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['length']) && ($this->container['length'] > 1000)) { + $invalidProperties[] = "invalid value for 'length', must be smaller than or equal to 1000."; + } + + if (!is_null($this->container['length']) && ($this->container['length'] < 1)) { + $invalidProperties[] = "invalid value for 'length', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['minimumAroundRadius']) && ($this->container['minimumAroundRadius'] < 1)) { + $invalidProperties[] = "invalid value for 'minimumAroundRadius', must be bigger than or equal to 1."; + } + + 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 similarQuery + * + * @return string|null + */ + public function getSimilarQuery() + { + return $this->container['similarQuery']; + } + + /** + * Sets similarQuery + * + * @param string|null $similarQuery Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. + * + * @return self + */ + public function setSimilarQuery($similarQuery) + { + $this->container['similarQuery'] = $similarQuery; + + return $this; + } + + /** + * Gets filters + * + * @return string|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param string|null $filters Filter the query with numeric, facet and/or tag filters. + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets facetFilters + * + * @return string[]|null + */ + public function getFacetFilters() + { + return $this->container['facetFilters']; + } + + /** + * Sets facetFilters + * + * @param string[]|null $facetFilters Filter hits by facet value. + * + * @return self + */ + public function setFacetFilters($facetFilters) + { + $this->container['facetFilters'] = $facetFilters; + + return $this; + } + + /** + * Gets optionalFilters + * + * @return string[]|null + */ + public function getOptionalFilters() + { + return $this->container['optionalFilters']; + } + + /** + * Sets optionalFilters + * + * @param string[]|null $optionalFilters Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. + * + * @return self + */ + public function setOptionalFilters($optionalFilters) + { + $this->container['optionalFilters'] = $optionalFilters; + + return $this; + } + + /** + * Gets numericFilters + * + * @return string[]|null + */ + public function getNumericFilters() + { + return $this->container['numericFilters']; + } + + /** + * Sets numericFilters + * + * @param string[]|null $numericFilters Filter on numeric attributes. + * + * @return self + */ + public function setNumericFilters($numericFilters) + { + $this->container['numericFilters'] = $numericFilters; + + return $this; + } + + /** + * Gets tagFilters + * + * @return string[]|null + */ + public function getTagFilters() + { + return $this->container['tagFilters']; + } + + /** + * Sets tagFilters + * + * @param string[]|null $tagFilters Filter hits by tags. + * + * @return self + */ + public function setTagFilters($tagFilters) + { + $this->container['tagFilters'] = $tagFilters; + + return $this; + } + + /** + * Gets sumOrFiltersScores + * + * @return bool|null + */ + public function getSumOrFiltersScores() + { + return $this->container['sumOrFiltersScores']; + } + + /** + * Sets sumOrFiltersScores + * + * @param bool|null $sumOrFiltersScores Determines how to calculate the total score for filtering. + * + * @return self + */ + public function setSumOrFiltersScores($sumOrFiltersScores) + { + $this->container['sumOrFiltersScores'] = $sumOrFiltersScores; + + return $this; + } + + /** + * Gets facets + * + * @return string[]|null + */ + public function getFacets() + { + return $this->container['facets']; + } + + /** + * Sets facets + * + * @param string[]|null $facets Retrieve facets and their facet values. + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets maxValuesPerFacet + * + * @return int|null + */ + public function getMaxValuesPerFacet() + { + return $this->container['maxValuesPerFacet']; + } + + /** + * Sets maxValuesPerFacet + * + * @param int|null $maxValuesPerFacet Maximum number of facet values to return for each facet during a regular search. + * + * @return self + */ + public function setMaxValuesPerFacet($maxValuesPerFacet) + { + $this->container['maxValuesPerFacet'] = $maxValuesPerFacet; + + return $this; + } + + /** + * Gets facetingAfterDistinct + * + * @return bool|null + */ + public function getFacetingAfterDistinct() + { + return $this->container['facetingAfterDistinct']; + } + + /** + * Sets facetingAfterDistinct + * + * @param bool|null $facetingAfterDistinct Force faceting to be applied after de-duplication (via the Distinct setting). + * + * @return self + */ + public function setFacetingAfterDistinct($facetingAfterDistinct) + { + $this->container['facetingAfterDistinct'] = $facetingAfterDistinct; + + return $this; + } + + /** + * Gets sortFacetValuesBy + * + * @return string|null + */ + public function getSortFacetValuesBy() + { + return $this->container['sortFacetValuesBy']; + } + + /** + * Sets sortFacetValuesBy + * + * @param string|null $sortFacetValuesBy Controls how facet values are fetched. + * + * @return self + */ + public function setSortFacetValuesBy($sortFacetValuesBy) + { + $this->container['sortFacetValuesBy'] = $sortFacetValuesBy; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page Specify the page to retrieve. + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets offset + * + * @return int|null + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * + * @param int|null $offset Specify the offset of the first hit to return. + * + * @return self + */ + public function setOffset($offset) + { + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets length + * + * @return int|null + */ + public function getLength() + { + return $this->container['length']; + } + + /** + * Sets length + * + * @param int|null $length Set the number of hits to retrieve (used only with offset). + * + * @return self + */ + public function setLength($length) + { + + if (!is_null($length) && ($length > 1000)) { + throw new \InvalidArgumentException('invalid value for $length when calling BaseSearchParams., must be smaller than or equal to 1000.'); + } + if (!is_null($length) && ($length < 1)) { + throw new \InvalidArgumentException('invalid value for $length when calling BaseSearchParams., must be bigger than or equal to 1.'); + } + + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng']; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng Search for entries around a central geolocation, enabling a geo search within a circular area. + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets aroundLatLngViaIP + * + * @return bool|null + */ + public function getAroundLatLngViaIP() + { + return $this->container['aroundLatLngViaIP']; + } + + /** + * Sets aroundLatLngViaIP + * + * @param bool|null $aroundLatLngViaIP Search for entries around a given location automatically computed from the requester's IP address. + * + * @return self + */ + public function setAroundLatLngViaIP($aroundLatLngViaIP) + { + $this->container['aroundLatLngViaIP'] = $aroundLatLngViaIP; + + return $this; + } + + /** + * Gets aroundRadius + * + * @return OneOfIntegerString|null + */ + public function getAroundRadius() + { + return $this->container['aroundRadius']; + } + + /** + * Sets aroundRadius + * + * @param OneOfIntegerString|null $aroundRadius Define the maximum radius for a geo search (in meters). + * + * @return self + */ + public function setAroundRadius($aroundRadius) + { + $this->container['aroundRadius'] = $aroundRadius; + + return $this; + } + + /** + * Gets aroundPrecision + * + * @return int|null + */ + public function getAroundPrecision() + { + return $this->container['aroundPrecision']; + } + + /** + * Sets aroundPrecision + * + * @param int|null $aroundPrecision Precision of geo search (in meters), to add grouping by geo location to the ranking formula. + * + * @return self + */ + public function setAroundPrecision($aroundPrecision) + { + $this->container['aroundPrecision'] = $aroundPrecision; + + return $this; + } + + /** + * Gets minimumAroundRadius + * + * @return int|null + */ + public function getMinimumAroundRadius() + { + return $this->container['minimumAroundRadius']; + } + + /** + * Sets minimumAroundRadius + * + * @param int|null $minimumAroundRadius Minimum radius (in meters) used for a geo search when aroundRadius is not set. + * + * @return self + */ + public function setMinimumAroundRadius($minimumAroundRadius) + { + + if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { + throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling BaseSearchParams., must be bigger than or equal to 1.'); + } + + $this->container['minimumAroundRadius'] = $minimumAroundRadius; + + return $this; + } + + /** + * Gets insideBoundingBox + * + * @return float[]|null + */ + public function getInsideBoundingBox() + { + return $this->container['insideBoundingBox']; + } + + /** + * Sets insideBoundingBox + * + * @param float[]|null $insideBoundingBox Search inside a rectangular area (in geo coordinates). + * + * @return self + */ + public function setInsideBoundingBox($insideBoundingBox) + { + $this->container['insideBoundingBox'] = $insideBoundingBox; + + return $this; + } + + /** + * Gets insidePolygon + * + * @return float[]|null + */ + public function getInsidePolygon() + { + return $this->container['insidePolygon']; + } + + /** + * Sets insidePolygon + * + * @param float[]|null $insidePolygon Search inside a polygon (in geo coordinates). + * + * @return self + */ + public function setInsidePolygon($insidePolygon) + { + $this->container['insidePolygon'] = $insidePolygon; + + return $this; + } + + /** + * Gets naturalLanguages + * + * @return string[]|null + */ + public function getNaturalLanguages() + { + return $this->container['naturalLanguages']; + } + + /** + * Sets naturalLanguages + * + * @param string[]|null $naturalLanguages This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. + * + * @return self + */ + public function setNaturalLanguages($naturalLanguages) + { + $this->container['naturalLanguages'] = $naturalLanguages; + + return $this; + } + + /** + * Gets ruleContexts + * + * @return string[]|null + */ + public function getRuleContexts() + { + return $this->container['ruleContexts']; + } + + /** + * Sets ruleContexts + * + * @param string[]|null $ruleContexts Enables contextual rules. + * + * @return self + */ + public function setRuleContexts($ruleContexts) + { + $this->container['ruleContexts'] = $ruleContexts; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int|null + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact']; + } + + /** + * Sets personalizationImpact + * + * @param int|null $personalizationImpact Define the impact of the Personalization feature. + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + return $this; + } + + /** + * Gets userToken + * + * @return string|null + */ + public function getUserToken() + { + return $this->container['userToken']; + } + + /** + * Sets userToken + * + * @param string|null $userToken Associates a certain user token with the current search. + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets getRankingInfo + * + * @return bool|null + */ + public function getGetRankingInfo() + { + return $this->container['getRankingInfo']; + } + + /** + * Sets getRankingInfo + * + * @param bool|null $getRankingInfo Retrieve detailed ranking information. + * + * @return self + */ + public function setGetRankingInfo($getRankingInfo) + { + $this->container['getRankingInfo'] = $getRankingInfo; + + return $this; + } + + /** + * Gets clickAnalytics + * + * @return bool|null + */ + public function getClickAnalytics() + { + return $this->container['clickAnalytics']; + } + + /** + * Sets clickAnalytics + * + * @param bool|null $clickAnalytics Enable the Click Analytics feature. + * + * @return self + */ + public function setClickAnalytics($clickAnalytics) + { + $this->container['clickAnalytics'] = $clickAnalytics; + + return $this; + } + + /** + * Gets analytics + * + * @return bool|null + */ + public function getAnalytics() + { + return $this->container['analytics']; + } + + /** + * Sets analytics + * + * @param bool|null $analytics Whether the current query will be taken into account in the Analytics. + * + * @return self + */ + public function setAnalytics($analytics) + { + $this->container['analytics'] = $analytics; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[]|null + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags']; + } + + /** + * Sets analyticsTags + * + * @param string[]|null $analyticsTags List of tags to apply to the query for analytics purposes. + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets percentileComputation + * + * @return bool|null + */ + public function getPercentileComputation() + { + return $this->container['percentileComputation']; + } + + /** + * Sets percentileComputation + * + * @param bool|null $percentileComputation Whether to include or exclude a query from the processing-time percentile computation. + * + * @return self + */ + public function setPercentileComputation($percentileComputation) + { + $this->container['percentileComputation'] = $percentileComputation; + + return $this; + } + + /** + * Gets enableABTest + * + * @return bool|null + */ + public function getEnableABTest() + { + return $this->container['enableABTest']; + } + + /** + * Sets enableABTest + * + * @param bool|null $enableABTest Whether this search should participate in running AB tests. + * + * @return self + */ + public function setEnableABTest($enableABTest) + { + $this->container['enableABTest'] = $enableABTest; + + return $this; + } + + /** + * Gets enableReRanking + * + * @return bool|null + */ + public function getEnableReRanking() + { + return $this->container['enableReRanking']; + } + + /** + * Sets enableReRanking + * + * @param bool|null $enableReRanking Whether this search should use AI Re-Ranking. + * + * @return self + */ + public function setEnableReRanking($enableReRanking) + { + $this->container['enableReRanking'] = $enableReRanking; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/BaseSearchResponse.php b/clients/algoliasearch-client-php/lib/Model/BaseSearchResponse.php new file mode 100644 index 0000000000..b8ff03fe36 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BaseSearchResponse.php @@ -0,0 +1,1046 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseSearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'baseSearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'abTestID' => 'int', + 'abTestVariantID' => 'int', + 'aroundLatLng' => 'string', + 'automaticRadius' => 'string', + 'exhaustiveFacetsCount' => 'bool', + 'exhaustiveNbHits' => 'bool', + 'exhaustiveTypo' => 'bool', + 'facets' => 'array>', + 'facetsStats' => 'array', + 'hitsPerPage' => 'int', + 'index' => 'string', + 'indexUsed' => 'string', + 'message' => 'string', + 'nbHits' => 'int', + 'nbPages' => 'int', + 'nbSortedHits' => 'int', + 'page' => 'int', + 'params' => 'string', + 'parsedQuery' => 'string', + 'processingTimeMS' => 'int', + 'query' => 'string', + 'queryAfterRemoval' => 'string', + 'serverUsed' => 'string', + 'userData' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'abTestID' => null, + 'abTestVariantID' => null, + 'aroundLatLng' => null, + 'automaticRadius' => null, + 'exhaustiveFacetsCount' => null, + 'exhaustiveNbHits' => null, + 'exhaustiveTypo' => null, + 'facets' => null, + 'facetsStats' => null, + 'hitsPerPage' => null, + 'index' => null, + 'indexUsed' => null, + 'message' => null, + 'nbHits' => null, + 'nbPages' => null, + 'nbSortedHits' => null, + 'page' => null, + 'params' => null, + 'parsedQuery' => null, + 'processingTimeMS' => null, + 'query' => null, + 'queryAfterRemoval' => null, + 'serverUsed' => null, + 'userData' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'abTestID' => 'abTestID', + 'abTestVariantID' => 'abTestVariantID', + 'aroundLatLng' => 'aroundLatLng', + 'automaticRadius' => 'automaticRadius', + 'exhaustiveFacetsCount' => 'exhaustiveFacetsCount', + 'exhaustiveNbHits' => 'exhaustiveNbHits', + 'exhaustiveTypo' => 'exhaustiveTypo', + 'facets' => 'facets', + 'facetsStats' => 'facets_stats', + 'hitsPerPage' => 'hitsPerPage', + 'index' => 'index', + 'indexUsed' => 'indexUsed', + 'message' => 'message', + 'nbHits' => 'nbHits', + 'nbPages' => 'nbPages', + 'nbSortedHits' => 'nbSortedHits', + 'page' => 'page', + 'params' => 'params', + 'parsedQuery' => 'parsedQuery', + 'processingTimeMS' => 'processingTimeMS', + 'query' => 'query', + 'queryAfterRemoval' => 'queryAfterRemoval', + 'serverUsed' => 'serverUsed', + 'userData' => 'userData' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abTestID' => 'setAbTestID', + 'abTestVariantID' => 'setAbTestVariantID', + 'aroundLatLng' => 'setAroundLatLng', + 'automaticRadius' => 'setAutomaticRadius', + 'exhaustiveFacetsCount' => 'setExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'setExhaustiveNbHits', + 'exhaustiveTypo' => 'setExhaustiveTypo', + 'facets' => 'setFacets', + 'facetsStats' => 'setFacetsStats', + 'hitsPerPage' => 'setHitsPerPage', + 'index' => 'setIndex', + 'indexUsed' => 'setIndexUsed', + 'message' => 'setMessage', + 'nbHits' => 'setNbHits', + 'nbPages' => 'setNbPages', + 'nbSortedHits' => 'setNbSortedHits', + 'page' => 'setPage', + 'params' => 'setParams', + 'parsedQuery' => 'setParsedQuery', + 'processingTimeMS' => 'setProcessingTimeMS', + 'query' => 'setQuery', + 'queryAfterRemoval' => 'setQueryAfterRemoval', + 'serverUsed' => 'setServerUsed', + 'userData' => 'setUserData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abTestID' => 'getAbTestID', + 'abTestVariantID' => 'getAbTestVariantID', + 'aroundLatLng' => 'getAroundLatLng', + 'automaticRadius' => 'getAutomaticRadius', + 'exhaustiveFacetsCount' => 'getExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'getExhaustiveNbHits', + 'exhaustiveTypo' => 'getExhaustiveTypo', + 'facets' => 'getFacets', + 'facetsStats' => 'getFacetsStats', + 'hitsPerPage' => 'getHitsPerPage', + 'index' => 'getIndex', + 'indexUsed' => 'getIndexUsed', + 'message' => 'getMessage', + 'nbHits' => 'getNbHits', + 'nbPages' => 'getNbPages', + 'nbSortedHits' => 'getNbSortedHits', + 'page' => 'getPage', + 'params' => 'getParams', + 'parsedQuery' => 'getParsedQuery', + 'processingTimeMS' => 'getProcessingTimeMS', + 'query' => 'getQuery', + 'queryAfterRemoval' => 'getQueryAfterRemoval', + 'serverUsed' => 'getServerUsed', + 'userData' => 'getUserData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['abTestID'] = $data['abTestID'] ?? null; + $this->container['abTestVariantID'] = $data['abTestVariantID'] ?? null; + $this->container['aroundLatLng'] = $data['aroundLatLng'] ?? null; + $this->container['automaticRadius'] = $data['automaticRadius'] ?? null; + $this->container['exhaustiveFacetsCount'] = $data['exhaustiveFacetsCount'] ?? null; + $this->container['exhaustiveNbHits'] = $data['exhaustiveNbHits'] ?? null; + $this->container['exhaustiveTypo'] = $data['exhaustiveTypo'] ?? null; + $this->container['facets'] = $data['facets'] ?? null; + $this->container['facetsStats'] = $data['facetsStats'] ?? null; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['index'] = $data['index'] ?? null; + $this->container['indexUsed'] = $data['indexUsed'] ?? null; + $this->container['message'] = $data['message'] ?? null; + $this->container['nbHits'] = $data['nbHits'] ?? null; + $this->container['nbPages'] = $data['nbPages'] ?? null; + $this->container['nbSortedHits'] = $data['nbSortedHits'] ?? null; + $this->container['page'] = $data['page'] ?? 0; + $this->container['params'] = $data['params'] ?? null; + $this->container['parsedQuery'] = $data['parsedQuery'] ?? null; + $this->container['processingTimeMS'] = $data['processingTimeMS'] ?? null; + $this->container['query'] = $data['query'] ?? ''; + $this->container['queryAfterRemoval'] = $data['queryAfterRemoval'] ?? null; + $this->container['serverUsed'] = $data['serverUsed'] ?? null; + $this->container['userData'] = $data['userData'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['aroundLatLng']) && !preg_match("/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/", $this->container['aroundLatLng'])) { + $invalidProperties[] = "invalid value for 'aroundLatLng', must be conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."; + } + + if ($this->container['exhaustiveNbHits'] === null) { + $invalidProperties[] = "'exhaustiveNbHits' can't be null"; + } + if ($this->container['exhaustiveTypo'] === null) { + $invalidProperties[] = "'exhaustiveTypo' can't be null"; + } + if ($this->container['hitsPerPage'] === null) { + $invalidProperties[] = "'hitsPerPage' can't be null"; + } + if ($this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if ($this->container['nbPages'] === null) { + $invalidProperties[] = "'nbPages' can't be null"; + } + if ($this->container['page'] === null) { + $invalidProperties[] = "'page' can't be null"; + } + if ($this->container['params'] === null) { + $invalidProperties[] = "'params' can't be null"; + } + if ($this->container['processingTimeMS'] === null) { + $invalidProperties[] = "'processingTimeMS' can't be null"; + } + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' 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 abTestID + * + * @return int|null + */ + public function getAbTestID() + { + return $this->container['abTestID']; + } + + /** + * Sets abTestID + * + * @param int|null $abTestID If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID. + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets abTestVariantID + * + * @return int|null + */ + public function getAbTestVariantID() + { + return $this->container['abTestVariantID']; + } + + /** + * Sets abTestVariantID + * + * @param int|null $abTestVariantID If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used. + * + * @return self + */ + public function setAbTestVariantID($abTestVariantID) + { + $this->container['abTestVariantID'] = $abTestVariantID; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng']; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng The computed geo location. + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + + if (!is_null($aroundLatLng) && (!preg_match("/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/", $aroundLatLng))) { + throw new \InvalidArgumentException("invalid value for $aroundLatLng when calling BaseSearchResponse., must conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."); + } + + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets automaticRadius + * + * @return string|null + */ + public function getAutomaticRadius() + { + return $this->container['automaticRadius']; + } + + /** + * Sets automaticRadius + * + * @param string|null $automaticRadius The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. + * + * @return self + */ + public function setAutomaticRadius($automaticRadius) + { + $this->container['automaticRadius'] = $automaticRadius; + + return $this; + } + + /** + * Gets exhaustiveFacetsCount + * + * @return bool|null + */ + public function getExhaustiveFacetsCount() + { + return $this->container['exhaustiveFacetsCount']; + } + + /** + * Sets exhaustiveFacetsCount + * + * @param bool|null $exhaustiveFacetsCount Whether the facet count is exhaustive or approximate. + * + * @return self + */ + public function setExhaustiveFacetsCount($exhaustiveFacetsCount) + { + $this->container['exhaustiveFacetsCount'] = $exhaustiveFacetsCount; + + return $this; + } + + /** + * Gets exhaustiveNbHits + * + * @return bool + */ + public function getExhaustiveNbHits() + { + return $this->container['exhaustiveNbHits']; + } + + /** + * Sets exhaustiveNbHits + * + * @param bool $exhaustiveNbHits Indicate if the nbHits count was exhaustive or approximate + * + * @return self + */ + public function setExhaustiveNbHits($exhaustiveNbHits) + { + $this->container['exhaustiveNbHits'] = $exhaustiveNbHits; + + return $this; + } + + /** + * Gets exhaustiveTypo + * + * @return bool + */ + public function getExhaustiveTypo() + { + return $this->container['exhaustiveTypo']; + } + + /** + * Sets exhaustiveTypo + * + * @param bool $exhaustiveTypo Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * + * @return self + */ + public function setExhaustiveTypo($exhaustiveTypo) + { + $this->container['exhaustiveTypo'] = $exhaustiveTypo; + + return $this; + } + + /** + * Gets facets + * + * @return array>|null + */ + public function getFacets() + { + return $this->container['facets']; + } + + /** + * Sets facets + * + * @param array>|null $facets A mapping of each facet name to the corresponding facet counts. + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets facetsStats + * + * @return array|null + */ + public function getFacetsStats() + { + return $this->container['facetsStats']; + } + + /** + * Sets facetsStats + * + * @param array|null $facetsStats Statistics for numerical facets. + * + * @return self + */ + public function setFacetsStats($facetsStats) + { + $this->container['facetsStats'] = $facetsStats; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int $hitsPerPage Set the number of hits per page. + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets index + * + * @return string|null + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param string|null $index Index name used for the query. + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets indexUsed + * + * @return string|null + */ + public function getIndexUsed() + { + return $this->container['indexUsed']; + } + + /** + * Sets indexUsed + * + * @param string|null $indexUsed Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. + * + * @return self + */ + public function setIndexUsed($indexUsed) + { + $this->container['indexUsed'] = $indexUsed; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message Used to return warnings about the query. + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits']; + } + + /** + * Sets nbHits + * + * @param int $nbHits Number of hits that the search query matched. + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets nbPages + * + * @return int + */ + public function getNbPages() + { + return $this->container['nbPages']; + } + + /** + * Sets nbPages + * + * @param int $nbPages Number of pages available for the current query + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + + /** + * Gets nbSortedHits + * + * @return int|null + */ + public function getNbSortedHits() + { + return $this->container['nbSortedHits']; + } + + /** + * Sets nbSortedHits + * + * @param int|null $nbSortedHits The number of hits selected and sorted by the relevant sort algorithm + * + * @return self + */ + public function setNbSortedHits($nbSortedHits) + { + $this->container['nbSortedHits'] = $nbSortedHits; + + return $this; + } + + /** + * Gets page + * + * @return int + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int $page Specify the page to retrieve. + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets params + * + * @return string + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param string $params A url-encoded string of all search parameters. + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets parsedQuery + * + * @return string|null + */ + public function getParsedQuery() + { + return $this->container['parsedQuery']; + } + + /** + * Sets parsedQuery + * + * @param string|null $parsedQuery The query string that will be searched, after normalization. + * + * @return self + */ + public function setParsedQuery($parsedQuery) + { + $this->container['parsedQuery'] = $parsedQuery; + + return $this; + } + + /** + * Gets processingTimeMS + * + * @return int + */ + public function getProcessingTimeMS() + { + return $this->container['processingTimeMS']; + } + + /** + * Sets processingTimeMS + * + * @param int $processingTimeMS Time the server took to process the request, in milliseconds. + * + * @return self + */ + public function setProcessingTimeMS($processingTimeMS) + { + $this->container['processingTimeMS'] = $processingTimeMS; + + return $this; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query The text to search in the index. + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets queryAfterRemoval + * + * @return string|null + */ + public function getQueryAfterRemoval() + { + return $this->container['queryAfterRemoval']; + } + + /** + * Sets queryAfterRemoval + * + * @param string|null $queryAfterRemoval A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. + * + * @return self + */ + public function setQueryAfterRemoval($queryAfterRemoval) + { + $this->container['queryAfterRemoval'] = $queryAfterRemoval; + + return $this; + } + + /** + * Gets serverUsed + * + * @return string|null + */ + public function getServerUsed() + { + return $this->container['serverUsed']; + } + + /** + * Sets serverUsed + * + * @param string|null $serverUsed Actual host name of the server that processed the request. + * + * @return self + */ + public function setServerUsed($serverUsed) + { + $this->container['serverUsed'] = $serverUsed; + + return $this; + } + + /** + * Gets userData + * + * @return array|null + */ + public function getUserData() + { + return $this->container['userData']; + } + + /** + * Sets userData + * + * @param array|null $userData Lets you store custom data in your indices. + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php b/clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php new file mode 100644 index 0000000000..fb78c548dc --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php @@ -0,0 +1,410 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseSearchResponseFacetsStats implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'baseSearchResponse_facets_stats'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'min' => 'int', + 'max' => 'int', + 'avg' => 'int', + 'sum' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'min' => null, + 'max' => null, + 'avg' => null, + 'sum' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'min' => 'min', + 'max' => 'max', + 'avg' => 'avg', + 'sum' => 'sum' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'min' => 'setMin', + 'max' => 'setMax', + 'avg' => 'setAvg', + 'sum' => 'setSum' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'min' => 'getMin', + 'max' => 'getMax', + 'avg' => 'getAvg', + 'sum' => 'getSum' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['min'] = $data['min'] ?? null; + $this->container['max'] = $data['max'] ?? null; + $this->container['avg'] = $data['avg'] ?? null; + $this->container['sum'] = $data['sum'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 min + * + * @return int|null + */ + public function getMin() + { + return $this->container['min']; + } + + /** + * Sets min + * + * @param int|null $min The minimum value in the result set. + * + * @return self + */ + public function setMin($min) + { + $this->container['min'] = $min; + + return $this; + } + + /** + * Gets max + * + * @return int|null + */ + public function getMax() + { + return $this->container['max']; + } + + /** + * Sets max + * + * @param int|null $max The maximum value in the result set. + * + * @return self + */ + public function setMax($max) + { + $this->container['max'] = $max; + + return $this; + } + + /** + * Gets avg + * + * @return int|null + */ + public function getAvg() + { + return $this->container['avg']; + } + + /** + * Sets avg + * + * @param int|null $avg The average facet value in the result set. + * + * @return self + */ + public function setAvg($avg) + { + $this->container['avg'] = $avg; + + return $this; + } + + /** + * Gets sum + * + * @return int|null + */ + public function getSum() + { + return $this->container['sum']; + } + + /** + * Sets sum + * + * @param int|null $sum The sum of all values in the result set. + * + * @return self + */ + public function setSum($sum) + { + $this->container['sum'] = $sum; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php b/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php new file mode 100644 index 0000000000..9939f1015d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php @@ -0,0 +1,357 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BatchAssignUserIdsObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'batchAssignUserIdsObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cluster' => 'string', + 'users' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cluster' => null, + 'users' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cluster' => 'cluster', + 'users' => 'users' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cluster' => 'setCluster', + 'users' => 'setUsers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cluster' => 'getCluster', + 'users' => 'getUsers' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['cluster'] = $data['cluster'] ?? null; + $this->container['users'] = $data['users'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['cluster'] === null) { + $invalidProperties[] = "'cluster' can't be null"; + } + if ($this->container['users'] === null) { + $invalidProperties[] = "'users' 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 cluster + * + * @return string + */ + public function getCluster() + { + return $this->container['cluster']; + } + + /** + * Sets cluster + * + * @param string $cluster Name of the cluster. + * + * @return self + */ + public function setCluster($cluster) + { + $this->container['cluster'] = $cluster; + + return $this; + } + + /** + * Gets users + * + * @return string[] + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param string[] $users userIDs to assign. Note you cannot move users with this method. + * + * @return self + */ + public function setUsers($users) + { + $this->container['users'] = $users; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntries.php b/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntries.php new file mode 100644 index 0000000000..c9ca304c73 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntries.php @@ -0,0 +1,354 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BatchDictionaryEntries implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'batchDictionaryEntries'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'clearExistingDictionaryEntries' => 'bool', + 'requests' => '\Algolia\AlgoliaSearch\Model\BatchDictionaryEntriesRequest[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'clearExistingDictionaryEntries' => null, + 'requests' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'clearExistingDictionaryEntries' => 'clearExistingDictionaryEntries', + 'requests' => 'requests' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'clearExistingDictionaryEntries' => 'setClearExistingDictionaryEntries', + 'requests' => 'setRequests' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'clearExistingDictionaryEntries' => 'getClearExistingDictionaryEntries', + 'requests' => 'getRequests' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['clearExistingDictionaryEntries'] = $data['clearExistingDictionaryEntries'] ?? false; + $this->container['requests'] = $data['requests'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['requests'] === null) { + $invalidProperties[] = "'requests' 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 clearExistingDictionaryEntries + * + * @return bool|null + */ + public function getClearExistingDictionaryEntries() + { + return $this->container['clearExistingDictionaryEntries']; + } + + /** + * Sets clearExistingDictionaryEntries + * + * @param bool|null $clearExistingDictionaryEntries When `true`, start the batch by removing all the custom entries from the dictionary. + * + * @return self + */ + public function setClearExistingDictionaryEntries($clearExistingDictionaryEntries) + { + $this->container['clearExistingDictionaryEntries'] = $clearExistingDictionaryEntries; + + return $this; + } + + /** + * Gets requests + * + * @return \Algolia\AlgoliaSearch\Model\BatchDictionaryEntriesRequest[] + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\BatchDictionaryEntriesRequest[] $requests List of operations to batch. Each operation is described by an `action` and a `body`. + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php b/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php new file mode 100644 index 0000000000..8e4b221878 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php @@ -0,0 +1,390 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BatchDictionaryEntriesRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'batchDictionaryEntriesRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'action' => 'string', + 'body' => '\Algolia\AlgoliaSearch\Model\DictionaryEntry' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'action' => null, + 'body' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'action' => 'action', + 'body' => 'body' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction', + 'body' => 'setBody' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction', + 'body' => 'getBody' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const ACTION_ADD_ENTRY = 'addEntry'; + const ACTION_DELETE_ENTRY = 'deleteEntry'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getActionAllowableValues() + { + return [ + self::ACTION_ADD_ENTRY, + self::ACTION_DELETE_ENTRY, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['action'] = $data['action'] ?? null; + $this->container['body'] = $data['body'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['action'] === null) { + $invalidProperties[] = "'action' can't be null"; + } + $allowedValues = $this->getActionAllowableValues(); + if (!is_null($this->container['action']) && !in_array($this->container['action'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'action', must be one of '%s'", + $this->container['action'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['body'] === null) { + $invalidProperties[] = "'body' 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 action + * + * @return string + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string $action Actions to perform. + * + * @return self + */ + public function setAction($action) + { + $allowedValues = $this->getActionAllowableValues(); + if (!in_array($action, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'action', must be one of '%s'", + $action, + implode("', '", $allowedValues) + ) + ); + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets body + * + * @return \Algolia\AlgoliaSearch\Model\DictionaryEntry + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * + * @param \Algolia\AlgoliaSearch\Model\DictionaryEntry $body body + * + * @return self + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/BatchObject.php b/clients/algoliasearch-client-php/lib/Model/BatchObject.php new file mode 100644 index 0000000000..248a8ba594 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BatchObject.php @@ -0,0 +1,321 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BatchObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'batchObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'requests' => '\Algolia\AlgoliaSearch\Model\Operation[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'requests' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'requests' => 'requests' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['requests'] = $data['requests'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 requests + * + * @return \Algolia\AlgoliaSearch\Model\Operation[]|null + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\Operation[]|null $requests requests + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/BatchResponse.php b/clients/algoliasearch-client-php/lib/Model/BatchResponse.php new file mode 100644 index 0000000000..b77b09a47e --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BatchResponse.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BatchResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'batchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'taskID' => 'int', + 'objectIDs' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'taskID' => null, + 'objectIDs' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'taskID' => 'taskID', + 'objectIDs' => 'objectIDs' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'taskID' => 'setTaskID', + 'objectIDs' => 'setObjectIDs' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'taskID' => 'getTaskID', + 'objectIDs' => 'getObjectIDs' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['taskID'] = $data['taskID'] ?? null; + $this->container['objectIDs'] = $data['objectIDs'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 taskID + * + * @return int|null + */ + public function getTaskID() + { + return $this->container['taskID']; + } + + /** + * Sets taskID + * + * @param int|null $taskID taskID of the indexing task to wait for. + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + + /** + * Gets objectIDs + * + * @return string[]|null + */ + public function getObjectIDs() + { + return $this->container['objectIDs']; + } + + /** + * Sets objectIDs + * + * @param string[]|null $objectIDs List of objectID. + * + * @return self + */ + public function setObjectIDs($objectIDs) + { + $this->container['objectIDs'] = $objectIDs; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php b/clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php new file mode 100644 index 0000000000..3e8118482f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php @@ -0,0 +1,321 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BatchWriteObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'batchWriteObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'requests' => '\Algolia\AlgoliaSearch\Model\Operation[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'requests' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'requests' => 'requests' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['requests'] = $data['requests'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 requests + * + * @return \Algolia\AlgoliaSearch\Model\Operation[]|null + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\Operation[]|null $requests requests + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/BrowseRequest.php b/clients/algoliasearch-client-php/lib/Model/BrowseRequest.php new file mode 100644 index 0000000000..2e256bb0c1 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BrowseRequest.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BrowseRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'browseRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'params' => 'string', + 'cursor' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'params' => null, + 'cursor' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'params' => 'params', + 'cursor' => 'cursor' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'params' => 'setParams', + 'cursor' => 'setCursor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'params' => 'getParams', + 'cursor' => 'getCursor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['params'] = $data['params'] ?? ''; + $this->container['cursor'] = $data['cursor'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 params + * + * @return string|null + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param string|null $params Search parameters as URL-encoded query string. + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets cursor + * + * @return string|null + */ + public function getCursor() + { + return $this->container['cursor']; + } + + /** + * Sets cursor + * + * @param string|null $cursor Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. + * + * @return self + */ + public function setCursor($cursor) + { + $this->container['cursor'] = $cursor; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php b/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php new file mode 100644 index 0000000000..d6907dde12 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php @@ -0,0 +1,1112 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BrowseResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'browseResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'abTestID' => 'int', + 'abTestVariantID' => 'int', + 'aroundLatLng' => 'string', + 'automaticRadius' => 'string', + 'exhaustiveFacetsCount' => 'bool', + 'exhaustiveNbHits' => 'bool', + 'exhaustiveTypo' => 'bool', + 'facets' => 'array>', + 'facetsStats' => 'array', + 'hitsPerPage' => 'int', + 'index' => 'string', + 'indexUsed' => 'string', + 'message' => 'string', + 'nbHits' => 'int', + 'nbPages' => 'int', + 'nbSortedHits' => 'int', + 'page' => 'int', + 'params' => 'string', + 'parsedQuery' => 'string', + 'processingTimeMS' => 'int', + 'query' => 'string', + 'queryAfterRemoval' => 'string', + 'serverUsed' => 'string', + 'userData' => 'array', + 'hits' => '\Algolia\AlgoliaSearch\Model\Record[]', + 'cursor' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'abTestID' => null, + 'abTestVariantID' => null, + 'aroundLatLng' => null, + 'automaticRadius' => null, + 'exhaustiveFacetsCount' => null, + 'exhaustiveNbHits' => null, + 'exhaustiveTypo' => null, + 'facets' => null, + 'facetsStats' => null, + 'hitsPerPage' => null, + 'index' => null, + 'indexUsed' => null, + 'message' => null, + 'nbHits' => null, + 'nbPages' => null, + 'nbSortedHits' => null, + 'page' => null, + 'params' => null, + 'parsedQuery' => null, + 'processingTimeMS' => null, + 'query' => null, + 'queryAfterRemoval' => null, + 'serverUsed' => null, + 'userData' => null, + 'hits' => null, + 'cursor' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'abTestID' => 'abTestID', + 'abTestVariantID' => 'abTestVariantID', + 'aroundLatLng' => 'aroundLatLng', + 'automaticRadius' => 'automaticRadius', + 'exhaustiveFacetsCount' => 'exhaustiveFacetsCount', + 'exhaustiveNbHits' => 'exhaustiveNbHits', + 'exhaustiveTypo' => 'exhaustiveTypo', + 'facets' => 'facets', + 'facetsStats' => 'facets_stats', + 'hitsPerPage' => 'hitsPerPage', + 'index' => 'index', + 'indexUsed' => 'indexUsed', + 'message' => 'message', + 'nbHits' => 'nbHits', + 'nbPages' => 'nbPages', + 'nbSortedHits' => 'nbSortedHits', + 'page' => 'page', + 'params' => 'params', + 'parsedQuery' => 'parsedQuery', + 'processingTimeMS' => 'processingTimeMS', + 'query' => 'query', + 'queryAfterRemoval' => 'queryAfterRemoval', + 'serverUsed' => 'serverUsed', + 'userData' => 'userData', + 'hits' => 'hits', + 'cursor' => 'cursor' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abTestID' => 'setAbTestID', + 'abTestVariantID' => 'setAbTestVariantID', + 'aroundLatLng' => 'setAroundLatLng', + 'automaticRadius' => 'setAutomaticRadius', + 'exhaustiveFacetsCount' => 'setExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'setExhaustiveNbHits', + 'exhaustiveTypo' => 'setExhaustiveTypo', + 'facets' => 'setFacets', + 'facetsStats' => 'setFacetsStats', + 'hitsPerPage' => 'setHitsPerPage', + 'index' => 'setIndex', + 'indexUsed' => 'setIndexUsed', + 'message' => 'setMessage', + 'nbHits' => 'setNbHits', + 'nbPages' => 'setNbPages', + 'nbSortedHits' => 'setNbSortedHits', + 'page' => 'setPage', + 'params' => 'setParams', + 'parsedQuery' => 'setParsedQuery', + 'processingTimeMS' => 'setProcessingTimeMS', + 'query' => 'setQuery', + 'queryAfterRemoval' => 'setQueryAfterRemoval', + 'serverUsed' => 'setServerUsed', + 'userData' => 'setUserData', + 'hits' => 'setHits', + 'cursor' => 'setCursor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abTestID' => 'getAbTestID', + 'abTestVariantID' => 'getAbTestVariantID', + 'aroundLatLng' => 'getAroundLatLng', + 'automaticRadius' => 'getAutomaticRadius', + 'exhaustiveFacetsCount' => 'getExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'getExhaustiveNbHits', + 'exhaustiveTypo' => 'getExhaustiveTypo', + 'facets' => 'getFacets', + 'facetsStats' => 'getFacetsStats', + 'hitsPerPage' => 'getHitsPerPage', + 'index' => 'getIndex', + 'indexUsed' => 'getIndexUsed', + 'message' => 'getMessage', + 'nbHits' => 'getNbHits', + 'nbPages' => 'getNbPages', + 'nbSortedHits' => 'getNbSortedHits', + 'page' => 'getPage', + 'params' => 'getParams', + 'parsedQuery' => 'getParsedQuery', + 'processingTimeMS' => 'getProcessingTimeMS', + 'query' => 'getQuery', + 'queryAfterRemoval' => 'getQueryAfterRemoval', + 'serverUsed' => 'getServerUsed', + 'userData' => 'getUserData', + 'hits' => 'getHits', + 'cursor' => 'getCursor' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['abTestID'] = $data['abTestID'] ?? null; + $this->container['abTestVariantID'] = $data['abTestVariantID'] ?? null; + $this->container['aroundLatLng'] = $data['aroundLatLng'] ?? null; + $this->container['automaticRadius'] = $data['automaticRadius'] ?? null; + $this->container['exhaustiveFacetsCount'] = $data['exhaustiveFacetsCount'] ?? null; + $this->container['exhaustiveNbHits'] = $data['exhaustiveNbHits'] ?? null; + $this->container['exhaustiveTypo'] = $data['exhaustiveTypo'] ?? null; + $this->container['facets'] = $data['facets'] ?? null; + $this->container['facetsStats'] = $data['facetsStats'] ?? null; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['index'] = $data['index'] ?? null; + $this->container['indexUsed'] = $data['indexUsed'] ?? null; + $this->container['message'] = $data['message'] ?? null; + $this->container['nbHits'] = $data['nbHits'] ?? null; + $this->container['nbPages'] = $data['nbPages'] ?? null; + $this->container['nbSortedHits'] = $data['nbSortedHits'] ?? null; + $this->container['page'] = $data['page'] ?? 0; + $this->container['params'] = $data['params'] ?? null; + $this->container['parsedQuery'] = $data['parsedQuery'] ?? null; + $this->container['processingTimeMS'] = $data['processingTimeMS'] ?? null; + $this->container['query'] = $data['query'] ?? ''; + $this->container['queryAfterRemoval'] = $data['queryAfterRemoval'] ?? null; + $this->container['serverUsed'] = $data['serverUsed'] ?? null; + $this->container['userData'] = $data['userData'] ?? null; + $this->container['hits'] = $data['hits'] ?? null; + $this->container['cursor'] = $data['cursor'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['aroundLatLng']) && !preg_match("/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/", $this->container['aroundLatLng'])) { + $invalidProperties[] = "invalid value for 'aroundLatLng', must be conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."; + } + + if ($this->container['exhaustiveNbHits'] === null) { + $invalidProperties[] = "'exhaustiveNbHits' can't be null"; + } + if ($this->container['exhaustiveTypo'] === null) { + $invalidProperties[] = "'exhaustiveTypo' can't be null"; + } + if ($this->container['hitsPerPage'] === null) { + $invalidProperties[] = "'hitsPerPage' can't be null"; + } + if ($this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if ($this->container['nbPages'] === null) { + $invalidProperties[] = "'nbPages' can't be null"; + } + if ($this->container['page'] === null) { + $invalidProperties[] = "'page' can't be null"; + } + if ($this->container['params'] === null) { + $invalidProperties[] = "'params' can't be null"; + } + if ($this->container['processingTimeMS'] === null) { + $invalidProperties[] = "'processingTimeMS' can't be null"; + } + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + if ($this->container['hits'] === null) { + $invalidProperties[] = "'hits' can't be null"; + } + if ($this->container['cursor'] === null) { + $invalidProperties[] = "'cursor' 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 abTestID + * + * @return int|null + */ + public function getAbTestID() + { + return $this->container['abTestID']; + } + + /** + * Sets abTestID + * + * @param int|null $abTestID If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID. + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets abTestVariantID + * + * @return int|null + */ + public function getAbTestVariantID() + { + return $this->container['abTestVariantID']; + } + + /** + * Sets abTestVariantID + * + * @param int|null $abTestVariantID If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used. + * + * @return self + */ + public function setAbTestVariantID($abTestVariantID) + { + $this->container['abTestVariantID'] = $abTestVariantID; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng']; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng The computed geo location. + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + + if (!is_null($aroundLatLng) && (!preg_match("/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/", $aroundLatLng))) { + throw new \InvalidArgumentException("invalid value for $aroundLatLng when calling BrowseResponse., must conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."); + } + + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets automaticRadius + * + * @return string|null + */ + public function getAutomaticRadius() + { + return $this->container['automaticRadius']; + } + + /** + * Sets automaticRadius + * + * @param string|null $automaticRadius The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. + * + * @return self + */ + public function setAutomaticRadius($automaticRadius) + { + $this->container['automaticRadius'] = $automaticRadius; + + return $this; + } + + /** + * Gets exhaustiveFacetsCount + * + * @return bool|null + */ + public function getExhaustiveFacetsCount() + { + return $this->container['exhaustiveFacetsCount']; + } + + /** + * Sets exhaustiveFacetsCount + * + * @param bool|null $exhaustiveFacetsCount Whether the facet count is exhaustive or approximate. + * + * @return self + */ + public function setExhaustiveFacetsCount($exhaustiveFacetsCount) + { + $this->container['exhaustiveFacetsCount'] = $exhaustiveFacetsCount; + + return $this; + } + + /** + * Gets exhaustiveNbHits + * + * @return bool + */ + public function getExhaustiveNbHits() + { + return $this->container['exhaustiveNbHits']; + } + + /** + * Sets exhaustiveNbHits + * + * @param bool $exhaustiveNbHits Indicate if the nbHits count was exhaustive or approximate + * + * @return self + */ + public function setExhaustiveNbHits($exhaustiveNbHits) + { + $this->container['exhaustiveNbHits'] = $exhaustiveNbHits; + + return $this; + } + + /** + * Gets exhaustiveTypo + * + * @return bool + */ + public function getExhaustiveTypo() + { + return $this->container['exhaustiveTypo']; + } + + /** + * Sets exhaustiveTypo + * + * @param bool $exhaustiveTypo Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * + * @return self + */ + public function setExhaustiveTypo($exhaustiveTypo) + { + $this->container['exhaustiveTypo'] = $exhaustiveTypo; + + return $this; + } + + /** + * Gets facets + * + * @return array>|null + */ + public function getFacets() + { + return $this->container['facets']; + } + + /** + * Sets facets + * + * @param array>|null $facets A mapping of each facet name to the corresponding facet counts. + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets facetsStats + * + * @return array|null + */ + public function getFacetsStats() + { + return $this->container['facetsStats']; + } + + /** + * Sets facetsStats + * + * @param array|null $facetsStats Statistics for numerical facets. + * + * @return self + */ + public function setFacetsStats($facetsStats) + { + $this->container['facetsStats'] = $facetsStats; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int $hitsPerPage Set the number of hits per page. + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets index + * + * @return string|null + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param string|null $index Index name used for the query. + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets indexUsed + * + * @return string|null + */ + public function getIndexUsed() + { + return $this->container['indexUsed']; + } + + /** + * Sets indexUsed + * + * @param string|null $indexUsed Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. + * + * @return self + */ + public function setIndexUsed($indexUsed) + { + $this->container['indexUsed'] = $indexUsed; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message Used to return warnings about the query. + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits']; + } + + /** + * Sets nbHits + * + * @param int $nbHits Number of hits that the search query matched. + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets nbPages + * + * @return int + */ + public function getNbPages() + { + return $this->container['nbPages']; + } + + /** + * Sets nbPages + * + * @param int $nbPages Number of pages available for the current query + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + + /** + * Gets nbSortedHits + * + * @return int|null + */ + public function getNbSortedHits() + { + return $this->container['nbSortedHits']; + } + + /** + * Sets nbSortedHits + * + * @param int|null $nbSortedHits The number of hits selected and sorted by the relevant sort algorithm + * + * @return self + */ + public function setNbSortedHits($nbSortedHits) + { + $this->container['nbSortedHits'] = $nbSortedHits; + + return $this; + } + + /** + * Gets page + * + * @return int + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int $page Specify the page to retrieve. + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets params + * + * @return string + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param string $params A url-encoded string of all search parameters. + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets parsedQuery + * + * @return string|null + */ + public function getParsedQuery() + { + return $this->container['parsedQuery']; + } + + /** + * Sets parsedQuery + * + * @param string|null $parsedQuery The query string that will be searched, after normalization. + * + * @return self + */ + public function setParsedQuery($parsedQuery) + { + $this->container['parsedQuery'] = $parsedQuery; + + return $this; + } + + /** + * Gets processingTimeMS + * + * @return int + */ + public function getProcessingTimeMS() + { + return $this->container['processingTimeMS']; + } + + /** + * Sets processingTimeMS + * + * @param int $processingTimeMS Time the server took to process the request, in milliseconds. + * + * @return self + */ + public function setProcessingTimeMS($processingTimeMS) + { + $this->container['processingTimeMS'] = $processingTimeMS; + + return $this; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query The text to search in the index. + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets queryAfterRemoval + * + * @return string|null + */ + public function getQueryAfterRemoval() + { + return $this->container['queryAfterRemoval']; + } + + /** + * Sets queryAfterRemoval + * + * @param string|null $queryAfterRemoval A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. + * + * @return self + */ + public function setQueryAfterRemoval($queryAfterRemoval) + { + $this->container['queryAfterRemoval'] = $queryAfterRemoval; + + return $this; + } + + /** + * Gets serverUsed + * + * @return string|null + */ + public function getServerUsed() + { + return $this->container['serverUsed']; + } + + /** + * Sets serverUsed + * + * @param string|null $serverUsed Actual host name of the server that processed the request. + * + * @return self + */ + public function setServerUsed($serverUsed) + { + $this->container['serverUsed'] = $serverUsed; + + return $this; + } + + /** + * Gets userData + * + * @return array|null + */ + public function getUserData() + { + return $this->container['userData']; + } + + /** + * Sets userData + * + * @param array|null $userData Lets you store custom data in your indices. + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + + /** + * Gets hits + * + * @return \Algolia\AlgoliaSearch\Model\Record[] + */ + public function getHits() + { + return $this->container['hits']; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Record[] $hits hits + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + + /** + * Gets cursor + * + * @return string + */ + public function getCursor() + { + return $this->container['cursor']; + } + + /** + * Sets cursor + * + * @param string $cursor Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. + * + * @return self + */ + public function setCursor($cursor) + { + $this->container['cursor'] = $cursor; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/BuildInOperation.php b/clients/algoliasearch-client-php/lib/Model/BuildInOperation.php new file mode 100644 index 0000000000..df6817f512 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BuildInOperation.php @@ -0,0 +1,401 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BuildInOperation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'buildInOperation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => '_operation', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const OPERATION_INCREMENT = 'Increment'; + const OPERATION_DECREMENT = 'Decrement'; + const OPERATION_ADD = 'Add'; + const OPERATION_REMOVE = 'Remove'; + const OPERATION_ADD_UNIQUE = 'AddUnique'; + const OPERATION_INCREMENT_FROM = 'IncrementFrom'; + const OPERATION_INCREMENT_SET = 'IncrementSet'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getOperationAllowableValues() + { + return [ + self::OPERATION_INCREMENT, + self::OPERATION_DECREMENT, + self::OPERATION_ADD, + self::OPERATION_REMOVE, + self::OPERATION_ADD_UNIQUE, + self::OPERATION_INCREMENT_FROM, + self::OPERATION_INCREMENT_SET, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['operation'] = $data['operation'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' can't be null"; + } + $allowedValues = $this->getOperationAllowableValues(); + if (!is_null($this->container['operation']) && !in_array($this->container['operation'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'operation', must be one of '%s'", + $this->container['operation'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation The operation to apply on the attribute. + * + * @return self + */ + public function setOperation($operation) + { + $allowedValues = $this->getOperationAllowableValues(); + if (!in_array($operation, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'operation', must be one of '%s'", + $operation, + implode("', '", $allowedValues) + ) + ); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove. + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/Condition.php b/clients/algoliasearch-client-php/lib/Model/Condition.php new file mode 100644 index 0000000000..42f3485a1f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Condition.php @@ -0,0 +1,410 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Condition implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'condition'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'pattern' => 'string', + 'anchoring' => '\Algolia\AlgoliaSearch\Model\Anchoring', + 'alternatives' => 'bool', + 'context' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'pattern' => null, + 'anchoring' => null, + 'alternatives' => null, + 'context' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'pattern' => 'pattern', + 'anchoring' => 'anchoring', + 'alternatives' => 'alternatives', + 'context' => 'context' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pattern' => 'setPattern', + 'anchoring' => 'setAnchoring', + 'alternatives' => 'setAlternatives', + 'context' => 'setContext' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pattern' => 'getPattern', + 'anchoring' => 'getAnchoring', + 'alternatives' => 'getAlternatives', + 'context' => 'getContext' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['pattern'] = $data['pattern'] ?? null; + $this->container['anchoring'] = $data['anchoring'] ?? null; + $this->container['alternatives'] = $data['alternatives'] ?? false; + $this->container['context'] = $data['context'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 pattern + * + * @return string|null + */ + public function getPattern() + { + return $this->container['pattern']; + } + + /** + * Sets pattern + * + * @param string|null $pattern Query pattern syntax + * + * @return self + */ + public function setPattern($pattern) + { + $this->container['pattern'] = $pattern; + + return $this; + } + + /** + * Gets anchoring + * + * @return \Algolia\AlgoliaSearch\Model\Anchoring|null + */ + public function getAnchoring() + { + return $this->container['anchoring']; + } + + /** + * Sets anchoring + * + * @param \Algolia\AlgoliaSearch\Model\Anchoring|null $anchoring anchoring + * + * @return self + */ + public function setAnchoring($anchoring) + { + $this->container['anchoring'] = $anchoring; + + return $this; + } + + /** + * Gets alternatives + * + * @return bool|null + */ + public function getAlternatives() + { + return $this->container['alternatives']; + } + + /** + * Sets alternatives + * + * @param bool|null $alternatives Whether the pattern matches on plurals, synonyms, and typos. + * + * @return self + */ + public function setAlternatives($alternatives) + { + $this->container['alternatives'] = $alternatives; + + return $this; + } + + /** + * Gets context + * + * @return string|null + */ + public function getContext() + { + return $this->container['context']; + } + + /** + * Sets context + * + * @param string|null $context Rule context format: [A-Za-z0-9_-]+). + * + * @return self + */ + public function setContext($context) + { + $this->container['context'] = $context; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/Consequence.php b/clients/algoliasearch-client-php/lib/Model/Consequence.php new file mode 100644 index 0000000000..806b66a146 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Consequence.php @@ -0,0 +1,441 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Consequence implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'consequence'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'params' => '\Algolia\AlgoliaSearch\Model\ConsequenceParams', + 'promote' => '\Algolia\AlgoliaSearch\Model\Promote[]', + 'filterPromotes' => 'bool', + 'hide' => '\Algolia\AlgoliaSearch\Model\ConsequenceHide[]', + 'userData' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'params' => null, + 'promote' => null, + 'filterPromotes' => null, + 'hide' => null, + 'userData' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'params' => 'params', + 'promote' => 'promote', + 'filterPromotes' => 'filterPromotes', + 'hide' => 'hide', + 'userData' => 'userData' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'params' => 'setParams', + 'promote' => 'setPromote', + 'filterPromotes' => 'setFilterPromotes', + 'hide' => 'setHide', + 'userData' => 'setUserData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'params' => 'getParams', + 'promote' => 'getPromote', + 'filterPromotes' => 'getFilterPromotes', + 'hide' => 'getHide', + 'userData' => 'getUserData' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['params'] = $data['params'] ?? null; + $this->container['promote'] = $data['promote'] ?? null; + $this->container['filterPromotes'] = $data['filterPromotes'] ?? false; + $this->container['hide'] = $data['hide'] ?? null; + $this->container['userData'] = $data['userData'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 params + * + * @return \Algolia\AlgoliaSearch\Model\ConsequenceParams|null + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param \Algolia\AlgoliaSearch\Model\ConsequenceParams|null $params params + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets promote + * + * @return \Algolia\AlgoliaSearch\Model\Promote[]|null + */ + public function getPromote() + { + return $this->container['promote']; + } + + /** + * Sets promote + * + * @param \Algolia\AlgoliaSearch\Model\Promote[]|null $promote Objects to promote as hits. + * + * @return self + */ + public function setPromote($promote) + { + $this->container['promote'] = $promote; + + return $this; + } + + /** + * Gets filterPromotes + * + * @return bool|null + */ + public function getFilterPromotes() + { + return $this->container['filterPromotes']; + } + + /** + * Sets filterPromotes + * + * @param bool|null $filterPromotes Only use in combination with the promote consequence. When true, promoted results will be restricted to match the filters of the current search. When false, the promoted results will show up regardless of the filters. + * + * @return self + */ + public function setFilterPromotes($filterPromotes) + { + $this->container['filterPromotes'] = $filterPromotes; + + return $this; + } + + /** + * Gets hide + * + * @return \Algolia\AlgoliaSearch\Model\ConsequenceHide[]|null + */ + public function getHide() + { + return $this->container['hide']; + } + + /** + * Sets hide + * + * @param \Algolia\AlgoliaSearch\Model\ConsequenceHide[]|null $hide Objects to hide from hits. Each object must contain an objectID field. By default, you can hide up to 50 items per rule. + * + * @return self + */ + public function setHide($hide) + { + $this->container['hide'] = $hide; + + return $this; + } + + /** + * Gets userData + * + * @return array|null + */ + public function getUserData() + { + return $this->container['userData']; + } + + /** + * Sets userData + * + * @param array|null $userData Custom JSON object that will be appended to the userData array in the response. This object isn't interpreted by the API. It's limited to 1kB of minified JSON. + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php b/clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php new file mode 100644 index 0000000000..b39c4de520 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php @@ -0,0 +1,324 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ConsequenceHide implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'consequence_hide'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'objectID' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'objectID' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'objectID' => 'objectID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['objectID'] = $data['objectID'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' 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 objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string $objectID Unique identifier of the object. + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/ConsequenceParams.php b/clients/algoliasearch-client-php/lib/Model/ConsequenceParams.php new file mode 100644 index 0000000000..3c4dbec7ff --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/ConsequenceParams.php @@ -0,0 +1,2924 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ConsequenceParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'consequenceParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'query' => 'string', + 'automaticFacetFilters' => '\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]', + 'automaticOptionalFacetFilters' => '\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]', + 'similarQuery' => 'string', + 'filters' => 'string', + 'facetFilters' => 'string[]', + 'optionalFilters' => 'string[]', + 'numericFilters' => 'string[]', + 'tagFilters' => 'string[]', + 'sumOrFiltersScores' => 'bool', + 'facets' => 'string[]', + 'maxValuesPerFacet' => 'int', + 'facetingAfterDistinct' => 'bool', + 'sortFacetValuesBy' => 'string', + 'page' => 'int', + 'offset' => 'int', + 'length' => 'int', + 'aroundLatLng' => 'string', + 'aroundLatLngViaIP' => 'bool', + 'aroundRadius' => 'OneOfIntegerString', + 'aroundPrecision' => 'int', + 'minimumAroundRadius' => 'int', + 'insideBoundingBox' => 'float[]', + 'insidePolygon' => 'float[]', + 'naturalLanguages' => 'string[]', + 'ruleContexts' => 'string[]', + 'personalizationImpact' => 'int', + 'userToken' => 'string', + 'getRankingInfo' => 'bool', + 'clickAnalytics' => 'bool', + 'analytics' => 'bool', + 'analyticsTags' => 'string[]', + 'percentileComputation' => 'bool', + 'enableABTest' => 'bool', + 'enableReRanking' => 'bool', + 'searchableAttributes' => 'string[]', + 'attributesForFaceting' => 'string[]', + 'unretrievableAttributes' => 'string[]', + 'attributesToRetrieve' => 'string[]', + 'restrictSearchableAttributes' => 'string[]', + 'ranking' => 'string[]', + 'customRanking' => 'string[]', + 'relevancyStrictness' => 'int', + 'attributesToHighlight' => 'string[]', + 'attributesToSnippet' => 'string[]', + 'highlightPreTag' => 'string', + 'highlightPostTag' => 'string', + 'snippetEllipsisText' => 'string', + 'restrictHighlightAndSnippetArrays' => 'bool', + 'hitsPerPage' => 'int', + 'minWordSizefor1Typo' => 'int', + 'minWordSizefor2Typos' => 'int', + 'typoTolerance' => 'string', + 'allowTyposOnNumericTokens' => 'bool', + 'disableTypoToleranceOnAttributes' => 'string[]', + 'separatorsToIndex' => 'string', + 'ignorePlurals' => 'string', + 'removeStopWords' => 'string', + 'keepDiacriticsOnCharacters' => 'string', + 'queryLanguages' => 'string[]', + 'decompoundQuery' => 'bool', + 'enableRules' => 'bool', + 'enablePersonalization' => 'bool', + 'queryType' => 'string', + 'removeWordsIfNoResults' => 'string', + 'advancedSyntax' => 'bool', + 'optionalWords' => 'string[]', + 'disableExactOnAttributes' => 'string[]', + 'exactOnSingleWordQuery' => 'string', + 'alternativesAsExact' => 'string[]', + 'advancedSyntaxFeatures' => 'string[]', + 'distinct' => 'int', + 'synonyms' => 'bool', + 'replaceSynonymsInHighlight' => 'bool', + 'minProximity' => 'int', + 'responseFields' => 'string[]', + 'maxFacetHits' => 'int', + 'attributeCriteriaComputedByMinProximity' => 'bool', + 'renderingContent' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'query' => null, + 'automaticFacetFilters' => null, + 'automaticOptionalFacetFilters' => null, + 'similarQuery' => null, + 'filters' => null, + 'facetFilters' => null, + 'optionalFilters' => null, + 'numericFilters' => null, + 'tagFilters' => null, + 'sumOrFiltersScores' => null, + 'facets' => null, + 'maxValuesPerFacet' => null, + 'facetingAfterDistinct' => null, + 'sortFacetValuesBy' => null, + 'page' => null, + 'offset' => null, + 'length' => null, + 'aroundLatLng' => null, + 'aroundLatLngViaIP' => null, + 'aroundRadius' => null, + 'aroundPrecision' => null, + 'minimumAroundRadius' => null, + 'insideBoundingBox' => null, + 'insidePolygon' => null, + 'naturalLanguages' => null, + 'ruleContexts' => null, + 'personalizationImpact' => null, + 'userToken' => null, + 'getRankingInfo' => null, + 'clickAnalytics' => null, + 'analytics' => null, + 'analyticsTags' => null, + 'percentileComputation' => null, + 'enableABTest' => null, + 'enableReRanking' => null, + 'searchableAttributes' => null, + 'attributesForFaceting' => null, + 'unretrievableAttributes' => null, + 'attributesToRetrieve' => null, + 'restrictSearchableAttributes' => null, + 'ranking' => null, + 'customRanking' => null, + 'relevancyStrictness' => null, + 'attributesToHighlight' => null, + 'attributesToSnippet' => null, + 'highlightPreTag' => null, + 'highlightPostTag' => null, + 'snippetEllipsisText' => null, + 'restrictHighlightAndSnippetArrays' => null, + 'hitsPerPage' => null, + 'minWordSizefor1Typo' => null, + 'minWordSizefor2Typos' => null, + 'typoTolerance' => null, + 'allowTyposOnNumericTokens' => null, + 'disableTypoToleranceOnAttributes' => null, + 'separatorsToIndex' => null, + 'ignorePlurals' => null, + 'removeStopWords' => null, + 'keepDiacriticsOnCharacters' => null, + 'queryLanguages' => null, + 'decompoundQuery' => null, + 'enableRules' => null, + 'enablePersonalization' => null, + 'queryType' => null, + 'removeWordsIfNoResults' => null, + 'advancedSyntax' => null, + 'optionalWords' => null, + 'disableExactOnAttributes' => null, + 'exactOnSingleWordQuery' => null, + 'alternativesAsExact' => null, + 'advancedSyntaxFeatures' => null, + 'distinct' => null, + 'synonyms' => null, + 'replaceSynonymsInHighlight' => null, + 'minProximity' => null, + 'responseFields' => null, + 'maxFacetHits' => null, + 'attributeCriteriaComputedByMinProximity' => null, + 'renderingContent' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'query' => 'query', + 'automaticFacetFilters' => 'automaticFacetFilters', + 'automaticOptionalFacetFilters' => 'automaticOptionalFacetFilters', + 'similarQuery' => 'similarQuery', + 'filters' => 'filters', + 'facetFilters' => 'facetFilters', + 'optionalFilters' => 'optionalFilters', + 'numericFilters' => 'numericFilters', + 'tagFilters' => 'tagFilters', + 'sumOrFiltersScores' => 'sumOrFiltersScores', + 'facets' => 'facets', + 'maxValuesPerFacet' => 'maxValuesPerFacet', + 'facetingAfterDistinct' => 'facetingAfterDistinct', + 'sortFacetValuesBy' => 'sortFacetValuesBy', + 'page' => 'page', + 'offset' => 'offset', + 'length' => 'length', + 'aroundLatLng' => 'aroundLatLng', + 'aroundLatLngViaIP' => 'aroundLatLngViaIP', + 'aroundRadius' => 'aroundRadius', + 'aroundPrecision' => 'aroundPrecision', + 'minimumAroundRadius' => 'minimumAroundRadius', + 'insideBoundingBox' => 'insideBoundingBox', + 'insidePolygon' => 'insidePolygon', + 'naturalLanguages' => 'naturalLanguages', + 'ruleContexts' => 'ruleContexts', + 'personalizationImpact' => 'personalizationImpact', + 'userToken' => 'userToken', + 'getRankingInfo' => 'getRankingInfo', + 'clickAnalytics' => 'clickAnalytics', + 'analytics' => 'analytics', + 'analyticsTags' => 'analyticsTags', + 'percentileComputation' => 'percentileComputation', + 'enableABTest' => 'enableABTest', + 'enableReRanking' => 'enableReRanking', + 'searchableAttributes' => 'searchableAttributes', + 'attributesForFaceting' => 'attributesForFaceting', + 'unretrievableAttributes' => 'unretrievableAttributes', + 'attributesToRetrieve' => 'attributesToRetrieve', + 'restrictSearchableAttributes' => 'restrictSearchableAttributes', + 'ranking' => 'ranking', + 'customRanking' => 'customRanking', + 'relevancyStrictness' => 'relevancyStrictness', + 'attributesToHighlight' => 'attributesToHighlight', + 'attributesToSnippet' => 'attributesToSnippet', + 'highlightPreTag' => 'highlightPreTag', + 'highlightPostTag' => 'highlightPostTag', + 'snippetEllipsisText' => 'snippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'restrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'hitsPerPage', + 'minWordSizefor1Typo' => 'minWordSizefor1Typo', + 'minWordSizefor2Typos' => 'minWordSizefor2Typos', + 'typoTolerance' => 'typoTolerance', + 'allowTyposOnNumericTokens' => 'allowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'disableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'separatorsToIndex', + 'ignorePlurals' => 'ignorePlurals', + 'removeStopWords' => 'removeStopWords', + 'keepDiacriticsOnCharacters' => 'keepDiacriticsOnCharacters', + 'queryLanguages' => 'queryLanguages', + 'decompoundQuery' => 'decompoundQuery', + 'enableRules' => 'enableRules', + 'enablePersonalization' => 'enablePersonalization', + 'queryType' => 'queryType', + 'removeWordsIfNoResults' => 'removeWordsIfNoResults', + 'advancedSyntax' => 'advancedSyntax', + 'optionalWords' => 'optionalWords', + 'disableExactOnAttributes' => 'disableExactOnAttributes', + 'exactOnSingleWordQuery' => 'exactOnSingleWordQuery', + 'alternativesAsExact' => 'alternativesAsExact', + 'advancedSyntaxFeatures' => 'advancedSyntaxFeatures', + 'distinct' => 'distinct', + 'synonyms' => 'synonyms', + 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', + 'minProximity' => 'minProximity', + 'responseFields' => 'responseFields', + 'maxFacetHits' => 'maxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', + 'renderingContent' => 'renderingContent' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'automaticFacetFilters' => 'setAutomaticFacetFilters', + 'automaticOptionalFacetFilters' => 'setAutomaticOptionalFacetFilters', + 'similarQuery' => 'setSimilarQuery', + 'filters' => 'setFilters', + 'facetFilters' => 'setFacetFilters', + 'optionalFilters' => 'setOptionalFilters', + 'numericFilters' => 'setNumericFilters', + 'tagFilters' => 'setTagFilters', + 'sumOrFiltersScores' => 'setSumOrFiltersScores', + 'facets' => 'setFacets', + 'maxValuesPerFacet' => 'setMaxValuesPerFacet', + 'facetingAfterDistinct' => 'setFacetingAfterDistinct', + 'sortFacetValuesBy' => 'setSortFacetValuesBy', + 'page' => 'setPage', + 'offset' => 'setOffset', + 'length' => 'setLength', + 'aroundLatLng' => 'setAroundLatLng', + 'aroundLatLngViaIP' => 'setAroundLatLngViaIP', + 'aroundRadius' => 'setAroundRadius', + 'aroundPrecision' => 'setAroundPrecision', + 'minimumAroundRadius' => 'setMinimumAroundRadius', + 'insideBoundingBox' => 'setInsideBoundingBox', + 'insidePolygon' => 'setInsidePolygon', + 'naturalLanguages' => 'setNaturalLanguages', + 'ruleContexts' => 'setRuleContexts', + 'personalizationImpact' => 'setPersonalizationImpact', + 'userToken' => 'setUserToken', + 'getRankingInfo' => 'setGetRankingInfo', + 'clickAnalytics' => 'setClickAnalytics', + 'analytics' => 'setAnalytics', + 'analyticsTags' => 'setAnalyticsTags', + 'percentileComputation' => 'setPercentileComputation', + 'enableABTest' => 'setEnableABTest', + 'enableReRanking' => 'setEnableReRanking', + 'searchableAttributes' => 'setSearchableAttributes', + 'attributesForFaceting' => 'setAttributesForFaceting', + 'unretrievableAttributes' => 'setUnretrievableAttributes', + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'restrictSearchableAttributes' => 'setRestrictSearchableAttributes', + 'ranking' => 'setRanking', + 'customRanking' => 'setCustomRanking', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'attributesToHighlight' => 'setAttributesToHighlight', + 'attributesToSnippet' => 'setAttributesToSnippet', + 'highlightPreTag' => 'setHighlightPreTag', + 'highlightPostTag' => 'setHighlightPostTag', + 'snippetEllipsisText' => 'setSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'setRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'setHitsPerPage', + 'minWordSizefor1Typo' => 'setMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'setMinWordSizefor2Typos', + 'typoTolerance' => 'setTypoTolerance', + 'allowTyposOnNumericTokens' => 'setAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'setDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'setSeparatorsToIndex', + 'ignorePlurals' => 'setIgnorePlurals', + 'removeStopWords' => 'setRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'setKeepDiacriticsOnCharacters', + 'queryLanguages' => 'setQueryLanguages', + 'decompoundQuery' => 'setDecompoundQuery', + 'enableRules' => 'setEnableRules', + 'enablePersonalization' => 'setEnablePersonalization', + 'queryType' => 'setQueryType', + 'removeWordsIfNoResults' => 'setRemoveWordsIfNoResults', + 'advancedSyntax' => 'setAdvancedSyntax', + 'optionalWords' => 'setOptionalWords', + 'disableExactOnAttributes' => 'setDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'setExactOnSingleWordQuery', + 'alternativesAsExact' => 'setAlternativesAsExact', + 'advancedSyntaxFeatures' => 'setAdvancedSyntaxFeatures', + 'distinct' => 'setDistinct', + 'synonyms' => 'setSynonyms', + 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', + 'minProximity' => 'setMinProximity', + 'responseFields' => 'setResponseFields', + 'maxFacetHits' => 'setMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'setRenderingContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'automaticFacetFilters' => 'getAutomaticFacetFilters', + 'automaticOptionalFacetFilters' => 'getAutomaticOptionalFacetFilters', + 'similarQuery' => 'getSimilarQuery', + 'filters' => 'getFilters', + 'facetFilters' => 'getFacetFilters', + 'optionalFilters' => 'getOptionalFilters', + 'numericFilters' => 'getNumericFilters', + 'tagFilters' => 'getTagFilters', + 'sumOrFiltersScores' => 'getSumOrFiltersScores', + 'facets' => 'getFacets', + 'maxValuesPerFacet' => 'getMaxValuesPerFacet', + 'facetingAfterDistinct' => 'getFacetingAfterDistinct', + 'sortFacetValuesBy' => 'getSortFacetValuesBy', + 'page' => 'getPage', + 'offset' => 'getOffset', + 'length' => 'getLength', + 'aroundLatLng' => 'getAroundLatLng', + 'aroundLatLngViaIP' => 'getAroundLatLngViaIP', + 'aroundRadius' => 'getAroundRadius', + 'aroundPrecision' => 'getAroundPrecision', + 'minimumAroundRadius' => 'getMinimumAroundRadius', + 'insideBoundingBox' => 'getInsideBoundingBox', + 'insidePolygon' => 'getInsidePolygon', + 'naturalLanguages' => 'getNaturalLanguages', + 'ruleContexts' => 'getRuleContexts', + 'personalizationImpact' => 'getPersonalizationImpact', + 'userToken' => 'getUserToken', + 'getRankingInfo' => 'getGetRankingInfo', + 'clickAnalytics' => 'getClickAnalytics', + 'analytics' => 'getAnalytics', + 'analyticsTags' => 'getAnalyticsTags', + 'percentileComputation' => 'getPercentileComputation', + 'enableABTest' => 'getEnableABTest', + 'enableReRanking' => 'getEnableReRanking', + 'searchableAttributes' => 'getSearchableAttributes', + 'attributesForFaceting' => 'getAttributesForFaceting', + 'unretrievableAttributes' => 'getUnretrievableAttributes', + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'restrictSearchableAttributes' => 'getRestrictSearchableAttributes', + 'ranking' => 'getRanking', + 'customRanking' => 'getCustomRanking', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'attributesToHighlight' => 'getAttributesToHighlight', + 'attributesToSnippet' => 'getAttributesToSnippet', + 'highlightPreTag' => 'getHighlightPreTag', + 'highlightPostTag' => 'getHighlightPostTag', + 'snippetEllipsisText' => 'getSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'getRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'getHitsPerPage', + 'minWordSizefor1Typo' => 'getMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'getMinWordSizefor2Typos', + 'typoTolerance' => 'getTypoTolerance', + 'allowTyposOnNumericTokens' => 'getAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'getDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'getSeparatorsToIndex', + 'ignorePlurals' => 'getIgnorePlurals', + 'removeStopWords' => 'getRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'getKeepDiacriticsOnCharacters', + 'queryLanguages' => 'getQueryLanguages', + 'decompoundQuery' => 'getDecompoundQuery', + 'enableRules' => 'getEnableRules', + 'enablePersonalization' => 'getEnablePersonalization', + 'queryType' => 'getQueryType', + 'removeWordsIfNoResults' => 'getRemoveWordsIfNoResults', + 'advancedSyntax' => 'getAdvancedSyntax', + 'optionalWords' => 'getOptionalWords', + 'disableExactOnAttributes' => 'getDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'getExactOnSingleWordQuery', + 'alternativesAsExact' => 'getAlternativesAsExact', + 'advancedSyntaxFeatures' => 'getAdvancedSyntaxFeatures', + 'distinct' => 'getDistinct', + 'synonyms' => 'getSynonyms', + 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', + 'minProximity' => 'getMinProximity', + 'responseFields' => 'getResponseFields', + 'maxFacetHits' => 'getMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'getRenderingContent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const TYPO_TOLERANCE_TRUE = 'true'; + const TYPO_TOLERANCE_FALSE = 'false'; + const TYPO_TOLERANCE_MIN = 'min'; + const TYPO_TOLERANCE_STRICT = 'strict'; + const QUERY_TYPE_PREFIX_LAST = 'prefixLast'; + const QUERY_TYPE_PREFIX_ALL = 'prefixAll'; + const QUERY_TYPE_PREFIX_NONE = 'prefixNone'; + const REMOVE_WORDS_IF_NO_RESULTS_NONE = 'none'; + const REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS = 'lastWords'; + const REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS = 'firstWords'; + const REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL = 'allOptional'; + const EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE = 'attribute'; + const EXACT_ON_SINGLE_WORD_QUERY_NONE = 'none'; + const EXACT_ON_SINGLE_WORD_QUERY_WORD = 'word'; + const ALTERNATIVES_AS_EXACT_IGNORE_PLURALS = 'ignorePlurals'; + const ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM = 'singleWordSynonym'; + const ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM = 'multiWordsSynonym'; + const ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE = 'exactPhrase'; + const ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS = 'excludeWords'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypoToleranceAllowableValues() + { + return [ + self::TYPO_TOLERANCE_TRUE, + self::TYPO_TOLERANCE_FALSE, + self::TYPO_TOLERANCE_MIN, + self::TYPO_TOLERANCE_STRICT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getQueryTypeAllowableValues() + { + return [ + self::QUERY_TYPE_PREFIX_LAST, + self::QUERY_TYPE_PREFIX_ALL, + self::QUERY_TYPE_PREFIX_NONE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemoveWordsIfNoResultsAllowableValues() + { + return [ + self::REMOVE_WORDS_IF_NO_RESULTS_NONE, + self::REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExactOnSingleWordQueryAllowableValues() + { + return [ + self::EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE, + self::EXACT_ON_SINGLE_WORD_QUERY_NONE, + self::EXACT_ON_SINGLE_WORD_QUERY_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAlternativesAsExactAllowableValues() + { + return [ + self::ALTERNATIVES_AS_EXACT_IGNORE_PLURALS, + self::ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM, + self::ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdvancedSyntaxFeaturesAllowableValues() + { + return [ + self::ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE, + self::ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['query'] = $data['query'] ?? null; + $this->container['automaticFacetFilters'] = $data['automaticFacetFilters'] ?? null; + $this->container['automaticOptionalFacetFilters'] = $data['automaticOptionalFacetFilters'] ?? null; + $this->container['similarQuery'] = $data['similarQuery'] ?? ''; + $this->container['filters'] = $data['filters'] ?? ''; + $this->container['facetFilters'] = $data['facetFilters'] ?? null; + $this->container['optionalFilters'] = $data['optionalFilters'] ?? null; + $this->container['numericFilters'] = $data['numericFilters'] ?? null; + $this->container['tagFilters'] = $data['tagFilters'] ?? null; + $this->container['sumOrFiltersScores'] = $data['sumOrFiltersScores'] ?? false; + $this->container['facets'] = $data['facets'] ?? null; + $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet'] ?? 100; + $this->container['facetingAfterDistinct'] = $data['facetingAfterDistinct'] ?? false; + $this->container['sortFacetValuesBy'] = $data['sortFacetValuesBy'] ?? 'count'; + $this->container['page'] = $data['page'] ?? 0; + $this->container['offset'] = $data['offset'] ?? null; + $this->container['length'] = $data['length'] ?? null; + $this->container['aroundLatLng'] = $data['aroundLatLng'] ?? ''; + $this->container['aroundLatLngViaIP'] = $data['aroundLatLngViaIP'] ?? false; + $this->container['aroundRadius'] = $data['aroundRadius'] ?? null; + $this->container['aroundPrecision'] = $data['aroundPrecision'] ?? 10; + $this->container['minimumAroundRadius'] = $data['minimumAroundRadius'] ?? null; + $this->container['insideBoundingBox'] = $data['insideBoundingBox'] ?? null; + $this->container['insidePolygon'] = $data['insidePolygon'] ?? null; + $this->container['naturalLanguages'] = $data['naturalLanguages'] ?? null; + $this->container['ruleContexts'] = $data['ruleContexts'] ?? null; + $this->container['personalizationImpact'] = $data['personalizationImpact'] ?? 100; + $this->container['userToken'] = $data['userToken'] ?? null; + $this->container['getRankingInfo'] = $data['getRankingInfo'] ?? false; + $this->container['clickAnalytics'] = $data['clickAnalytics'] ?? false; + $this->container['analytics'] = $data['analytics'] ?? true; + $this->container['analyticsTags'] = $data['analyticsTags'] ?? null; + $this->container['percentileComputation'] = $data['percentileComputation'] ?? true; + $this->container['enableABTest'] = $data['enableABTest'] ?? true; + $this->container['enableReRanking'] = $data['enableReRanking'] ?? true; + $this->container['searchableAttributes'] = $data['searchableAttributes'] ?? null; + $this->container['attributesForFaceting'] = $data['attributesForFaceting'] ?? null; + $this->container['unretrievableAttributes'] = $data['unretrievableAttributes'] ?? null; + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve'] ?? null; + $this->container['restrictSearchableAttributes'] = $data['restrictSearchableAttributes'] ?? null; + $this->container['ranking'] = $data['ranking'] ?? null; + $this->container['customRanking'] = $data['customRanking'] ?? null; + $this->container['relevancyStrictness'] = $data['relevancyStrictness'] ?? 100; + $this->container['attributesToHighlight'] = $data['attributesToHighlight'] ?? null; + $this->container['attributesToSnippet'] = $data['attributesToSnippet'] ?? null; + $this->container['highlightPreTag'] = $data['highlightPreTag'] ?? ''; + $this->container['highlightPostTag'] = $data['highlightPostTag'] ?? ''; + $this->container['snippetEllipsisText'] = $data['snippetEllipsisText'] ?? '…'; + $this->container['restrictHighlightAndSnippetArrays'] = $data['restrictHighlightAndSnippetArrays'] ?? false; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['minWordSizefor1Typo'] = $data['minWordSizefor1Typo'] ?? 4; + $this->container['minWordSizefor2Typos'] = $data['minWordSizefor2Typos'] ?? 8; + $this->container['typoTolerance'] = $data['typoTolerance'] ?? 'true'; + $this->container['allowTyposOnNumericTokens'] = $data['allowTyposOnNumericTokens'] ?? true; + $this->container['disableTypoToleranceOnAttributes'] = $data['disableTypoToleranceOnAttributes'] ?? null; + $this->container['separatorsToIndex'] = $data['separatorsToIndex'] ?? ''; + $this->container['ignorePlurals'] = $data['ignorePlurals'] ?? 'false'; + $this->container['removeStopWords'] = $data['removeStopWords'] ?? 'false'; + $this->container['keepDiacriticsOnCharacters'] = $data['keepDiacriticsOnCharacters'] ?? ''; + $this->container['queryLanguages'] = $data['queryLanguages'] ?? null; + $this->container['decompoundQuery'] = $data['decompoundQuery'] ?? true; + $this->container['enableRules'] = $data['enableRules'] ?? true; + $this->container['enablePersonalization'] = $data['enablePersonalization'] ?? false; + $this->container['queryType'] = $data['queryType'] ?? 'prefixLast'; + $this->container['removeWordsIfNoResults'] = $data['removeWordsIfNoResults'] ?? 'none'; + $this->container['advancedSyntax'] = $data['advancedSyntax'] ?? false; + $this->container['optionalWords'] = $data['optionalWords'] ?? null; + $this->container['disableExactOnAttributes'] = $data['disableExactOnAttributes'] ?? null; + $this->container['exactOnSingleWordQuery'] = $data['exactOnSingleWordQuery'] ?? 'attribute'; + $this->container['alternativesAsExact'] = $data['alternativesAsExact'] ?? null; + $this->container['advancedSyntaxFeatures'] = $data['advancedSyntaxFeatures'] ?? null; + $this->container['distinct'] = $data['distinct'] ?? 0; + $this->container['synonyms'] = $data['synonyms'] ?? true; + $this->container['replaceSynonymsInHighlight'] = $data['replaceSynonymsInHighlight'] ?? false; + $this->container['minProximity'] = $data['minProximity'] ?? 1; + $this->container['responseFields'] = $data['responseFields'] ?? null; + $this->container['maxFacetHits'] = $data['maxFacetHits'] ?? 10; + $this->container['attributeCriteriaComputedByMinProximity'] = $data['attributeCriteriaComputedByMinProximity'] ?? false; + $this->container['renderingContent'] = $data['renderingContent'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['length']) && ($this->container['length'] > 1000)) { + $invalidProperties[] = "invalid value for 'length', must be smaller than or equal to 1000."; + } + + if (!is_null($this->container['length']) && ($this->container['length'] < 1)) { + $invalidProperties[] = "invalid value for 'length', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['minimumAroundRadius']) && ($this->container['minimumAroundRadius'] < 1)) { + $invalidProperties[] = "invalid value for 'minimumAroundRadius', must be bigger than or equal to 1."; + } + + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($this->container['typoTolerance']) && !in_array($this->container['typoTolerance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'typoTolerance', must be one of '%s'", + $this->container['typoTolerance'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'queryType', must be one of '%s'", + $this->container['queryType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($this->container['removeWordsIfNoResults']) && !in_array($this->container['removeWordsIfNoResults'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $this->container['removeWordsIfNoResults'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($this->container['exactOnSingleWordQuery']) && !in_array($this->container['exactOnSingleWordQuery'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $this->container['exactOnSingleWordQuery'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['distinct']) && ($this->container['distinct'] > 4)) { + $invalidProperties[] = "invalid value for 'distinct', must be smaller than or equal to 4."; + } + + if (!is_null($this->container['distinct']) && ($this->container['distinct'] < 0)) { + $invalidProperties[] = "invalid value for 'distinct', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['minProximity']) && ($this->container['minProximity'] > 7)) { + $invalidProperties[] = "invalid value for 'minProximity', must be smaller than or equal to 7."; + } + + if (!is_null($this->container['minProximity']) && ($this->container['minProximity'] < 1)) { + $invalidProperties[] = "invalid value for 'minProximity', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + 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 query + * + * @return string|null + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string|null $query Query string. + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets automaticFacetFilters + * + * @return \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null + */ + public function getAutomaticFacetFilters() + { + return $this->container['automaticFacetFilters']; + } + + /** + * Sets automaticFacetFilters + * + * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticFacetFilters Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern. + * + * @return self + */ + public function setAutomaticFacetFilters($automaticFacetFilters) + { + $this->container['automaticFacetFilters'] = $automaticFacetFilters; + + return $this; + } + + /** + * Gets automaticOptionalFacetFilters + * + * @return \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null + */ + public function getAutomaticOptionalFacetFilters() + { + return $this->container['automaticOptionalFacetFilters']; + } + + /** + * Sets automaticOptionalFacetFilters + * + * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticOptionalFacetFilters Same syntax as automaticFacetFilters, but the engine treats the filters as optional. + * + * @return self + */ + public function setAutomaticOptionalFacetFilters($automaticOptionalFacetFilters) + { + $this->container['automaticOptionalFacetFilters'] = $automaticOptionalFacetFilters; + + return $this; + } + + /** + * Gets similarQuery + * + * @return string|null + */ + public function getSimilarQuery() + { + return $this->container['similarQuery']; + } + + /** + * Sets similarQuery + * + * @param string|null $similarQuery Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. + * + * @return self + */ + public function setSimilarQuery($similarQuery) + { + $this->container['similarQuery'] = $similarQuery; + + return $this; + } + + /** + * Gets filters + * + * @return string|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param string|null $filters Filter the query with numeric, facet and/or tag filters. + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets facetFilters + * + * @return string[]|null + */ + public function getFacetFilters() + { + return $this->container['facetFilters']; + } + + /** + * Sets facetFilters + * + * @param string[]|null $facetFilters Filter hits by facet value. + * + * @return self + */ + public function setFacetFilters($facetFilters) + { + $this->container['facetFilters'] = $facetFilters; + + return $this; + } + + /** + * Gets optionalFilters + * + * @return string[]|null + */ + public function getOptionalFilters() + { + return $this->container['optionalFilters']; + } + + /** + * Sets optionalFilters + * + * @param string[]|null $optionalFilters Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. + * + * @return self + */ + public function setOptionalFilters($optionalFilters) + { + $this->container['optionalFilters'] = $optionalFilters; + + return $this; + } + + /** + * Gets numericFilters + * + * @return string[]|null + */ + public function getNumericFilters() + { + return $this->container['numericFilters']; + } + + /** + * Sets numericFilters + * + * @param string[]|null $numericFilters Filter on numeric attributes. + * + * @return self + */ + public function setNumericFilters($numericFilters) + { + $this->container['numericFilters'] = $numericFilters; + + return $this; + } + + /** + * Gets tagFilters + * + * @return string[]|null + */ + public function getTagFilters() + { + return $this->container['tagFilters']; + } + + /** + * Sets tagFilters + * + * @param string[]|null $tagFilters Filter hits by tags. + * + * @return self + */ + public function setTagFilters($tagFilters) + { + $this->container['tagFilters'] = $tagFilters; + + return $this; + } + + /** + * Gets sumOrFiltersScores + * + * @return bool|null + */ + public function getSumOrFiltersScores() + { + return $this->container['sumOrFiltersScores']; + } + + /** + * Sets sumOrFiltersScores + * + * @param bool|null $sumOrFiltersScores Determines how to calculate the total score for filtering. + * + * @return self + */ + public function setSumOrFiltersScores($sumOrFiltersScores) + { + $this->container['sumOrFiltersScores'] = $sumOrFiltersScores; + + return $this; + } + + /** + * Gets facets + * + * @return string[]|null + */ + public function getFacets() + { + return $this->container['facets']; + } + + /** + * Sets facets + * + * @param string[]|null $facets Retrieve facets and their facet values. + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets maxValuesPerFacet + * + * @return int|null + */ + public function getMaxValuesPerFacet() + { + return $this->container['maxValuesPerFacet']; + } + + /** + * Sets maxValuesPerFacet + * + * @param int|null $maxValuesPerFacet Maximum number of facet values to return for each facet during a regular search. + * + * @return self + */ + public function setMaxValuesPerFacet($maxValuesPerFacet) + { + $this->container['maxValuesPerFacet'] = $maxValuesPerFacet; + + return $this; + } + + /** + * Gets facetingAfterDistinct + * + * @return bool|null + */ + public function getFacetingAfterDistinct() + { + return $this->container['facetingAfterDistinct']; + } + + /** + * Sets facetingAfterDistinct + * + * @param bool|null $facetingAfterDistinct Force faceting to be applied after de-duplication (via the Distinct setting). + * + * @return self + */ + public function setFacetingAfterDistinct($facetingAfterDistinct) + { + $this->container['facetingAfterDistinct'] = $facetingAfterDistinct; + + return $this; + } + + /** + * Gets sortFacetValuesBy + * + * @return string|null + */ + public function getSortFacetValuesBy() + { + return $this->container['sortFacetValuesBy']; + } + + /** + * Sets sortFacetValuesBy + * + * @param string|null $sortFacetValuesBy Controls how facet values are fetched. + * + * @return self + */ + public function setSortFacetValuesBy($sortFacetValuesBy) + { + $this->container['sortFacetValuesBy'] = $sortFacetValuesBy; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page Specify the page to retrieve. + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets offset + * + * @return int|null + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * + * @param int|null $offset Specify the offset of the first hit to return. + * + * @return self + */ + public function setOffset($offset) + { + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets length + * + * @return int|null + */ + public function getLength() + { + return $this->container['length']; + } + + /** + * Sets length + * + * @param int|null $length Set the number of hits to retrieve (used only with offset). + * + * @return self + */ + public function setLength($length) + { + + if (!is_null($length) && ($length > 1000)) { + throw new \InvalidArgumentException('invalid value for $length when calling ConsequenceParams., must be smaller than or equal to 1000.'); + } + if (!is_null($length) && ($length < 1)) { + throw new \InvalidArgumentException('invalid value for $length when calling ConsequenceParams., must be bigger than or equal to 1.'); + } + + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng']; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng Search for entries around a central geolocation, enabling a geo search within a circular area. + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets aroundLatLngViaIP + * + * @return bool|null + */ + public function getAroundLatLngViaIP() + { + return $this->container['aroundLatLngViaIP']; + } + + /** + * Sets aroundLatLngViaIP + * + * @param bool|null $aroundLatLngViaIP Search for entries around a given location automatically computed from the requester's IP address. + * + * @return self + */ + public function setAroundLatLngViaIP($aroundLatLngViaIP) + { + $this->container['aroundLatLngViaIP'] = $aroundLatLngViaIP; + + return $this; + } + + /** + * Gets aroundRadius + * + * @return OneOfIntegerString|null + */ + public function getAroundRadius() + { + return $this->container['aroundRadius']; + } + + /** + * Sets aroundRadius + * + * @param OneOfIntegerString|null $aroundRadius Define the maximum radius for a geo search (in meters). + * + * @return self + */ + public function setAroundRadius($aroundRadius) + { + $this->container['aroundRadius'] = $aroundRadius; + + return $this; + } + + /** + * Gets aroundPrecision + * + * @return int|null + */ + public function getAroundPrecision() + { + return $this->container['aroundPrecision']; + } + + /** + * Sets aroundPrecision + * + * @param int|null $aroundPrecision Precision of geo search (in meters), to add grouping by geo location to the ranking formula. + * + * @return self + */ + public function setAroundPrecision($aroundPrecision) + { + $this->container['aroundPrecision'] = $aroundPrecision; + + return $this; + } + + /** + * Gets minimumAroundRadius + * + * @return int|null + */ + public function getMinimumAroundRadius() + { + return $this->container['minimumAroundRadius']; + } + + /** + * Sets minimumAroundRadius + * + * @param int|null $minimumAroundRadius Minimum radius (in meters) used for a geo search when aroundRadius is not set. + * + * @return self + */ + public function setMinimumAroundRadius($minimumAroundRadius) + { + + if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { + throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling ConsequenceParams., must be bigger than or equal to 1.'); + } + + $this->container['minimumAroundRadius'] = $minimumAroundRadius; + + return $this; + } + + /** + * Gets insideBoundingBox + * + * @return float[]|null + */ + public function getInsideBoundingBox() + { + return $this->container['insideBoundingBox']; + } + + /** + * Sets insideBoundingBox + * + * @param float[]|null $insideBoundingBox Search inside a rectangular area (in geo coordinates). + * + * @return self + */ + public function setInsideBoundingBox($insideBoundingBox) + { + $this->container['insideBoundingBox'] = $insideBoundingBox; + + return $this; + } + + /** + * Gets insidePolygon + * + * @return float[]|null + */ + public function getInsidePolygon() + { + return $this->container['insidePolygon']; + } + + /** + * Sets insidePolygon + * + * @param float[]|null $insidePolygon Search inside a polygon (in geo coordinates). + * + * @return self + */ + public function setInsidePolygon($insidePolygon) + { + $this->container['insidePolygon'] = $insidePolygon; + + return $this; + } + + /** + * Gets naturalLanguages + * + * @return string[]|null + */ + public function getNaturalLanguages() + { + return $this->container['naturalLanguages']; + } + + /** + * Sets naturalLanguages + * + * @param string[]|null $naturalLanguages This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. + * + * @return self + */ + public function setNaturalLanguages($naturalLanguages) + { + $this->container['naturalLanguages'] = $naturalLanguages; + + return $this; + } + + /** + * Gets ruleContexts + * + * @return string[]|null + */ + public function getRuleContexts() + { + return $this->container['ruleContexts']; + } + + /** + * Sets ruleContexts + * + * @param string[]|null $ruleContexts Enables contextual rules. + * + * @return self + */ + public function setRuleContexts($ruleContexts) + { + $this->container['ruleContexts'] = $ruleContexts; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int|null + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact']; + } + + /** + * Sets personalizationImpact + * + * @param int|null $personalizationImpact Define the impact of the Personalization feature. + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + return $this; + } + + /** + * Gets userToken + * + * @return string|null + */ + public function getUserToken() + { + return $this->container['userToken']; + } + + /** + * Sets userToken + * + * @param string|null $userToken Associates a certain user token with the current search. + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets getRankingInfo + * + * @return bool|null + */ + public function getGetRankingInfo() + { + return $this->container['getRankingInfo']; + } + + /** + * Sets getRankingInfo + * + * @param bool|null $getRankingInfo Retrieve detailed ranking information. + * + * @return self + */ + public function setGetRankingInfo($getRankingInfo) + { + $this->container['getRankingInfo'] = $getRankingInfo; + + return $this; + } + + /** + * Gets clickAnalytics + * + * @return bool|null + */ + public function getClickAnalytics() + { + return $this->container['clickAnalytics']; + } + + /** + * Sets clickAnalytics + * + * @param bool|null $clickAnalytics Enable the Click Analytics feature. + * + * @return self + */ + public function setClickAnalytics($clickAnalytics) + { + $this->container['clickAnalytics'] = $clickAnalytics; + + return $this; + } + + /** + * Gets analytics + * + * @return bool|null + */ + public function getAnalytics() + { + return $this->container['analytics']; + } + + /** + * Sets analytics + * + * @param bool|null $analytics Whether the current query will be taken into account in the Analytics. + * + * @return self + */ + public function setAnalytics($analytics) + { + $this->container['analytics'] = $analytics; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[]|null + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags']; + } + + /** + * Sets analyticsTags + * + * @param string[]|null $analyticsTags List of tags to apply to the query for analytics purposes. + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets percentileComputation + * + * @return bool|null + */ + public function getPercentileComputation() + { + return $this->container['percentileComputation']; + } + + /** + * Sets percentileComputation + * + * @param bool|null $percentileComputation Whether to include or exclude a query from the processing-time percentile computation. + * + * @return self + */ + public function setPercentileComputation($percentileComputation) + { + $this->container['percentileComputation'] = $percentileComputation; + + return $this; + } + + /** + * Gets enableABTest + * + * @return bool|null + */ + public function getEnableABTest() + { + return $this->container['enableABTest']; + } + + /** + * Sets enableABTest + * + * @param bool|null $enableABTest Whether this search should participate in running AB tests. + * + * @return self + */ + public function setEnableABTest($enableABTest) + { + $this->container['enableABTest'] = $enableABTest; + + return $this; + } + + /** + * Gets enableReRanking + * + * @return bool|null + */ + public function getEnableReRanking() + { + return $this->container['enableReRanking']; + } + + /** + * Sets enableReRanking + * + * @param bool|null $enableReRanking Whether this search should use AI Re-Ranking. + * + * @return self + */ + public function setEnableReRanking($enableReRanking) + { + $this->container['enableReRanking'] = $enableReRanking; + + return $this; + } + + /** + * Gets searchableAttributes + * + * @return string[]|null + */ + public function getSearchableAttributes() + { + return $this->container['searchableAttributes']; + } + + /** + * Sets searchableAttributes + * + * @param string[]|null $searchableAttributes The complete list of attributes used for searching. + * + * @return self + */ + public function setSearchableAttributes($searchableAttributes) + { + $this->container['searchableAttributes'] = $searchableAttributes; + + return $this; + } + + /** + * Gets attributesForFaceting + * + * @return string[]|null + */ + public function getAttributesForFaceting() + { + return $this->container['attributesForFaceting']; + } + + /** + * Sets attributesForFaceting + * + * @param string[]|null $attributesForFaceting The complete list of attributes that will be used for faceting. + * + * @return self + */ + public function setAttributesForFaceting($attributesForFaceting) + { + $this->container['attributesForFaceting'] = $attributesForFaceting; + + return $this; + } + + /** + * Gets unretrievableAttributes + * + * @return string[]|null + */ + public function getUnretrievableAttributes() + { + return $this->container['unretrievableAttributes']; + } + + /** + * Sets unretrievableAttributes + * + * @param string[]|null $unretrievableAttributes List of attributes that can't be retrieved at query time. + * + * @return self + */ + public function setUnretrievableAttributes($unretrievableAttributes) + { + $this->container['unretrievableAttributes'] = $unretrievableAttributes; + + return $this; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve']; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve This parameter controls which attributes to retrieve and which not to retrieve. + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets restrictSearchableAttributes + * + * @return string[]|null + */ + public function getRestrictSearchableAttributes() + { + return $this->container['restrictSearchableAttributes']; + } + + /** + * Sets restrictSearchableAttributes + * + * @param string[]|null $restrictSearchableAttributes Restricts a given query to look in only a subset of your searchable attributes. + * + * @return self + */ + public function setRestrictSearchableAttributes($restrictSearchableAttributes) + { + $this->container['restrictSearchableAttributes'] = $restrictSearchableAttributes; + + return $this; + } + + /** + * Gets ranking + * + * @return string[]|null + */ + public function getRanking() + { + return $this->container['ranking']; + } + + /** + * Sets ranking + * + * @param string[]|null $ranking Controls how Algolia should sort your results. + * + * @return self + */ + public function setRanking($ranking) + { + $this->container['ranking'] = $ranking; + + return $this; + } + + /** + * Gets customRanking + * + * @return string[]|null + */ + public function getCustomRanking() + { + return $this->container['customRanking']; + } + + /** + * Sets customRanking + * + * @param string[]|null $customRanking Specifies the custom ranking criterion. + * + * @return self + */ + public function setCustomRanking($customRanking) + { + $this->container['customRanking'] = $customRanking; + + return $this; + } + + /** + * Gets relevancyStrictness + * + * @return int|null + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness']; + } + + /** + * Sets relevancyStrictness + * + * @param int|null $relevancyStrictness Controls the relevancy threshold below which less relevant results aren't included in the results. + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets attributesToHighlight + * + * @return string[]|null + */ + public function getAttributesToHighlight() + { + return $this->container['attributesToHighlight']; + } + + /** + * Sets attributesToHighlight + * + * @param string[]|null $attributesToHighlight List of attributes to highlight. + * + * @return self + */ + public function setAttributesToHighlight($attributesToHighlight) + { + $this->container['attributesToHighlight'] = $attributesToHighlight; + + return $this; + } + + /** + * Gets attributesToSnippet + * + * @return string[]|null + */ + public function getAttributesToSnippet() + { + return $this->container['attributesToSnippet']; + } + + /** + * Sets attributesToSnippet + * + * @param string[]|null $attributesToSnippet List of attributes to snippet, with an optional maximum number of words to snippet. + * + * @return self + */ + public function setAttributesToSnippet($attributesToSnippet) + { + $this->container['attributesToSnippet'] = $attributesToSnippet; + + return $this; + } + + /** + * Gets highlightPreTag + * + * @return string|null + */ + public function getHighlightPreTag() + { + return $this->container['highlightPreTag']; + } + + /** + * Sets highlightPreTag + * + * @param string|null $highlightPreTag The HTML string to insert before the highlighted parts in all highlight and snippet results. + * + * @return self + */ + public function setHighlightPreTag($highlightPreTag) + { + $this->container['highlightPreTag'] = $highlightPreTag; + + return $this; + } + + /** + * Gets highlightPostTag + * + * @return string|null + */ + public function getHighlightPostTag() + { + return $this->container['highlightPostTag']; + } + + /** + * Sets highlightPostTag + * + * @param string|null $highlightPostTag The HTML string to insert after the highlighted parts in all highlight and snippet results. + * + * @return self + */ + public function setHighlightPostTag($highlightPostTag) + { + $this->container['highlightPostTag'] = $highlightPostTag; + + return $this; + } + + /** + * Gets snippetEllipsisText + * + * @return string|null + */ + public function getSnippetEllipsisText() + { + return $this->container['snippetEllipsisText']; + } + + /** + * Sets snippetEllipsisText + * + * @param string|null $snippetEllipsisText String used as an ellipsis indicator when a snippet is truncated. + * + * @return self + */ + public function setSnippetEllipsisText($snippetEllipsisText) + { + $this->container['snippetEllipsisText'] = $snippetEllipsisText; + + return $this; + } + + /** + * Gets restrictHighlightAndSnippetArrays + * + * @return bool|null + */ + public function getRestrictHighlightAndSnippetArrays() + { + return $this->container['restrictHighlightAndSnippetArrays']; + } + + /** + * Sets restrictHighlightAndSnippetArrays + * + * @param bool|null $restrictHighlightAndSnippetArrays Restrict highlighting and snippeting to items that matched the query. + * + * @return self + */ + public function setRestrictHighlightAndSnippetArrays($restrictHighlightAndSnippetArrays) + { + $this->container['restrictHighlightAndSnippetArrays'] = $restrictHighlightAndSnippetArrays; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage Set the number of hits per page. + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets minWordSizefor1Typo + * + * @return int|null + */ + public function getMinWordSizefor1Typo() + { + return $this->container['minWordSizefor1Typo']; + } + + /** + * Sets minWordSizefor1Typo + * + * @param int|null $minWordSizefor1Typo Minimum number of characters a word in the query string must contain to accept matches with 1 typo. + * + * @return self + */ + public function setMinWordSizefor1Typo($minWordSizefor1Typo) + { + $this->container['minWordSizefor1Typo'] = $minWordSizefor1Typo; + + return $this; + } + + /** + * Gets minWordSizefor2Typos + * + * @return int|null + */ + public function getMinWordSizefor2Typos() + { + return $this->container['minWordSizefor2Typos']; + } + + /** + * Sets minWordSizefor2Typos + * + * @param int|null $minWordSizefor2Typos Minimum number of characters a word in the query string must contain to accept matches with 2 typos. + * + * @return self + */ + public function setMinWordSizefor2Typos($minWordSizefor2Typos) + { + $this->container['minWordSizefor2Typos'] = $minWordSizefor2Typos; + + return $this; + } + + /** + * Gets typoTolerance + * + * @return string|null + */ + public function getTypoTolerance() + { + return $this->container['typoTolerance']; + } + + /** + * Sets typoTolerance + * + * @param string|null $typoTolerance Controls whether typo tolerance is enabled and how it is applied. + * + * @return self + */ + public function setTypoTolerance($typoTolerance) + { + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($typoTolerance) && !in_array($typoTolerance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'typoTolerance', must be one of '%s'", + $typoTolerance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['typoTolerance'] = $typoTolerance; + + return $this; + } + + /** + * Gets allowTyposOnNumericTokens + * + * @return bool|null + */ + public function getAllowTyposOnNumericTokens() + { + return $this->container['allowTyposOnNumericTokens']; + } + + /** + * Sets allowTyposOnNumericTokens + * + * @param bool|null $allowTyposOnNumericTokens Whether to allow typos on numbers (\"numeric tokens\") in the query string. + * + * @return self + */ + public function setAllowTyposOnNumericTokens($allowTyposOnNumericTokens) + { + $this->container['allowTyposOnNumericTokens'] = $allowTyposOnNumericTokens; + + return $this; + } + + /** + * Gets disableTypoToleranceOnAttributes + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnAttributes() + { + return $this->container['disableTypoToleranceOnAttributes']; + } + + /** + * Sets disableTypoToleranceOnAttributes + * + * @param string[]|null $disableTypoToleranceOnAttributes List of attributes on which you want to disable typo tolerance. + * + * @return self + */ + public function setDisableTypoToleranceOnAttributes($disableTypoToleranceOnAttributes) + { + $this->container['disableTypoToleranceOnAttributes'] = $disableTypoToleranceOnAttributes; + + return $this; + } + + /** + * Gets separatorsToIndex + * + * @return string|null + */ + public function getSeparatorsToIndex() + { + return $this->container['separatorsToIndex']; + } + + /** + * Sets separatorsToIndex + * + * @param string|null $separatorsToIndex Control which separators are indexed. + * + * @return self + */ + public function setSeparatorsToIndex($separatorsToIndex) + { + $this->container['separatorsToIndex'] = $separatorsToIndex; + + return $this; + } + + /** + * Gets ignorePlurals + * + * @return string|null + */ + public function getIgnorePlurals() + { + return $this->container['ignorePlurals']; + } + + /** + * Sets ignorePlurals + * + * @param string|null $ignorePlurals Treats singular, plurals, and other forms of declensions as matching terms. + * + * @return self + */ + public function setIgnorePlurals($ignorePlurals) + { + $this->container['ignorePlurals'] = $ignorePlurals; + + return $this; + } + + /** + * Gets removeStopWords + * + * @return string|null + */ + public function getRemoveStopWords() + { + return $this->container['removeStopWords']; + } + + /** + * Sets removeStopWords + * + * @param string|null $removeStopWords Removes stop (common) words from the query before executing it. + * + * @return self + */ + public function setRemoveStopWords($removeStopWords) + { + $this->container['removeStopWords'] = $removeStopWords; + + return $this; + } + + /** + * Gets keepDiacriticsOnCharacters + * + * @return string|null + */ + public function getKeepDiacriticsOnCharacters() + { + return $this->container['keepDiacriticsOnCharacters']; + } + + /** + * Sets keepDiacriticsOnCharacters + * + * @param string|null $keepDiacriticsOnCharacters List of characters that the engine shouldn't automatically normalize. + * + * @return self + */ + public function setKeepDiacriticsOnCharacters($keepDiacriticsOnCharacters) + { + $this->container['keepDiacriticsOnCharacters'] = $keepDiacriticsOnCharacters; + + return $this; + } + + /** + * Gets queryLanguages + * + * @return string[]|null + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages']; + } + + /** + * Sets queryLanguages + * + * @param string[]|null $queryLanguages Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets decompoundQuery + * + * @return bool|null + */ + public function getDecompoundQuery() + { + return $this->container['decompoundQuery']; + } + + /** + * Sets decompoundQuery + * + * @param bool|null $decompoundQuery Splits compound words into their composing atoms in the query. + * + * @return self + */ + public function setDecompoundQuery($decompoundQuery) + { + $this->container['decompoundQuery'] = $decompoundQuery; + + return $this; + } + + /** + * Gets enableRules + * + * @return bool|null + */ + public function getEnableRules() + { + return $this->container['enableRules']; + } + + /** + * Sets enableRules + * + * @param bool|null $enableRules Whether Rules should be globally enabled. + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets enablePersonalization + * + * @return bool|null + */ + public function getEnablePersonalization() + { + return $this->container['enablePersonalization']; + } + + /** + * Sets enablePersonalization + * + * @param bool|null $enablePersonalization Enable the Personalization feature. + * + * @return self + */ + public function setEnablePersonalization($enablePersonalization) + { + $this->container['enablePersonalization'] = $enablePersonalization; + + return $this; + } + + /** + * Gets queryType + * + * @return string|null + */ + public function getQueryType() + { + return $this->container['queryType']; + } + + /** + * Sets queryType + * + * @param string|null $queryType Controls if and how query words are interpreted as prefixes. + * + * @return self + */ + public function setQueryType($queryType) + { + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($queryType) && !in_array($queryType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'queryType', must be one of '%s'", + $queryType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['queryType'] = $queryType; + + return $this; + } + + /** + * Gets removeWordsIfNoResults + * + * @return string|null + */ + public function getRemoveWordsIfNoResults() + { + return $this->container['removeWordsIfNoResults']; + } + + /** + * Sets removeWordsIfNoResults + * + * @param string|null $removeWordsIfNoResults Selects a strategy to remove words from the query when it doesn't match any hits. + * + * @return self + */ + public function setRemoveWordsIfNoResults($removeWordsIfNoResults) + { + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($removeWordsIfNoResults) && !in_array($removeWordsIfNoResults, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $removeWordsIfNoResults, + implode("', '", $allowedValues) + ) + ); + } + $this->container['removeWordsIfNoResults'] = $removeWordsIfNoResults; + + return $this; + } + + /** + * Gets advancedSyntax + * + * @return bool|null + */ + public function getAdvancedSyntax() + { + return $this->container['advancedSyntax']; + } + + /** + * Sets advancedSyntax + * + * @param bool|null $advancedSyntax Enables the advanced query syntax. + * + * @return self + */ + public function setAdvancedSyntax($advancedSyntax) + { + $this->container['advancedSyntax'] = $advancedSyntax; + + return $this; + } + + /** + * Gets optionalWords + * + * @return string[]|null + */ + public function getOptionalWords() + { + return $this->container['optionalWords']; + } + + /** + * Sets optionalWords + * + * @param string[]|null $optionalWords A list of words that should be considered as optional when found in the query. + * + * @return self + */ + public function setOptionalWords($optionalWords) + { + $this->container['optionalWords'] = $optionalWords; + + return $this; + } + + /** + * Gets disableExactOnAttributes + * + * @return string[]|null + */ + public function getDisableExactOnAttributes() + { + return $this->container['disableExactOnAttributes']; + } + + /** + * Sets disableExactOnAttributes + * + * @param string[]|null $disableExactOnAttributes List of attributes on which you want to disable the exact ranking criterion. + * + * @return self + */ + public function setDisableExactOnAttributes($disableExactOnAttributes) + { + $this->container['disableExactOnAttributes'] = $disableExactOnAttributes; + + return $this; + } + + /** + * Gets exactOnSingleWordQuery + * + * @return string|null + */ + public function getExactOnSingleWordQuery() + { + return $this->container['exactOnSingleWordQuery']; + } + + /** + * Sets exactOnSingleWordQuery + * + * @param string|null $exactOnSingleWordQuery Controls how the exact ranking criterion is computed when the query contains only one word. + * + * @return self + */ + public function setExactOnSingleWordQuery($exactOnSingleWordQuery) + { + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($exactOnSingleWordQuery) && !in_array($exactOnSingleWordQuery, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $exactOnSingleWordQuery, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exactOnSingleWordQuery'] = $exactOnSingleWordQuery; + + return $this; + } + + /** + * Gets alternativesAsExact + * + * @return string[]|null + */ + public function getAlternativesAsExact() + { + return $this->container['alternativesAsExact']; + } + + /** + * Sets alternativesAsExact + * + * @param string[]|null $alternativesAsExact List of alternatives that should be considered an exact match by the exact ranking criterion. + * + * @return self + */ + public function setAlternativesAsExact($alternativesAsExact) + { + $allowedValues = $this->getAlternativesAsExactAllowableValues(); + if (!is_null($alternativesAsExact) && array_diff($alternativesAsExact, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'alternativesAsExact', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['alternativesAsExact'] = $alternativesAsExact; + + return $this; + } + + /** + * Gets advancedSyntaxFeatures + * + * @return string[]|null + */ + public function getAdvancedSyntaxFeatures() + { + return $this->container['advancedSyntaxFeatures']; + } + + /** + * Sets advancedSyntaxFeatures + * + * @param string[]|null $advancedSyntaxFeatures Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. + * + * @return self + */ + public function setAdvancedSyntaxFeatures($advancedSyntaxFeatures) + { + $allowedValues = $this->getAdvancedSyntaxFeaturesAllowableValues(); + if (!is_null($advancedSyntaxFeatures) && array_diff($advancedSyntaxFeatures, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'advancedSyntaxFeatures', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['advancedSyntaxFeatures'] = $advancedSyntaxFeatures; + + return $this; + } + + /** + * Gets distinct + * + * @return int|null + */ + public function getDistinct() + { + return $this->container['distinct']; + } + + /** + * Sets distinct + * + * @param int|null $distinct Enables de-duplication or grouping of results. + * + * @return self + */ + public function setDistinct($distinct) + { + + if (!is_null($distinct) && ($distinct > 4)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling ConsequenceParams., must be smaller than or equal to 4.'); + } + if (!is_null($distinct) && ($distinct < 0)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling ConsequenceParams., must be bigger than or equal to 0.'); + } + + $this->container['distinct'] = $distinct; + + return $this; + } + + /** + * Gets synonyms + * + * @return bool|null + */ + public function getSynonyms() + { + return $this->container['synonyms']; + } + + /** + * Sets synonyms + * + * @param bool|null $synonyms Whether to take into account an index's synonyms for a particular search. + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets replaceSynonymsInHighlight + * + * @return bool|null + */ + public function getReplaceSynonymsInHighlight() + { + return $this->container['replaceSynonymsInHighlight']; + } + + /** + * Sets replaceSynonymsInHighlight + * + * @param bool|null $replaceSynonymsInHighlight Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + * + * @return self + */ + public function setReplaceSynonymsInHighlight($replaceSynonymsInHighlight) + { + $this->container['replaceSynonymsInHighlight'] = $replaceSynonymsInHighlight; + + return $this; + } + + /** + * Gets minProximity + * + * @return int|null + */ + public function getMinProximity() + { + return $this->container['minProximity']; + } + + /** + * Sets minProximity + * + * @param int|null $minProximity Precision of the proximity ranking criterion. + * + * @return self + */ + public function setMinProximity($minProximity) + { + + if (!is_null($minProximity) && ($minProximity > 7)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling ConsequenceParams., must be smaller than or equal to 7.'); + } + if (!is_null($minProximity) && ($minProximity < 1)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling ConsequenceParams., must be bigger than or equal to 1.'); + } + + $this->container['minProximity'] = $minProximity; + + return $this; + } + + /** + * Gets responseFields + * + * @return string[]|null + */ + public function getResponseFields() + { + return $this->container['responseFields']; + } + + /** + * Sets responseFields + * + * @param string[]|null $responseFields Choose which fields to return in the API response. This parameters applies to search and browse queries. + * + * @return self + */ + public function setResponseFields($responseFields) + { + $this->container['responseFields'] = $responseFields; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits']; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling ConsequenceParams., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets attributeCriteriaComputedByMinProximity + * + * @return bool|null + */ + public function getAttributeCriteriaComputedByMinProximity() + { + return $this->container['attributeCriteriaComputedByMinProximity']; + } + + /** + * Sets attributeCriteriaComputedByMinProximity + * + * @param bool|null $attributeCriteriaComputedByMinProximity When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. + * + * @return self + */ + public function setAttributeCriteriaComputedByMinProximity($attributeCriteriaComputedByMinProximity) + { + $this->container['attributeCriteriaComputedByMinProximity'] = $attributeCriteriaComputedByMinProximity; + + return $this; + } + + /** + * Gets renderingContent + * + * @return object|null + */ + public function getRenderingContent() + { + return $this->container['renderingContent']; + } + + /** + * Sets renderingContent + * + * @param object|null $renderingContent Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php b/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php new file mode 100644 index 0000000000..367591485d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php @@ -0,0 +1,323 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CreatedAtObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'createdAtObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'createdAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'createdAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'createdAt' => 'createdAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['createdAt'] = $data['createdAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' 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 createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Date of creation (ISO-8601 format). + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php new file mode 100644 index 0000000000..0fb610a418 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php @@ -0,0 +1,324 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CreatedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'createdAtResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'createdAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'createdAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'createdAt' => 'createdAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['createdAt'] = $data['createdAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' 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 createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Date of creation (ISO-8601 format). + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php b/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php new file mode 100644 index 0000000000..7b8ddaf81b --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php @@ -0,0 +1,323 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'deleteApiKeyResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'deletedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'deletedAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'deletedAt' => 'deletedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deletedAt' => 'setDeletedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deletedAt' => 'getDeletedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['deletedAt'] = $data['deletedAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['deletedAt'] === null) { + $invalidProperties[] = "'deletedAt' 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 deletedAt + * + * @return \DateTime + */ + public function getDeletedAt() + { + return $this->container['deletedAt']; + } + + /** + * Sets deletedAt + * + * @param \DateTime $deletedAt Date of deletion (ISO-8601 format). + * + * @return self + */ + public function setDeletedAt($deletedAt) + { + $this->container['deletedAt'] = $deletedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php b/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php new file mode 100644 index 0000000000..cb32c5defd --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php @@ -0,0 +1,323 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteSourceResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'deleteSourceResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'deletedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'deletedAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'deletedAt' => 'deletedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deletedAt' => 'setDeletedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deletedAt' => 'getDeletedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['deletedAt'] = $data['deletedAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['deletedAt'] === null) { + $invalidProperties[] = "'deletedAt' 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 deletedAt + * + * @return \DateTime + */ + public function getDeletedAt() + { + return $this->container['deletedAt']; + } + + /** + * Sets deletedAt + * + * @param \DateTime $deletedAt Date of deletion (ISO-8601 format). + * + * @return self + */ + public function setDeletedAt($deletedAt) + { + $this->container['deletedAt'] = $deletedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php new file mode 100644 index 0000000000..530c8f920c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php @@ -0,0 +1,357 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeletedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'deletedAtResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'taskID' => 'int', + 'deletedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'taskID' => null, + 'deletedAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'taskID' => 'taskID', + 'deletedAt' => 'deletedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'taskID' => 'setTaskID', + 'deletedAt' => 'setDeletedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'taskID' => 'getTaskID', + 'deletedAt' => 'getDeletedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['taskID'] = $data['taskID'] ?? null; + $this->container['deletedAt'] = $data['deletedAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['taskID'] === null) { + $invalidProperties[] = "'taskID' can't be null"; + } + if ($this->container['deletedAt'] === null) { + $invalidProperties[] = "'deletedAt' 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 taskID + * + * @return int + */ + public function getTaskID() + { + return $this->container['taskID']; + } + + /** + * Sets taskID + * + * @param int $taskID taskID of the indexing task to wait for. + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + + /** + * Gets deletedAt + * + * @return \DateTime + */ + public function getDeletedAt() + { + return $this->container['deletedAt']; + } + + /** + * Sets deletedAt + * + * @param \DateTime $deletedAt Date of deletion (ISO-8601 format). + * + * @return self + */ + public function setDeletedAt($deletedAt) + { + $this->container['deletedAt'] = $deletedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/DictionaryEntry.php b/clients/algoliasearch-client-php/lib/Model/DictionaryEntry.php new file mode 100644 index 0000000000..851c93823c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/DictionaryEntry.php @@ -0,0 +1,511 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DictionaryEntry implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'dictionaryEntry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'objectID' => 'string', + 'language' => 'string', + 'word' => 'string', + 'words' => 'string[]', + 'decomposition' => 'string[]', + 'state' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'objectID' => null, + 'language' => null, + 'word' => null, + 'words' => null, + 'decomposition' => null, + 'state' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'objectID' => 'objectID', + 'language' => 'language', + 'word' => 'word', + 'words' => 'words', + 'decomposition' => 'decomposition', + 'state' => 'state' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'language' => 'setLanguage', + 'word' => 'setWord', + 'words' => 'setWords', + 'decomposition' => 'setDecomposition', + 'state' => 'setState' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'language' => 'getLanguage', + 'word' => 'getWord', + 'words' => 'getWords', + 'decomposition' => 'getDecomposition', + 'state' => 'getState' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const STATE_ENABLED = 'enabled'; + const STATE_DISABLED = 'disabled'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStateAllowableValues() + { + return [ + self::STATE_ENABLED, + self::STATE_DISABLED, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['objectID'] = $data['objectID'] ?? null; + $this->container['language'] = $data['language'] ?? null; + $this->container['word'] = $data['word'] ?? null; + $this->container['words'] = $data['words'] ?? null; + $this->container['decomposition'] = $data['decomposition'] ?? null; + $this->container['state'] = $data['state'] ?? 'enabled'; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if ($this->container['language'] === null) { + $invalidProperties[] = "'language' can't be null"; + } + $allowedValues = $this->getStateAllowableValues(); + if (!is_null($this->container['state']) && !in_array($this->container['state'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'state', must be one of '%s'", + $this->container['state'], + implode("', '", $allowedValues) + ); + } + + 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 objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string $objectID Unique identifier of the object. + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language Language ISO code supported by the dictionary (e.g., \"en\" for English). + * + * @return self + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets word + * + * @return string|null + */ + public function getWord() + { + return $this->container['word']; + } + + /** + * Sets word + * + * @param string|null $word The word of the dictionary entry. + * + * @return self + */ + public function setWord($word) + { + $this->container['word'] = $word; + + return $this; + } + + /** + * Gets words + * + * @return string[]|null + */ + public function getWords() + { + return $this->container['words']; + } + + /** + * Sets words + * + * @param string[]|null $words The words of the dictionary entry. + * + * @return self + */ + public function setWords($words) + { + $this->container['words'] = $words; + + return $this; + } + + /** + * Gets decomposition + * + * @return string[]|null + */ + public function getDecomposition() + { + return $this->container['decomposition']; + } + + /** + * Sets decomposition + * + * @param string[]|null $decomposition A decomposition of the word of the dictionary entry. + * + * @return self + */ + public function setDecomposition($decomposition) + { + $this->container['decomposition'] = $decomposition; + + return $this; + } + + /** + * Gets state + * + * @return string|null + */ + public function getState() + { + return $this->container['state']; + } + + /** + * Sets state + * + * @param string|null $state The state of the dictionary entry. + * + * @return self + */ + public function setState($state) + { + $allowedValues = $this->getStateAllowableValues(); + if (!is_null($state) && !in_array($state, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'state', must be one of '%s'", + $state, + implode("', '", $allowedValues) + ) + ); + } + $this->container['state'] = $state; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/DictionaryLanguage.php b/clients/algoliasearch-client-php/lib/Model/DictionaryLanguage.php new file mode 100644 index 0000000000..a35e519a75 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/DictionaryLanguage.php @@ -0,0 +1,321 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DictionaryLanguage implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'dictionaryLanguage'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'nbCustomEntires' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'nbCustomEntires' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'nbCustomEntires' => 'nbCustomEntires' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'nbCustomEntires' => 'setNbCustomEntires' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'nbCustomEntires' => 'getNbCustomEntires' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['nbCustomEntires'] = $data['nbCustomEntires'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 nbCustomEntires + * + * @return int|null + */ + public function getNbCustomEntires() + { + return $this->container['nbCustomEntires']; + } + + /** + * Sets nbCustomEntires + * + * @param int|null $nbCustomEntires When nbCustomEntries is set to 0, the user didn't customize the dictionary. The dictionary is still supported with standard, Algolia-provided entries. + * + * @return self + */ + public function setNbCustomEntires($nbCustomEntires) + { + $this->container['nbCustomEntires'] = $nbCustomEntires; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/DictionarySettingsRequest.php b/clients/algoliasearch-client-php/lib/Model/DictionarySettingsRequest.php new file mode 100644 index 0000000000..2ae285a938 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/DictionarySettingsRequest.php @@ -0,0 +1,324 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DictionarySettingsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'dictionarySettingsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'disableStandardEntries' => '\Algolia\AlgoliaSearch\Model\StandardEntries' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'disableStandardEntries' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'disableStandardEntries' => 'disableStandardEntries' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'disableStandardEntries' => 'setDisableStandardEntries' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'disableStandardEntries' => 'getDisableStandardEntries' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['disableStandardEntries'] = $data['disableStandardEntries'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['disableStandardEntries'] === null) { + $invalidProperties[] = "'disableStandardEntries' 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 disableStandardEntries + * + * @return \Algolia\AlgoliaSearch\Model\StandardEntries + */ + public function getDisableStandardEntries() + { + return $this->container['disableStandardEntries']; + } + + /** + * Sets disableStandardEntries + * + * @param \Algolia\AlgoliaSearch\Model\StandardEntries $disableStandardEntries disableStandardEntries + * + * @return self + */ + public function setDisableStandardEntries($disableStandardEntries) + { + $this->container['disableStandardEntries'] = $disableStandardEntries; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/ErrorBase.php b/clients/algoliasearch-client-php/lib/Model/ErrorBase.php new file mode 100644 index 0000000000..98300434b8 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/ErrorBase.php @@ -0,0 +1,321 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ErrorBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ErrorBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/GetDictionarySettingsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetDictionarySettingsResponse.php new file mode 100644 index 0000000000..2a5405a2d8 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetDictionarySettingsResponse.php @@ -0,0 +1,323 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetDictionarySettingsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getDictionarySettingsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'disableStandardEntries' => '\Algolia\AlgoliaSearch\Model\StandardEntries' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'disableStandardEntries' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'disableStandardEntries' => 'disableStandardEntries' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'disableStandardEntries' => 'setDisableStandardEntries' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'disableStandardEntries' => 'getDisableStandardEntries' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['disableStandardEntries'] = $data['disableStandardEntries'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['disableStandardEntries'] === null) { + $invalidProperties[] = "'disableStandardEntries' 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 disableStandardEntries + * + * @return \Algolia\AlgoliaSearch\Model\StandardEntries + */ + public function getDisableStandardEntries() + { + return $this->container['disableStandardEntries']; + } + + /** + * Sets disableStandardEntries + * + * @param \Algolia\AlgoliaSearch\Model\StandardEntries $disableStandardEntries disableStandardEntries + * + * @return self + */ + public function setDisableStandardEntries($disableStandardEntries) + { + $this->container['disableStandardEntries'] = $disableStandardEntries; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php new file mode 100644 index 0000000000..b468af9f20 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php @@ -0,0 +1,323 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetLogsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getLogsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'logs' => '\Algolia\AlgoliaSearch\Model\GetLogsResponseLogs[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'logs' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'logs' => 'logs' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'logs' => 'setLogs' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'logs' => 'getLogs' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['logs'] = $data['logs'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['logs'] === null) { + $invalidProperties[] = "'logs' 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 logs + * + * @return \Algolia\AlgoliaSearch\Model\GetLogsResponseLogs[] + */ + public function getLogs() + { + return $this->container['logs']; + } + + /** + * Sets logs + * + * @param \Algolia\AlgoliaSearch\Model\GetLogsResponseLogs[] $logs logs + * + * @return self + */ + public function setLogs($logs) + { + $this->container['logs'] = $logs; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php b/clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php new file mode 100644 index 0000000000..a482907374 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php @@ -0,0 +1,380 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetLogsResponseInnerQueries implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getLogsResponse_inner_queries'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'indexName' => 'string', + 'userToken' => 'string', + 'queryId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'indexName' => null, + 'userToken' => null, + 'queryId' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'indexName' => 'index_name', + 'userToken' => 'user_token', + 'queryId' => 'query_id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + 'userToken' => 'setUserToken', + 'queryId' => 'setQueryId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'indexName' => 'getIndexName', + 'userToken' => 'getUserToken', + 'queryId' => 'getQueryId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['indexName'] = $data['indexName'] ?? null; + $this->container['userToken'] = $data['userToken'] ?? null; + $this->container['queryId'] = $data['queryId'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 indexName + * + * @return string|null + */ + public function getIndexName() + { + return $this->container['indexName']; + } + + /** + * Sets indexName + * + * @param string|null $indexName Index targeted by the query. + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets userToken + * + * @return string|null + */ + public function getUserToken() + { + return $this->container['userToken']; + } + + /** + * Sets userToken + * + * @param string|null $userToken User identifier. + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets queryId + * + * @return string|null + */ + public function getQueryId() + { + return $this->container['queryId']; + } + + /** + * Sets queryId + * + * @param string|null $queryId QueryID for the given query. + * + * @return self + */ + public function setQueryId($queryId) + { + $this->container['queryId'] = $queryId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/GetLogsResponseLogs.php b/clients/algoliasearch-client-php/lib/Model/GetLogsResponseLogs.php new file mode 100644 index 0000000000..2f90ed8771 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetLogsResponseLogs.php @@ -0,0 +1,773 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetLogsResponseLogs implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getLogsResponse_logs'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'timestamp' => 'string', + 'method' => 'string', + 'answerCode' => 'string', + 'queryBody' => 'string', + 'answer' => 'string', + 'url' => 'string', + 'ip' => 'string', + 'queryHeaders' => 'string', + 'sha1' => 'string', + 'nbApiCalls' => 'string', + 'processingTimeMs' => 'string', + 'index' => 'string', + 'queryParams' => 'string', + 'queryNbHits' => 'string', + 'innerQueries' => '\Algolia\AlgoliaSearch\Model\GetLogsResponseInnerQueries[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'timestamp' => null, + 'method' => null, + 'answerCode' => null, + 'queryBody' => null, + 'answer' => null, + 'url' => null, + 'ip' => null, + 'queryHeaders' => null, + 'sha1' => null, + 'nbApiCalls' => null, + 'processingTimeMs' => null, + 'index' => null, + 'queryParams' => null, + 'queryNbHits' => null, + 'innerQueries' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'timestamp' => 'timestamp', + 'method' => 'method', + 'answerCode' => 'answer_code', + 'queryBody' => 'query_body', + 'answer' => 'answer', + 'url' => 'url', + 'ip' => 'ip', + 'queryHeaders' => 'query_headers', + 'sha1' => 'sha1', + 'nbApiCalls' => 'nb_api_calls', + 'processingTimeMs' => 'processing_time_ms', + 'index' => 'index', + 'queryParams' => 'query_params', + 'queryNbHits' => 'query_nb_hits', + 'innerQueries' => 'inner_queries' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'timestamp' => 'setTimestamp', + 'method' => 'setMethod', + 'answerCode' => 'setAnswerCode', + 'queryBody' => 'setQueryBody', + 'answer' => 'setAnswer', + 'url' => 'setUrl', + 'ip' => 'setIp', + 'queryHeaders' => 'setQueryHeaders', + 'sha1' => 'setSha1', + 'nbApiCalls' => 'setNbApiCalls', + 'processingTimeMs' => 'setProcessingTimeMs', + 'index' => 'setIndex', + 'queryParams' => 'setQueryParams', + 'queryNbHits' => 'setQueryNbHits', + 'innerQueries' => 'setInnerQueries' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'timestamp' => 'getTimestamp', + 'method' => 'getMethod', + 'answerCode' => 'getAnswerCode', + 'queryBody' => 'getQueryBody', + 'answer' => 'getAnswer', + 'url' => 'getUrl', + 'ip' => 'getIp', + 'queryHeaders' => 'getQueryHeaders', + 'sha1' => 'getSha1', + 'nbApiCalls' => 'getNbApiCalls', + 'processingTimeMs' => 'getProcessingTimeMs', + 'index' => 'getIndex', + 'queryParams' => 'getQueryParams', + 'queryNbHits' => 'getQueryNbHits', + 'innerQueries' => 'getInnerQueries' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['timestamp'] = $data['timestamp'] ?? null; + $this->container['method'] = $data['method'] ?? null; + $this->container['answerCode'] = $data['answerCode'] ?? null; + $this->container['queryBody'] = $data['queryBody'] ?? null; + $this->container['answer'] = $data['answer'] ?? null; + $this->container['url'] = $data['url'] ?? null; + $this->container['ip'] = $data['ip'] ?? null; + $this->container['queryHeaders'] = $data['queryHeaders'] ?? null; + $this->container['sha1'] = $data['sha1'] ?? null; + $this->container['nbApiCalls'] = $data['nbApiCalls'] ?? null; + $this->container['processingTimeMs'] = $data['processingTimeMs'] ?? null; + $this->container['index'] = $data['index'] ?? null; + $this->container['queryParams'] = $data['queryParams'] ?? null; + $this->container['queryNbHits'] = $data['queryNbHits'] ?? null; + $this->container['innerQueries'] = $data['innerQueries'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if ($this->container['method'] === null) { + $invalidProperties[] = "'method' can't be null"; + } + if ($this->container['answerCode'] === null) { + $invalidProperties[] = "'answerCode' can't be null"; + } + if ($this->container['queryBody'] === null) { + $invalidProperties[] = "'queryBody' can't be null"; + } + if ($this->container['answer'] === null) { + $invalidProperties[] = "'answer' can't be null"; + } + if ($this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + if ($this->container['ip'] === null) { + $invalidProperties[] = "'ip' can't be null"; + } + if ($this->container['queryHeaders'] === null) { + $invalidProperties[] = "'queryHeaders' can't be null"; + } + if ($this->container['sha1'] === null) { + $invalidProperties[] = "'sha1' can't be null"; + } + if ($this->container['nbApiCalls'] === null) { + $invalidProperties[] = "'nbApiCalls' can't be null"; + } + if ($this->container['processingTimeMs'] === null) { + $invalidProperties[] = "'processingTimeMs' 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 timestamp + * + * @return string + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param string $timestamp Timestamp in ISO-8601 format. + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets method + * + * @return string + */ + public function getMethod() + { + return $this->container['method']; + } + + /** + * Sets method + * + * @param string $method HTTP method of the perfomed request. + * + * @return self + */ + public function setMethod($method) + { + $this->container['method'] = $method; + + return $this; + } + + /** + * Gets answerCode + * + * @return string + */ + public function getAnswerCode() + { + return $this->container['answerCode']; + } + + /** + * Sets answerCode + * + * @param string $answerCode HTTP response code. + * + * @return self + */ + public function setAnswerCode($answerCode) + { + $this->container['answerCode'] = $answerCode; + + return $this; + } + + /** + * Gets queryBody + * + * @return string + */ + public function getQueryBody() + { + return $this->container['queryBody']; + } + + /** + * Sets queryBody + * + * @param string $queryBody Request body. Truncated after 1000 characters. + * + * @return self + */ + public function setQueryBody($queryBody) + { + $this->container['queryBody'] = $queryBody; + + return $this; + } + + /** + * Gets answer + * + * @return string + */ + public function getAnswer() + { + return $this->container['answer']; + } + + /** + * Sets answer + * + * @param string $answer Answer body. Truncated after 1000 characters. + * + * @return self + */ + public function setAnswer($answer) + { + $this->container['answer'] = $answer; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url']; + } + + /** + * Sets url + * + * @param string $url Request URL. + * + * @return self + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets ip + * + * @return string + */ + public function getIp() + { + return $this->container['ip']; + } + + /** + * Sets ip + * + * @param string $ip IP of the client which perfomed the request. + * + * @return self + */ + public function setIp($ip) + { + $this->container['ip'] = $ip; + + return $this; + } + + /** + * Gets queryHeaders + * + * @return string + */ + public function getQueryHeaders() + { + return $this->container['queryHeaders']; + } + + /** + * Sets queryHeaders + * + * @param string $queryHeaders Request Headers (API Key is obfuscated). + * + * @return self + */ + public function setQueryHeaders($queryHeaders) + { + $this->container['queryHeaders'] = $queryHeaders; + + return $this; + } + + /** + * Gets sha1 + * + * @return string + */ + public function getSha1() + { + return $this->container['sha1']; + } + + /** + * Sets sha1 + * + * @param string $sha1 SHA1 signature of the log entry. + * + * @return self + */ + public function setSha1($sha1) + { + $this->container['sha1'] = $sha1; + + return $this; + } + + /** + * Gets nbApiCalls + * + * @return string + */ + public function getNbApiCalls() + { + return $this->container['nbApiCalls']; + } + + /** + * Sets nbApiCalls + * + * @param string $nbApiCalls Number of API calls. + * + * @return self + */ + public function setNbApiCalls($nbApiCalls) + { + $this->container['nbApiCalls'] = $nbApiCalls; + + return $this; + } + + /** + * Gets processingTimeMs + * + * @return string + */ + public function getProcessingTimeMs() + { + return $this->container['processingTimeMs']; + } + + /** + * Sets processingTimeMs + * + * @param string $processingTimeMs Processing time for the query. It doesn't include network time. + * + * @return self + */ + public function setProcessingTimeMs($processingTimeMs) + { + $this->container['processingTimeMs'] = $processingTimeMs; + + return $this; + } + + /** + * Gets index + * + * @return string|null + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param string|null $index Index targeted by the query. + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets queryParams + * + * @return string|null + */ + public function getQueryParams() + { + return $this->container['queryParams']; + } + + /** + * Sets queryParams + * + * @param string|null $queryParams Query parameters sent with the request. + * + * @return self + */ + public function setQueryParams($queryParams) + { + $this->container['queryParams'] = $queryParams; + + return $this; + } + + /** + * Gets queryNbHits + * + * @return string|null + */ + public function getQueryNbHits() + { + return $this->container['queryNbHits']; + } + + /** + * Sets queryNbHits + * + * @param string|null $queryNbHits Number of hits returned for the query. + * + * @return self + */ + public function setQueryNbHits($queryNbHits) + { + $this->container['queryNbHits'] = $queryNbHits; + + return $this; + } + + /** + * Gets innerQueries + * + * @return \Algolia\AlgoliaSearch\Model\GetLogsResponseInnerQueries[]|null + */ + public function getInnerQueries() + { + return $this->container['innerQueries']; + } + + /** + * Sets innerQueries + * + * @param \Algolia\AlgoliaSearch\Model\GetLogsResponseInnerQueries[]|null $innerQueries Array of all performed queries for the given request. + * + * @return self + */ + public function setInnerQueries($innerQueries) + { + $this->container['innerQueries'] = $innerQueries; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php b/clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php new file mode 100644 index 0000000000..9b76770799 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php @@ -0,0 +1,321 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetObjectsObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getObjectsObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'requests' => '\Algolia\AlgoliaSearch\Model\MultipleGetObjectsObject[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'requests' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'requests' => 'requests' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['requests'] = $data['requests'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 requests + * + * @return \Algolia\AlgoliaSearch\Model\MultipleGetObjectsObject[]|null + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\MultipleGetObjectsObject[]|null $requests requests + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php new file mode 100644 index 0000000000..da1bdf3842 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php @@ -0,0 +1,320 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetObjectsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getObjectsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => 'array[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['results'] = $data['results'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 results + * + * @return array[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param array[]|null $results List of results fetched. + * + * @return self + */ + public function setResults($results) + { + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTaskResponse.php b/clients/algoliasearch-client-php/lib/Model/GetTaskResponse.php new file mode 100644 index 0000000000..5f8b468df3 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTaskResponse.php @@ -0,0 +1,357 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTaskResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTaskResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const STATUS_PUBLISHED = 'published'; + const STATUS_NOT_PUBLISHED = 'notPublished'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_PUBLISHED, + self::STATUS_NOT_PUBLISHED, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['status'] = $data['status'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + 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 string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopUserIdsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetTopUserIdsResponse.php new file mode 100644 index 0000000000..49fd97006e --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopUserIdsResponse.php @@ -0,0 +1,324 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopUserIdsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopUserIdsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'topUsers' => 'array[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'topUsers' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'topUsers' => 'topUsers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'topUsers' => 'setTopUsers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'topUsers' => 'getTopUsers' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['topUsers'] = $data['topUsers'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['topUsers'] === null) { + $invalidProperties[] = "'topUsers' 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 topUsers + * + * @return array[] + */ + public function getTopUsers() + { + return $this->container['topUsers']; + } + + /** + * Sets topUsers + * + * @param array[] $topUsers Mapping of cluster names to top users. + * + * @return self + */ + public function setTopUsers($topUsers) + { + $this->container['topUsers'] = $topUsers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/HighlightResult.php b/clients/algoliasearch-client-php/lib/Model/HighlightResult.php new file mode 100644 index 0000000000..97e837b72d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/HighlightResult.php @@ -0,0 +1,447 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class HighlightResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'highlightResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'value' => 'string', + 'matchLevel' => 'string', + 'matchedWords' => 'string[]', + 'fullyHighlighted' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'matchLevel' => null, + 'matchedWords' => null, + 'fullyHighlighted' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'matchLevel' => 'matchLevel', + 'matchedWords' => 'matchedWords', + 'fullyHighlighted' => 'fullyHighlighted' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'matchLevel' => 'setMatchLevel', + 'matchedWords' => 'setMatchedWords', + 'fullyHighlighted' => 'setFullyHighlighted' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'matchLevel' => 'getMatchLevel', + 'matchedWords' => 'getMatchedWords', + 'fullyHighlighted' => 'getFullyHighlighted' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const MATCH_LEVEL_NONE = 'none'; + const MATCH_LEVEL_PARTIAL = 'partial'; + const MATCH_LEVEL_FULL = 'full'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMatchLevelAllowableValues() + { + return [ + self::MATCH_LEVEL_NONE, + self::MATCH_LEVEL_PARTIAL, + self::MATCH_LEVEL_FULL, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + $this->container['matchLevel'] = $data['matchLevel'] ?? null; + $this->container['matchedWords'] = $data['matchedWords'] ?? null; + $this->container['fullyHighlighted'] = $data['fullyHighlighted'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMatchLevelAllowableValues(); + if (!is_null($this->container['matchLevel']) && !in_array($this->container['matchLevel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'matchLevel', must be one of '%s'", + $this->container['matchLevel'], + implode("', '", $allowedValues) + ); + } + + 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 value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value Markup text with occurrences highlighted. + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matchLevel + * + * @return string|null + */ + public function getMatchLevel() + { + return $this->container['matchLevel']; + } + + /** + * Sets matchLevel + * + * @param string|null $matchLevel Indicates how well the attribute matched the search query. + * + * @return self + */ + public function setMatchLevel($matchLevel) + { + $allowedValues = $this->getMatchLevelAllowableValues(); + if (!is_null($matchLevel) && !in_array($matchLevel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'matchLevel', must be one of '%s'", + $matchLevel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['matchLevel'] = $matchLevel; + + return $this; + } + + /** + * Gets matchedWords + * + * @return string[]|null + */ + public function getMatchedWords() + { + return $this->container['matchedWords']; + } + + /** + * Sets matchedWords + * + * @param string[]|null $matchedWords List of words from the query that matched the object. + * + * @return self + */ + public function setMatchedWords($matchedWords) + { + $this->container['matchedWords'] = $matchedWords; + + return $this; + } + + /** + * Gets fullyHighlighted + * + * @return bool|null + */ + public function getFullyHighlighted() + { + return $this->container['fullyHighlighted']; + } + + /** + * Sets fullyHighlighted + * + * @param bool|null $fullyHighlighted Whether the entire attribute value is highlighted. + * + * @return self + */ + public function setFullyHighlighted($fullyHighlighted) + { + $this->container['fullyHighlighted'] = $fullyHighlighted; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/Index.php b/clients/algoliasearch-client-php/lib/Model/Index.php new file mode 100644 index 0000000000..f559b89d5f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Index.php @@ -0,0 +1,644 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Index implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'index'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'createdAt' => '\DateTime', + 'updatedAt' => '\DateTime', + '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[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'createdAt' => 'date-time', + 'updatedAt' => 'date-time', + '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 openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'createdAt' => 'createdAt', + 'updatedAt' => 'updatedAt', + 'entries' => 'entries', + 'dataSize' => 'dataSize', + 'fileSize' => 'fileSize', + 'lastBuildTimeS' => 'lastBuildTimeS', + 'numberOfPendingTask' => 'numberOfPendingTask', + 'pendingTask' => 'pendingTask', + 'primary' => 'primary', + 'replicas' => 'replicas' + ]; + + /** + * 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 where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['createdAt'] = $data['createdAt'] ?? null; + $this->container['updatedAt'] = $data['updatedAt'] ?? null; + $this->container['entries'] = $data['entries'] ?? null; + $this->container['dataSize'] = $data['dataSize'] ?? null; + $this->container['fileSize'] = $data['fileSize'] ?? null; + $this->container['lastBuildTimeS'] = $data['lastBuildTimeS'] ?? null; + $this->container['numberOfPendingTask'] = $data['numberOfPendingTask'] ?? null; + $this->container['pendingTask'] = $data['pendingTask'] ?? null; + $this->container['primary'] = $data['primary'] ?? null; + $this->container['replicas'] = $data['replicas'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' can't be null"; + } + if ($this->container['entries'] === null) { + $invalidProperties[] = "'entries' can't be null"; + } + if ($this->container['dataSize'] === null) { + $invalidProperties[] = "'dataSize' can't be null"; + } + if ($this->container['fileSize'] === null) { + $invalidProperties[] = "'fileSize' can't be null"; + } + if ($this->container['lastBuildTimeS'] === null) { + $invalidProperties[] = "'lastBuildTimeS' can't be null"; + } + if ($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']; + } + + /** + * Sets name + * + * @param string $name Index name. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $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 \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime $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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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 integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/IndexSettings.php b/clients/algoliasearch-client-php/lib/Model/IndexSettings.php new file mode 100644 index 0000000000..17caf45d65 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/IndexSettings.php @@ -0,0 +1,2210 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class IndexSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'indexSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'replicas' => 'string[]', + 'paginationLimitedTo' => 'int', + 'disableTypoToleranceOnWords' => 'string[]', + 'attributesToTransliterate' => 'string[]', + 'camelCaseAttributes' => 'string[]', + 'decompoundedAttributes' => 'array', + 'indexLanguages' => 'string[]', + 'filterPromotes' => 'bool', + 'disablePrefixOnAttributes' => 'string[]', + 'allowCompressionOfIntegerArray' => 'bool', + 'numericAttributesForFiltering' => 'string[]', + 'userData' => 'array', + 'searchableAttributes' => 'string[]', + 'attributesForFaceting' => 'string[]', + 'unretrievableAttributes' => 'string[]', + 'attributesToRetrieve' => 'string[]', + 'restrictSearchableAttributes' => 'string[]', + 'ranking' => 'string[]', + 'customRanking' => 'string[]', + 'relevancyStrictness' => 'int', + 'attributesToHighlight' => 'string[]', + 'attributesToSnippet' => 'string[]', + 'highlightPreTag' => 'string', + 'highlightPostTag' => 'string', + 'snippetEllipsisText' => 'string', + 'restrictHighlightAndSnippetArrays' => 'bool', + 'hitsPerPage' => 'int', + 'minWordSizefor1Typo' => 'int', + 'minWordSizefor2Typos' => 'int', + 'typoTolerance' => 'string', + 'allowTyposOnNumericTokens' => 'bool', + 'disableTypoToleranceOnAttributes' => 'string[]', + 'separatorsToIndex' => 'string', + 'ignorePlurals' => 'string', + 'removeStopWords' => 'string', + 'keepDiacriticsOnCharacters' => 'string', + 'queryLanguages' => 'string[]', + 'decompoundQuery' => 'bool', + 'enableRules' => 'bool', + 'enablePersonalization' => 'bool', + 'queryType' => 'string', + 'removeWordsIfNoResults' => 'string', + 'advancedSyntax' => 'bool', + 'optionalWords' => 'string[]', + 'disableExactOnAttributes' => 'string[]', + 'exactOnSingleWordQuery' => 'string', + 'alternativesAsExact' => 'string[]', + 'advancedSyntaxFeatures' => 'string[]', + 'distinct' => 'int', + 'synonyms' => 'bool', + 'replaceSynonymsInHighlight' => 'bool', + 'minProximity' => 'int', + 'responseFields' => 'string[]', + 'maxFacetHits' => 'int', + 'attributeCriteriaComputedByMinProximity' => 'bool', + 'renderingContent' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'replicas' => null, + 'paginationLimitedTo' => null, + 'disableTypoToleranceOnWords' => null, + 'attributesToTransliterate' => null, + 'camelCaseAttributes' => null, + 'decompoundedAttributes' => null, + 'indexLanguages' => null, + 'filterPromotes' => null, + 'disablePrefixOnAttributes' => null, + 'allowCompressionOfIntegerArray' => null, + 'numericAttributesForFiltering' => null, + 'userData' => null, + 'searchableAttributes' => null, + 'attributesForFaceting' => null, + 'unretrievableAttributes' => null, + 'attributesToRetrieve' => null, + 'restrictSearchableAttributes' => null, + 'ranking' => null, + 'customRanking' => null, + 'relevancyStrictness' => null, + 'attributesToHighlight' => null, + 'attributesToSnippet' => null, + 'highlightPreTag' => null, + 'highlightPostTag' => null, + 'snippetEllipsisText' => null, + 'restrictHighlightAndSnippetArrays' => null, + 'hitsPerPage' => null, + 'minWordSizefor1Typo' => null, + 'minWordSizefor2Typos' => null, + 'typoTolerance' => null, + 'allowTyposOnNumericTokens' => null, + 'disableTypoToleranceOnAttributes' => null, + 'separatorsToIndex' => null, + 'ignorePlurals' => null, + 'removeStopWords' => null, + 'keepDiacriticsOnCharacters' => null, + 'queryLanguages' => null, + 'decompoundQuery' => null, + 'enableRules' => null, + 'enablePersonalization' => null, + 'queryType' => null, + 'removeWordsIfNoResults' => null, + 'advancedSyntax' => null, + 'optionalWords' => null, + 'disableExactOnAttributes' => null, + 'exactOnSingleWordQuery' => null, + 'alternativesAsExact' => null, + 'advancedSyntaxFeatures' => null, + 'distinct' => null, + 'synonyms' => null, + 'replaceSynonymsInHighlight' => null, + 'minProximity' => null, + 'responseFields' => null, + 'maxFacetHits' => null, + 'attributeCriteriaComputedByMinProximity' => null, + 'renderingContent' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'replicas' => 'replicas', + 'paginationLimitedTo' => 'paginationLimitedTo', + 'disableTypoToleranceOnWords' => 'disableTypoToleranceOnWords', + 'attributesToTransliterate' => 'attributesToTransliterate', + 'camelCaseAttributes' => 'camelCaseAttributes', + 'decompoundedAttributes' => 'decompoundedAttributes', + 'indexLanguages' => 'indexLanguages', + 'filterPromotes' => 'filterPromotes', + 'disablePrefixOnAttributes' => 'disablePrefixOnAttributes', + 'allowCompressionOfIntegerArray' => 'allowCompressionOfIntegerArray', + 'numericAttributesForFiltering' => 'numericAttributesForFiltering', + 'userData' => 'userData', + 'searchableAttributes' => 'searchableAttributes', + 'attributesForFaceting' => 'attributesForFaceting', + 'unretrievableAttributes' => 'unretrievableAttributes', + 'attributesToRetrieve' => 'attributesToRetrieve', + 'restrictSearchableAttributes' => 'restrictSearchableAttributes', + 'ranking' => 'ranking', + 'customRanking' => 'customRanking', + 'relevancyStrictness' => 'relevancyStrictness', + 'attributesToHighlight' => 'attributesToHighlight', + 'attributesToSnippet' => 'attributesToSnippet', + 'highlightPreTag' => 'highlightPreTag', + 'highlightPostTag' => 'highlightPostTag', + 'snippetEllipsisText' => 'snippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'restrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'hitsPerPage', + 'minWordSizefor1Typo' => 'minWordSizefor1Typo', + 'minWordSizefor2Typos' => 'minWordSizefor2Typos', + 'typoTolerance' => 'typoTolerance', + 'allowTyposOnNumericTokens' => 'allowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'disableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'separatorsToIndex', + 'ignorePlurals' => 'ignorePlurals', + 'removeStopWords' => 'removeStopWords', + 'keepDiacriticsOnCharacters' => 'keepDiacriticsOnCharacters', + 'queryLanguages' => 'queryLanguages', + 'decompoundQuery' => 'decompoundQuery', + 'enableRules' => 'enableRules', + 'enablePersonalization' => 'enablePersonalization', + 'queryType' => 'queryType', + 'removeWordsIfNoResults' => 'removeWordsIfNoResults', + 'advancedSyntax' => 'advancedSyntax', + 'optionalWords' => 'optionalWords', + 'disableExactOnAttributes' => 'disableExactOnAttributes', + 'exactOnSingleWordQuery' => 'exactOnSingleWordQuery', + 'alternativesAsExact' => 'alternativesAsExact', + 'advancedSyntaxFeatures' => 'advancedSyntaxFeatures', + 'distinct' => 'distinct', + 'synonyms' => 'synonyms', + 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', + 'minProximity' => 'minProximity', + 'responseFields' => 'responseFields', + 'maxFacetHits' => 'maxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', + 'renderingContent' => 'renderingContent' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'replicas' => 'setReplicas', + 'paginationLimitedTo' => 'setPaginationLimitedTo', + 'disableTypoToleranceOnWords' => 'setDisableTypoToleranceOnWords', + 'attributesToTransliterate' => 'setAttributesToTransliterate', + 'camelCaseAttributes' => 'setCamelCaseAttributes', + 'decompoundedAttributes' => 'setDecompoundedAttributes', + 'indexLanguages' => 'setIndexLanguages', + 'filterPromotes' => 'setFilterPromotes', + 'disablePrefixOnAttributes' => 'setDisablePrefixOnAttributes', + 'allowCompressionOfIntegerArray' => 'setAllowCompressionOfIntegerArray', + 'numericAttributesForFiltering' => 'setNumericAttributesForFiltering', + 'userData' => 'setUserData', + 'searchableAttributes' => 'setSearchableAttributes', + 'attributesForFaceting' => 'setAttributesForFaceting', + 'unretrievableAttributes' => 'setUnretrievableAttributes', + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'restrictSearchableAttributes' => 'setRestrictSearchableAttributes', + 'ranking' => 'setRanking', + 'customRanking' => 'setCustomRanking', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'attributesToHighlight' => 'setAttributesToHighlight', + 'attributesToSnippet' => 'setAttributesToSnippet', + 'highlightPreTag' => 'setHighlightPreTag', + 'highlightPostTag' => 'setHighlightPostTag', + 'snippetEllipsisText' => 'setSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'setRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'setHitsPerPage', + 'minWordSizefor1Typo' => 'setMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'setMinWordSizefor2Typos', + 'typoTolerance' => 'setTypoTolerance', + 'allowTyposOnNumericTokens' => 'setAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'setDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'setSeparatorsToIndex', + 'ignorePlurals' => 'setIgnorePlurals', + 'removeStopWords' => 'setRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'setKeepDiacriticsOnCharacters', + 'queryLanguages' => 'setQueryLanguages', + 'decompoundQuery' => 'setDecompoundQuery', + 'enableRules' => 'setEnableRules', + 'enablePersonalization' => 'setEnablePersonalization', + 'queryType' => 'setQueryType', + 'removeWordsIfNoResults' => 'setRemoveWordsIfNoResults', + 'advancedSyntax' => 'setAdvancedSyntax', + 'optionalWords' => 'setOptionalWords', + 'disableExactOnAttributes' => 'setDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'setExactOnSingleWordQuery', + 'alternativesAsExact' => 'setAlternativesAsExact', + 'advancedSyntaxFeatures' => 'setAdvancedSyntaxFeatures', + 'distinct' => 'setDistinct', + 'synonyms' => 'setSynonyms', + 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', + 'minProximity' => 'setMinProximity', + 'responseFields' => 'setResponseFields', + 'maxFacetHits' => 'setMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'setRenderingContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'replicas' => 'getReplicas', + 'paginationLimitedTo' => 'getPaginationLimitedTo', + 'disableTypoToleranceOnWords' => 'getDisableTypoToleranceOnWords', + 'attributesToTransliterate' => 'getAttributesToTransliterate', + 'camelCaseAttributes' => 'getCamelCaseAttributes', + 'decompoundedAttributes' => 'getDecompoundedAttributes', + 'indexLanguages' => 'getIndexLanguages', + 'filterPromotes' => 'getFilterPromotes', + 'disablePrefixOnAttributes' => 'getDisablePrefixOnAttributes', + 'allowCompressionOfIntegerArray' => 'getAllowCompressionOfIntegerArray', + 'numericAttributesForFiltering' => 'getNumericAttributesForFiltering', + 'userData' => 'getUserData', + 'searchableAttributes' => 'getSearchableAttributes', + 'attributesForFaceting' => 'getAttributesForFaceting', + 'unretrievableAttributes' => 'getUnretrievableAttributes', + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'restrictSearchableAttributes' => 'getRestrictSearchableAttributes', + 'ranking' => 'getRanking', + 'customRanking' => 'getCustomRanking', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'attributesToHighlight' => 'getAttributesToHighlight', + 'attributesToSnippet' => 'getAttributesToSnippet', + 'highlightPreTag' => 'getHighlightPreTag', + 'highlightPostTag' => 'getHighlightPostTag', + 'snippetEllipsisText' => 'getSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'getRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'getHitsPerPage', + 'minWordSizefor1Typo' => 'getMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'getMinWordSizefor2Typos', + 'typoTolerance' => 'getTypoTolerance', + 'allowTyposOnNumericTokens' => 'getAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'getDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'getSeparatorsToIndex', + 'ignorePlurals' => 'getIgnorePlurals', + 'removeStopWords' => 'getRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'getKeepDiacriticsOnCharacters', + 'queryLanguages' => 'getQueryLanguages', + 'decompoundQuery' => 'getDecompoundQuery', + 'enableRules' => 'getEnableRules', + 'enablePersonalization' => 'getEnablePersonalization', + 'queryType' => 'getQueryType', + 'removeWordsIfNoResults' => 'getRemoveWordsIfNoResults', + 'advancedSyntax' => 'getAdvancedSyntax', + 'optionalWords' => 'getOptionalWords', + 'disableExactOnAttributes' => 'getDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'getExactOnSingleWordQuery', + 'alternativesAsExact' => 'getAlternativesAsExact', + 'advancedSyntaxFeatures' => 'getAdvancedSyntaxFeatures', + 'distinct' => 'getDistinct', + 'synonyms' => 'getSynonyms', + 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', + 'minProximity' => 'getMinProximity', + 'responseFields' => 'getResponseFields', + 'maxFacetHits' => 'getMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'getRenderingContent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const TYPO_TOLERANCE_TRUE = 'true'; + const TYPO_TOLERANCE_FALSE = 'false'; + const TYPO_TOLERANCE_MIN = 'min'; + const TYPO_TOLERANCE_STRICT = 'strict'; + const QUERY_TYPE_PREFIX_LAST = 'prefixLast'; + const QUERY_TYPE_PREFIX_ALL = 'prefixAll'; + const QUERY_TYPE_PREFIX_NONE = 'prefixNone'; + const REMOVE_WORDS_IF_NO_RESULTS_NONE = 'none'; + const REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS = 'lastWords'; + const REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS = 'firstWords'; + const REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL = 'allOptional'; + const EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE = 'attribute'; + const EXACT_ON_SINGLE_WORD_QUERY_NONE = 'none'; + const EXACT_ON_SINGLE_WORD_QUERY_WORD = 'word'; + const ALTERNATIVES_AS_EXACT_IGNORE_PLURALS = 'ignorePlurals'; + const ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM = 'singleWordSynonym'; + const ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM = 'multiWordsSynonym'; + const ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE = 'exactPhrase'; + const ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS = 'excludeWords'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypoToleranceAllowableValues() + { + return [ + self::TYPO_TOLERANCE_TRUE, + self::TYPO_TOLERANCE_FALSE, + self::TYPO_TOLERANCE_MIN, + self::TYPO_TOLERANCE_STRICT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getQueryTypeAllowableValues() + { + return [ + self::QUERY_TYPE_PREFIX_LAST, + self::QUERY_TYPE_PREFIX_ALL, + self::QUERY_TYPE_PREFIX_NONE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemoveWordsIfNoResultsAllowableValues() + { + return [ + self::REMOVE_WORDS_IF_NO_RESULTS_NONE, + self::REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExactOnSingleWordQueryAllowableValues() + { + return [ + self::EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE, + self::EXACT_ON_SINGLE_WORD_QUERY_NONE, + self::EXACT_ON_SINGLE_WORD_QUERY_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAlternativesAsExactAllowableValues() + { + return [ + self::ALTERNATIVES_AS_EXACT_IGNORE_PLURALS, + self::ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM, + self::ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdvancedSyntaxFeaturesAllowableValues() + { + return [ + self::ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE, + self::ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['replicas'] = $data['replicas'] ?? null; + $this->container['paginationLimitedTo'] = $data['paginationLimitedTo'] ?? 1000; + $this->container['disableTypoToleranceOnWords'] = $data['disableTypoToleranceOnWords'] ?? null; + $this->container['attributesToTransliterate'] = $data['attributesToTransliterate'] ?? null; + $this->container['camelCaseAttributes'] = $data['camelCaseAttributes'] ?? null; + $this->container['decompoundedAttributes'] = $data['decompoundedAttributes'] ?? null; + $this->container['indexLanguages'] = $data['indexLanguages'] ?? null; + $this->container['filterPromotes'] = $data['filterPromotes'] ?? false; + $this->container['disablePrefixOnAttributes'] = $data['disablePrefixOnAttributes'] ?? null; + $this->container['allowCompressionOfIntegerArray'] = $data['allowCompressionOfIntegerArray'] ?? false; + $this->container['numericAttributesForFiltering'] = $data['numericAttributesForFiltering'] ?? null; + $this->container['userData'] = $data['userData'] ?? null; + $this->container['searchableAttributes'] = $data['searchableAttributes'] ?? null; + $this->container['attributesForFaceting'] = $data['attributesForFaceting'] ?? null; + $this->container['unretrievableAttributes'] = $data['unretrievableAttributes'] ?? null; + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve'] ?? null; + $this->container['restrictSearchableAttributes'] = $data['restrictSearchableAttributes'] ?? null; + $this->container['ranking'] = $data['ranking'] ?? null; + $this->container['customRanking'] = $data['customRanking'] ?? null; + $this->container['relevancyStrictness'] = $data['relevancyStrictness'] ?? 100; + $this->container['attributesToHighlight'] = $data['attributesToHighlight'] ?? null; + $this->container['attributesToSnippet'] = $data['attributesToSnippet'] ?? null; + $this->container['highlightPreTag'] = $data['highlightPreTag'] ?? ''; + $this->container['highlightPostTag'] = $data['highlightPostTag'] ?? ''; + $this->container['snippetEllipsisText'] = $data['snippetEllipsisText'] ?? '…'; + $this->container['restrictHighlightAndSnippetArrays'] = $data['restrictHighlightAndSnippetArrays'] ?? false; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['minWordSizefor1Typo'] = $data['minWordSizefor1Typo'] ?? 4; + $this->container['minWordSizefor2Typos'] = $data['minWordSizefor2Typos'] ?? 8; + $this->container['typoTolerance'] = $data['typoTolerance'] ?? 'true'; + $this->container['allowTyposOnNumericTokens'] = $data['allowTyposOnNumericTokens'] ?? true; + $this->container['disableTypoToleranceOnAttributes'] = $data['disableTypoToleranceOnAttributes'] ?? null; + $this->container['separatorsToIndex'] = $data['separatorsToIndex'] ?? ''; + $this->container['ignorePlurals'] = $data['ignorePlurals'] ?? 'false'; + $this->container['removeStopWords'] = $data['removeStopWords'] ?? 'false'; + $this->container['keepDiacriticsOnCharacters'] = $data['keepDiacriticsOnCharacters'] ?? ''; + $this->container['queryLanguages'] = $data['queryLanguages'] ?? null; + $this->container['decompoundQuery'] = $data['decompoundQuery'] ?? true; + $this->container['enableRules'] = $data['enableRules'] ?? true; + $this->container['enablePersonalization'] = $data['enablePersonalization'] ?? false; + $this->container['queryType'] = $data['queryType'] ?? 'prefixLast'; + $this->container['removeWordsIfNoResults'] = $data['removeWordsIfNoResults'] ?? 'none'; + $this->container['advancedSyntax'] = $data['advancedSyntax'] ?? false; + $this->container['optionalWords'] = $data['optionalWords'] ?? null; + $this->container['disableExactOnAttributes'] = $data['disableExactOnAttributes'] ?? null; + $this->container['exactOnSingleWordQuery'] = $data['exactOnSingleWordQuery'] ?? 'attribute'; + $this->container['alternativesAsExact'] = $data['alternativesAsExact'] ?? null; + $this->container['advancedSyntaxFeatures'] = $data['advancedSyntaxFeatures'] ?? null; + $this->container['distinct'] = $data['distinct'] ?? 0; + $this->container['synonyms'] = $data['synonyms'] ?? true; + $this->container['replaceSynonymsInHighlight'] = $data['replaceSynonymsInHighlight'] ?? false; + $this->container['minProximity'] = $data['minProximity'] ?? 1; + $this->container['responseFields'] = $data['responseFields'] ?? null; + $this->container['maxFacetHits'] = $data['maxFacetHits'] ?? 10; + $this->container['attributeCriteriaComputedByMinProximity'] = $data['attributeCriteriaComputedByMinProximity'] ?? false; + $this->container['renderingContent'] = $data['renderingContent'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($this->container['typoTolerance']) && !in_array($this->container['typoTolerance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'typoTolerance', must be one of '%s'", + $this->container['typoTolerance'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'queryType', must be one of '%s'", + $this->container['queryType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($this->container['removeWordsIfNoResults']) && !in_array($this->container['removeWordsIfNoResults'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $this->container['removeWordsIfNoResults'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($this->container['exactOnSingleWordQuery']) && !in_array($this->container['exactOnSingleWordQuery'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $this->container['exactOnSingleWordQuery'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['distinct']) && ($this->container['distinct'] > 4)) { + $invalidProperties[] = "invalid value for 'distinct', must be smaller than or equal to 4."; + } + + if (!is_null($this->container['distinct']) && ($this->container['distinct'] < 0)) { + $invalidProperties[] = "invalid value for 'distinct', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['minProximity']) && ($this->container['minProximity'] > 7)) { + $invalidProperties[] = "invalid value for 'minProximity', must be smaller than or equal to 7."; + } + + if (!is_null($this->container['minProximity']) && ($this->container['minProximity'] < 1)) { + $invalidProperties[] = "invalid value for 'minProximity', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + 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 string[]|null + */ + public function getReplicas() + { + return $this->container['replicas']; + } + + /** + * Sets replicas + * + * @param string[]|null $replicas Creates replicas, exact copies of an index. + * + * @return self + */ + public function setReplicas($replicas) + { + $this->container['replicas'] = $replicas; + + return $this; + } + + /** + * Gets paginationLimitedTo + * + * @return int|null + */ + public function getPaginationLimitedTo() + { + return $this->container['paginationLimitedTo']; + } + + /** + * Sets paginationLimitedTo + * + * @param int|null $paginationLimitedTo Set the maximum number of hits accessible via pagination. + * + * @return self + */ + public function setPaginationLimitedTo($paginationLimitedTo) + { + $this->container['paginationLimitedTo'] = $paginationLimitedTo; + + return $this; + } + + /** + * Gets disableTypoToleranceOnWords + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnWords() + { + return $this->container['disableTypoToleranceOnWords']; + } + + /** + * Sets disableTypoToleranceOnWords + * + * @param string[]|null $disableTypoToleranceOnWords A list of words for which you want to turn off typo tolerance. + * + * @return self + */ + public function setDisableTypoToleranceOnWords($disableTypoToleranceOnWords) + { + $this->container['disableTypoToleranceOnWords'] = $disableTypoToleranceOnWords; + + return $this; + } + + /** + * Gets attributesToTransliterate + * + * @return string[]|null + */ + public function getAttributesToTransliterate() + { + return $this->container['attributesToTransliterate']; + } + + /** + * Sets attributesToTransliterate + * + * @param string[]|null $attributesToTransliterate Specify on which attributes to apply transliteration. + * + * @return self + */ + public function setAttributesToTransliterate($attributesToTransliterate) + { + $this->container['attributesToTransliterate'] = $attributesToTransliterate; + + return $this; + } + + /** + * Gets camelCaseAttributes + * + * @return string[]|null + */ + public function getCamelCaseAttributes() + { + return $this->container['camelCaseAttributes']; + } + + /** + * Sets camelCaseAttributes + * + * @param string[]|null $camelCaseAttributes List of attributes on which to do a decomposition of camel case words. + * + * @return self + */ + public function setCamelCaseAttributes($camelCaseAttributes) + { + $this->container['camelCaseAttributes'] = $camelCaseAttributes; + + return $this; + } + + /** + * Gets decompoundedAttributes + * + * @return array|null + */ + public function getDecompoundedAttributes() + { + return $this->container['decompoundedAttributes']; + } + + /** + * Sets decompoundedAttributes + * + * @param array|null $decompoundedAttributes Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding. + * + * @return self + */ + public function setDecompoundedAttributes($decompoundedAttributes) + { + $this->container['decompoundedAttributes'] = $decompoundedAttributes; + + return $this; + } + + /** + * Gets indexLanguages + * + * @return string[]|null + */ + public function getIndexLanguages() + { + return $this->container['indexLanguages']; + } + + /** + * Sets indexLanguages + * + * @param string[]|null $indexLanguages Sets the languages at the index level for language-specific processing such as tokenization and normalization. + * + * @return self + */ + public function setIndexLanguages($indexLanguages) + { + $this->container['indexLanguages'] = $indexLanguages; + + return $this; + } + + /** + * Gets filterPromotes + * + * @return bool|null + */ + public function getFilterPromotes() + { + return $this->container['filterPromotes']; + } + + /** + * Sets filterPromotes + * + * @param bool|null $filterPromotes Whether promoted results should match the filters of the current search, except for geographic filters. + * + * @return self + */ + public function setFilterPromotes($filterPromotes) + { + $this->container['filterPromotes'] = $filterPromotes; + + return $this; + } + + /** + * Gets disablePrefixOnAttributes + * + * @return string[]|null + */ + public function getDisablePrefixOnAttributes() + { + return $this->container['disablePrefixOnAttributes']; + } + + /** + * Sets disablePrefixOnAttributes + * + * @param string[]|null $disablePrefixOnAttributes List of attributes on which you want to disable prefix matching. + * + * @return self + */ + public function setDisablePrefixOnAttributes($disablePrefixOnAttributes) + { + $this->container['disablePrefixOnAttributes'] = $disablePrefixOnAttributes; + + return $this; + } + + /** + * Gets allowCompressionOfIntegerArray + * + * @return bool|null + */ + public function getAllowCompressionOfIntegerArray() + { + return $this->container['allowCompressionOfIntegerArray']; + } + + /** + * Sets allowCompressionOfIntegerArray + * + * @param bool|null $allowCompressionOfIntegerArray Enables compression of large integer arrays. + * + * @return self + */ + public function setAllowCompressionOfIntegerArray($allowCompressionOfIntegerArray) + { + $this->container['allowCompressionOfIntegerArray'] = $allowCompressionOfIntegerArray; + + return $this; + } + + /** + * Gets numericAttributesForFiltering + * + * @return string[]|null + */ + public function getNumericAttributesForFiltering() + { + return $this->container['numericAttributesForFiltering']; + } + + /** + * Sets numericAttributesForFiltering + * + * @param string[]|null $numericAttributesForFiltering List of numeric attributes that can be used as numerical filters. + * + * @return self + */ + public function setNumericAttributesForFiltering($numericAttributesForFiltering) + { + $this->container['numericAttributesForFiltering'] = $numericAttributesForFiltering; + + return $this; + } + + /** + * Gets userData + * + * @return array|null + */ + public function getUserData() + { + return $this->container['userData']; + } + + /** + * Sets userData + * + * @param array|null $userData Lets you store custom data in your indices. + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + + /** + * Gets searchableAttributes + * + * @return string[]|null + */ + public function getSearchableAttributes() + { + return $this->container['searchableAttributes']; + } + + /** + * Sets searchableAttributes + * + * @param string[]|null $searchableAttributes The complete list of attributes used for searching. + * + * @return self + */ + public function setSearchableAttributes($searchableAttributes) + { + $this->container['searchableAttributes'] = $searchableAttributes; + + return $this; + } + + /** + * Gets attributesForFaceting + * + * @return string[]|null + */ + public function getAttributesForFaceting() + { + return $this->container['attributesForFaceting']; + } + + /** + * Sets attributesForFaceting + * + * @param string[]|null $attributesForFaceting The complete list of attributes that will be used for faceting. + * + * @return self + */ + public function setAttributesForFaceting($attributesForFaceting) + { + $this->container['attributesForFaceting'] = $attributesForFaceting; + + return $this; + } + + /** + * Gets unretrievableAttributes + * + * @return string[]|null + */ + public function getUnretrievableAttributes() + { + return $this->container['unretrievableAttributes']; + } + + /** + * Sets unretrievableAttributes + * + * @param string[]|null $unretrievableAttributes List of attributes that can't be retrieved at query time. + * + * @return self + */ + public function setUnretrievableAttributes($unretrievableAttributes) + { + $this->container['unretrievableAttributes'] = $unretrievableAttributes; + + return $this; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve']; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve This parameter controls which attributes to retrieve and which not to retrieve. + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets restrictSearchableAttributes + * + * @return string[]|null + */ + public function getRestrictSearchableAttributes() + { + return $this->container['restrictSearchableAttributes']; + } + + /** + * Sets restrictSearchableAttributes + * + * @param string[]|null $restrictSearchableAttributes Restricts a given query to look in only a subset of your searchable attributes. + * + * @return self + */ + public function setRestrictSearchableAttributes($restrictSearchableAttributes) + { + $this->container['restrictSearchableAttributes'] = $restrictSearchableAttributes; + + return $this; + } + + /** + * Gets ranking + * + * @return string[]|null + */ + public function getRanking() + { + return $this->container['ranking']; + } + + /** + * Sets ranking + * + * @param string[]|null $ranking Controls how Algolia should sort your results. + * + * @return self + */ + public function setRanking($ranking) + { + $this->container['ranking'] = $ranking; + + return $this; + } + + /** + * Gets customRanking + * + * @return string[]|null + */ + public function getCustomRanking() + { + return $this->container['customRanking']; + } + + /** + * Sets customRanking + * + * @param string[]|null $customRanking Specifies the custom ranking criterion. + * + * @return self + */ + public function setCustomRanking($customRanking) + { + $this->container['customRanking'] = $customRanking; + + return $this; + } + + /** + * Gets relevancyStrictness + * + * @return int|null + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness']; + } + + /** + * Sets relevancyStrictness + * + * @param int|null $relevancyStrictness Controls the relevancy threshold below which less relevant results aren't included in the results. + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets attributesToHighlight + * + * @return string[]|null + */ + public function getAttributesToHighlight() + { + return $this->container['attributesToHighlight']; + } + + /** + * Sets attributesToHighlight + * + * @param string[]|null $attributesToHighlight List of attributes to highlight. + * + * @return self + */ + public function setAttributesToHighlight($attributesToHighlight) + { + $this->container['attributesToHighlight'] = $attributesToHighlight; + + return $this; + } + + /** + * Gets attributesToSnippet + * + * @return string[]|null + */ + public function getAttributesToSnippet() + { + return $this->container['attributesToSnippet']; + } + + /** + * Sets attributesToSnippet + * + * @param string[]|null $attributesToSnippet List of attributes to snippet, with an optional maximum number of words to snippet. + * + * @return self + */ + public function setAttributesToSnippet($attributesToSnippet) + { + $this->container['attributesToSnippet'] = $attributesToSnippet; + + return $this; + } + + /** + * Gets highlightPreTag + * + * @return string|null + */ + public function getHighlightPreTag() + { + return $this->container['highlightPreTag']; + } + + /** + * Sets highlightPreTag + * + * @param string|null $highlightPreTag The HTML string to insert before the highlighted parts in all highlight and snippet results. + * + * @return self + */ + public function setHighlightPreTag($highlightPreTag) + { + $this->container['highlightPreTag'] = $highlightPreTag; + + return $this; + } + + /** + * Gets highlightPostTag + * + * @return string|null + */ + public function getHighlightPostTag() + { + return $this->container['highlightPostTag']; + } + + /** + * Sets highlightPostTag + * + * @param string|null $highlightPostTag The HTML string to insert after the highlighted parts in all highlight and snippet results. + * + * @return self + */ + public function setHighlightPostTag($highlightPostTag) + { + $this->container['highlightPostTag'] = $highlightPostTag; + + return $this; + } + + /** + * Gets snippetEllipsisText + * + * @return string|null + */ + public function getSnippetEllipsisText() + { + return $this->container['snippetEllipsisText']; + } + + /** + * Sets snippetEllipsisText + * + * @param string|null $snippetEllipsisText String used as an ellipsis indicator when a snippet is truncated. + * + * @return self + */ + public function setSnippetEllipsisText($snippetEllipsisText) + { + $this->container['snippetEllipsisText'] = $snippetEllipsisText; + + return $this; + } + + /** + * Gets restrictHighlightAndSnippetArrays + * + * @return bool|null + */ + public function getRestrictHighlightAndSnippetArrays() + { + return $this->container['restrictHighlightAndSnippetArrays']; + } + + /** + * Sets restrictHighlightAndSnippetArrays + * + * @param bool|null $restrictHighlightAndSnippetArrays Restrict highlighting and snippeting to items that matched the query. + * + * @return self + */ + public function setRestrictHighlightAndSnippetArrays($restrictHighlightAndSnippetArrays) + { + $this->container['restrictHighlightAndSnippetArrays'] = $restrictHighlightAndSnippetArrays; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage Set the number of hits per page. + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets minWordSizefor1Typo + * + * @return int|null + */ + public function getMinWordSizefor1Typo() + { + return $this->container['minWordSizefor1Typo']; + } + + /** + * Sets minWordSizefor1Typo + * + * @param int|null $minWordSizefor1Typo Minimum number of characters a word in the query string must contain to accept matches with 1 typo. + * + * @return self + */ + public function setMinWordSizefor1Typo($minWordSizefor1Typo) + { + $this->container['minWordSizefor1Typo'] = $minWordSizefor1Typo; + + return $this; + } + + /** + * Gets minWordSizefor2Typos + * + * @return int|null + */ + public function getMinWordSizefor2Typos() + { + return $this->container['minWordSizefor2Typos']; + } + + /** + * Sets minWordSizefor2Typos + * + * @param int|null $minWordSizefor2Typos Minimum number of characters a word in the query string must contain to accept matches with 2 typos. + * + * @return self + */ + public function setMinWordSizefor2Typos($minWordSizefor2Typos) + { + $this->container['minWordSizefor2Typos'] = $minWordSizefor2Typos; + + return $this; + } + + /** + * Gets typoTolerance + * + * @return string|null + */ + public function getTypoTolerance() + { + return $this->container['typoTolerance']; + } + + /** + * Sets typoTolerance + * + * @param string|null $typoTolerance Controls whether typo tolerance is enabled and how it is applied. + * + * @return self + */ + public function setTypoTolerance($typoTolerance) + { + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($typoTolerance) && !in_array($typoTolerance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'typoTolerance', must be one of '%s'", + $typoTolerance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['typoTolerance'] = $typoTolerance; + + return $this; + } + + /** + * Gets allowTyposOnNumericTokens + * + * @return bool|null + */ + public function getAllowTyposOnNumericTokens() + { + return $this->container['allowTyposOnNumericTokens']; + } + + /** + * Sets allowTyposOnNumericTokens + * + * @param bool|null $allowTyposOnNumericTokens Whether to allow typos on numbers (\"numeric tokens\") in the query string. + * + * @return self + */ + public function setAllowTyposOnNumericTokens($allowTyposOnNumericTokens) + { + $this->container['allowTyposOnNumericTokens'] = $allowTyposOnNumericTokens; + + return $this; + } + + /** + * Gets disableTypoToleranceOnAttributes + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnAttributes() + { + return $this->container['disableTypoToleranceOnAttributes']; + } + + /** + * Sets disableTypoToleranceOnAttributes + * + * @param string[]|null $disableTypoToleranceOnAttributes List of attributes on which you want to disable typo tolerance. + * + * @return self + */ + public function setDisableTypoToleranceOnAttributes($disableTypoToleranceOnAttributes) + { + $this->container['disableTypoToleranceOnAttributes'] = $disableTypoToleranceOnAttributes; + + return $this; + } + + /** + * Gets separatorsToIndex + * + * @return string|null + */ + public function getSeparatorsToIndex() + { + return $this->container['separatorsToIndex']; + } + + /** + * Sets separatorsToIndex + * + * @param string|null $separatorsToIndex Control which separators are indexed. + * + * @return self + */ + public function setSeparatorsToIndex($separatorsToIndex) + { + $this->container['separatorsToIndex'] = $separatorsToIndex; + + return $this; + } + + /** + * Gets ignorePlurals + * + * @return string|null + */ + public function getIgnorePlurals() + { + return $this->container['ignorePlurals']; + } + + /** + * Sets ignorePlurals + * + * @param string|null $ignorePlurals Treats singular, plurals, and other forms of declensions as matching terms. + * + * @return self + */ + public function setIgnorePlurals($ignorePlurals) + { + $this->container['ignorePlurals'] = $ignorePlurals; + + return $this; + } + + /** + * Gets removeStopWords + * + * @return string|null + */ + public function getRemoveStopWords() + { + return $this->container['removeStopWords']; + } + + /** + * Sets removeStopWords + * + * @param string|null $removeStopWords Removes stop (common) words from the query before executing it. + * + * @return self + */ + public function setRemoveStopWords($removeStopWords) + { + $this->container['removeStopWords'] = $removeStopWords; + + return $this; + } + + /** + * Gets keepDiacriticsOnCharacters + * + * @return string|null + */ + public function getKeepDiacriticsOnCharacters() + { + return $this->container['keepDiacriticsOnCharacters']; + } + + /** + * Sets keepDiacriticsOnCharacters + * + * @param string|null $keepDiacriticsOnCharacters List of characters that the engine shouldn't automatically normalize. + * + * @return self + */ + public function setKeepDiacriticsOnCharacters($keepDiacriticsOnCharacters) + { + $this->container['keepDiacriticsOnCharacters'] = $keepDiacriticsOnCharacters; + + return $this; + } + + /** + * Gets queryLanguages + * + * @return string[]|null + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages']; + } + + /** + * Sets queryLanguages + * + * @param string[]|null $queryLanguages Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets decompoundQuery + * + * @return bool|null + */ + public function getDecompoundQuery() + { + return $this->container['decompoundQuery']; + } + + /** + * Sets decompoundQuery + * + * @param bool|null $decompoundQuery Splits compound words into their composing atoms in the query. + * + * @return self + */ + public function setDecompoundQuery($decompoundQuery) + { + $this->container['decompoundQuery'] = $decompoundQuery; + + return $this; + } + + /** + * Gets enableRules + * + * @return bool|null + */ + public function getEnableRules() + { + return $this->container['enableRules']; + } + + /** + * Sets enableRules + * + * @param bool|null $enableRules Whether Rules should be globally enabled. + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets enablePersonalization + * + * @return bool|null + */ + public function getEnablePersonalization() + { + return $this->container['enablePersonalization']; + } + + /** + * Sets enablePersonalization + * + * @param bool|null $enablePersonalization Enable the Personalization feature. + * + * @return self + */ + public function setEnablePersonalization($enablePersonalization) + { + $this->container['enablePersonalization'] = $enablePersonalization; + + return $this; + } + + /** + * Gets queryType + * + * @return string|null + */ + public function getQueryType() + { + return $this->container['queryType']; + } + + /** + * Sets queryType + * + * @param string|null $queryType Controls if and how query words are interpreted as prefixes. + * + * @return self + */ + public function setQueryType($queryType) + { + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($queryType) && !in_array($queryType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'queryType', must be one of '%s'", + $queryType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['queryType'] = $queryType; + + return $this; + } + + /** + * Gets removeWordsIfNoResults + * + * @return string|null + */ + public function getRemoveWordsIfNoResults() + { + return $this->container['removeWordsIfNoResults']; + } + + /** + * Sets removeWordsIfNoResults + * + * @param string|null $removeWordsIfNoResults Selects a strategy to remove words from the query when it doesn't match any hits. + * + * @return self + */ + public function setRemoveWordsIfNoResults($removeWordsIfNoResults) + { + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($removeWordsIfNoResults) && !in_array($removeWordsIfNoResults, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $removeWordsIfNoResults, + implode("', '", $allowedValues) + ) + ); + } + $this->container['removeWordsIfNoResults'] = $removeWordsIfNoResults; + + return $this; + } + + /** + * Gets advancedSyntax + * + * @return bool|null + */ + public function getAdvancedSyntax() + { + return $this->container['advancedSyntax']; + } + + /** + * Sets advancedSyntax + * + * @param bool|null $advancedSyntax Enables the advanced query syntax. + * + * @return self + */ + public function setAdvancedSyntax($advancedSyntax) + { + $this->container['advancedSyntax'] = $advancedSyntax; + + return $this; + } + + /** + * Gets optionalWords + * + * @return string[]|null + */ + public function getOptionalWords() + { + return $this->container['optionalWords']; + } + + /** + * Sets optionalWords + * + * @param string[]|null $optionalWords A list of words that should be considered as optional when found in the query. + * + * @return self + */ + public function setOptionalWords($optionalWords) + { + $this->container['optionalWords'] = $optionalWords; + + return $this; + } + + /** + * Gets disableExactOnAttributes + * + * @return string[]|null + */ + public function getDisableExactOnAttributes() + { + return $this->container['disableExactOnAttributes']; + } + + /** + * Sets disableExactOnAttributes + * + * @param string[]|null $disableExactOnAttributes List of attributes on which you want to disable the exact ranking criterion. + * + * @return self + */ + public function setDisableExactOnAttributes($disableExactOnAttributes) + { + $this->container['disableExactOnAttributes'] = $disableExactOnAttributes; + + return $this; + } + + /** + * Gets exactOnSingleWordQuery + * + * @return string|null + */ + public function getExactOnSingleWordQuery() + { + return $this->container['exactOnSingleWordQuery']; + } + + /** + * Sets exactOnSingleWordQuery + * + * @param string|null $exactOnSingleWordQuery Controls how the exact ranking criterion is computed when the query contains only one word. + * + * @return self + */ + public function setExactOnSingleWordQuery($exactOnSingleWordQuery) + { + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($exactOnSingleWordQuery) && !in_array($exactOnSingleWordQuery, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $exactOnSingleWordQuery, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exactOnSingleWordQuery'] = $exactOnSingleWordQuery; + + return $this; + } + + /** + * Gets alternativesAsExact + * + * @return string[]|null + */ + public function getAlternativesAsExact() + { + return $this->container['alternativesAsExact']; + } + + /** + * Sets alternativesAsExact + * + * @param string[]|null $alternativesAsExact List of alternatives that should be considered an exact match by the exact ranking criterion. + * + * @return self + */ + public function setAlternativesAsExact($alternativesAsExact) + { + $allowedValues = $this->getAlternativesAsExactAllowableValues(); + if (!is_null($alternativesAsExact) && array_diff($alternativesAsExact, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'alternativesAsExact', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['alternativesAsExact'] = $alternativesAsExact; + + return $this; + } + + /** + * Gets advancedSyntaxFeatures + * + * @return string[]|null + */ + public function getAdvancedSyntaxFeatures() + { + return $this->container['advancedSyntaxFeatures']; + } + + /** + * Sets advancedSyntaxFeatures + * + * @param string[]|null $advancedSyntaxFeatures Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. + * + * @return self + */ + public function setAdvancedSyntaxFeatures($advancedSyntaxFeatures) + { + $allowedValues = $this->getAdvancedSyntaxFeaturesAllowableValues(); + if (!is_null($advancedSyntaxFeatures) && array_diff($advancedSyntaxFeatures, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'advancedSyntaxFeatures', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['advancedSyntaxFeatures'] = $advancedSyntaxFeatures; + + return $this; + } + + /** + * Gets distinct + * + * @return int|null + */ + public function getDistinct() + { + return $this->container['distinct']; + } + + /** + * Sets distinct + * + * @param int|null $distinct Enables de-duplication or grouping of results. + * + * @return self + */ + public function setDistinct($distinct) + { + + if (!is_null($distinct) && ($distinct > 4)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling IndexSettings., must be smaller than or equal to 4.'); + } + if (!is_null($distinct) && ($distinct < 0)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling IndexSettings., must be bigger than or equal to 0.'); + } + + $this->container['distinct'] = $distinct; + + return $this; + } + + /** + * Gets synonyms + * + * @return bool|null + */ + public function getSynonyms() + { + return $this->container['synonyms']; + } + + /** + * Sets synonyms + * + * @param bool|null $synonyms Whether to take into account an index's synonyms for a particular search. + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets replaceSynonymsInHighlight + * + * @return bool|null + */ + public function getReplaceSynonymsInHighlight() + { + return $this->container['replaceSynonymsInHighlight']; + } + + /** + * Sets replaceSynonymsInHighlight + * + * @param bool|null $replaceSynonymsInHighlight Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + * + * @return self + */ + public function setReplaceSynonymsInHighlight($replaceSynonymsInHighlight) + { + $this->container['replaceSynonymsInHighlight'] = $replaceSynonymsInHighlight; + + return $this; + } + + /** + * Gets minProximity + * + * @return int|null + */ + public function getMinProximity() + { + return $this->container['minProximity']; + } + + /** + * Sets minProximity + * + * @param int|null $minProximity Precision of the proximity ranking criterion. + * + * @return self + */ + public function setMinProximity($minProximity) + { + + if (!is_null($minProximity) && ($minProximity > 7)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling IndexSettings., must be smaller than or equal to 7.'); + } + if (!is_null($minProximity) && ($minProximity < 1)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling IndexSettings., must be bigger than or equal to 1.'); + } + + $this->container['minProximity'] = $minProximity; + + return $this; + } + + /** + * Gets responseFields + * + * @return string[]|null + */ + public function getResponseFields() + { + return $this->container['responseFields']; + } + + /** + * Sets responseFields + * + * @param string[]|null $responseFields Choose which fields to return in the API response. This parameters applies to search and browse queries. + * + * @return self + */ + public function setResponseFields($responseFields) + { + $this->container['responseFields'] = $responseFields; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits']; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling IndexSettings., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets attributeCriteriaComputedByMinProximity + * + * @return bool|null + */ + public function getAttributeCriteriaComputedByMinProximity() + { + return $this->container['attributeCriteriaComputedByMinProximity']; + } + + /** + * Sets attributeCriteriaComputedByMinProximity + * + * @param bool|null $attributeCriteriaComputedByMinProximity When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. + * + * @return self + */ + public function setAttributeCriteriaComputedByMinProximity($attributeCriteriaComputedByMinProximity) + { + $this->container['attributeCriteriaComputedByMinProximity'] = $attributeCriteriaComputedByMinProximity; + + return $this; + } + + /** + * Gets renderingContent + * + * @return object|null + */ + public function getRenderingContent() + { + return $this->container['renderingContent']; + } + + /** + * Sets renderingContent + * + * @param object|null $renderingContent Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/IndexSettingsAsSearchParams.php b/clients/algoliasearch-client-php/lib/Model/IndexSettingsAsSearchParams.php new file mode 100644 index 0000000000..291be1b686 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/IndexSettingsAsSearchParams.php @@ -0,0 +1,1849 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class IndexSettingsAsSearchParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'indexSettingsAsSearchParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'searchableAttributes' => 'string[]', + 'attributesForFaceting' => 'string[]', + 'unretrievableAttributes' => 'string[]', + 'attributesToRetrieve' => 'string[]', + 'restrictSearchableAttributes' => 'string[]', + 'ranking' => 'string[]', + 'customRanking' => 'string[]', + 'relevancyStrictness' => 'int', + 'attributesToHighlight' => 'string[]', + 'attributesToSnippet' => 'string[]', + 'highlightPreTag' => 'string', + 'highlightPostTag' => 'string', + 'snippetEllipsisText' => 'string', + 'restrictHighlightAndSnippetArrays' => 'bool', + 'hitsPerPage' => 'int', + 'minWordSizefor1Typo' => 'int', + 'minWordSizefor2Typos' => 'int', + 'typoTolerance' => 'string', + 'allowTyposOnNumericTokens' => 'bool', + 'disableTypoToleranceOnAttributes' => 'string[]', + 'separatorsToIndex' => 'string', + 'ignorePlurals' => 'string', + 'removeStopWords' => 'string', + 'keepDiacriticsOnCharacters' => 'string', + 'queryLanguages' => 'string[]', + 'decompoundQuery' => 'bool', + 'enableRules' => 'bool', + 'enablePersonalization' => 'bool', + 'queryType' => 'string', + 'removeWordsIfNoResults' => 'string', + 'advancedSyntax' => 'bool', + 'optionalWords' => 'string[]', + 'disableExactOnAttributes' => 'string[]', + 'exactOnSingleWordQuery' => 'string', + 'alternativesAsExact' => 'string[]', + 'advancedSyntaxFeatures' => 'string[]', + 'distinct' => 'int', + 'synonyms' => 'bool', + 'replaceSynonymsInHighlight' => 'bool', + 'minProximity' => 'int', + 'responseFields' => 'string[]', + 'maxFacetHits' => 'int', + 'attributeCriteriaComputedByMinProximity' => 'bool', + 'renderingContent' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'searchableAttributes' => null, + 'attributesForFaceting' => null, + 'unretrievableAttributes' => null, + 'attributesToRetrieve' => null, + 'restrictSearchableAttributes' => null, + 'ranking' => null, + 'customRanking' => null, + 'relevancyStrictness' => null, + 'attributesToHighlight' => null, + 'attributesToSnippet' => null, + 'highlightPreTag' => null, + 'highlightPostTag' => null, + 'snippetEllipsisText' => null, + 'restrictHighlightAndSnippetArrays' => null, + 'hitsPerPage' => null, + 'minWordSizefor1Typo' => null, + 'minWordSizefor2Typos' => null, + 'typoTolerance' => null, + 'allowTyposOnNumericTokens' => null, + 'disableTypoToleranceOnAttributes' => null, + 'separatorsToIndex' => null, + 'ignorePlurals' => null, + 'removeStopWords' => null, + 'keepDiacriticsOnCharacters' => null, + 'queryLanguages' => null, + 'decompoundQuery' => null, + 'enableRules' => null, + 'enablePersonalization' => null, + 'queryType' => null, + 'removeWordsIfNoResults' => null, + 'advancedSyntax' => null, + 'optionalWords' => null, + 'disableExactOnAttributes' => null, + 'exactOnSingleWordQuery' => null, + 'alternativesAsExact' => null, + 'advancedSyntaxFeatures' => null, + 'distinct' => null, + 'synonyms' => null, + 'replaceSynonymsInHighlight' => null, + 'minProximity' => null, + 'responseFields' => null, + 'maxFacetHits' => null, + 'attributeCriteriaComputedByMinProximity' => null, + 'renderingContent' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'searchableAttributes' => 'searchableAttributes', + 'attributesForFaceting' => 'attributesForFaceting', + 'unretrievableAttributes' => 'unretrievableAttributes', + 'attributesToRetrieve' => 'attributesToRetrieve', + 'restrictSearchableAttributes' => 'restrictSearchableAttributes', + 'ranking' => 'ranking', + 'customRanking' => 'customRanking', + 'relevancyStrictness' => 'relevancyStrictness', + 'attributesToHighlight' => 'attributesToHighlight', + 'attributesToSnippet' => 'attributesToSnippet', + 'highlightPreTag' => 'highlightPreTag', + 'highlightPostTag' => 'highlightPostTag', + 'snippetEllipsisText' => 'snippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'restrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'hitsPerPage', + 'minWordSizefor1Typo' => 'minWordSizefor1Typo', + 'minWordSizefor2Typos' => 'minWordSizefor2Typos', + 'typoTolerance' => 'typoTolerance', + 'allowTyposOnNumericTokens' => 'allowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'disableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'separatorsToIndex', + 'ignorePlurals' => 'ignorePlurals', + 'removeStopWords' => 'removeStopWords', + 'keepDiacriticsOnCharacters' => 'keepDiacriticsOnCharacters', + 'queryLanguages' => 'queryLanguages', + 'decompoundQuery' => 'decompoundQuery', + 'enableRules' => 'enableRules', + 'enablePersonalization' => 'enablePersonalization', + 'queryType' => 'queryType', + 'removeWordsIfNoResults' => 'removeWordsIfNoResults', + 'advancedSyntax' => 'advancedSyntax', + 'optionalWords' => 'optionalWords', + 'disableExactOnAttributes' => 'disableExactOnAttributes', + 'exactOnSingleWordQuery' => 'exactOnSingleWordQuery', + 'alternativesAsExact' => 'alternativesAsExact', + 'advancedSyntaxFeatures' => 'advancedSyntaxFeatures', + 'distinct' => 'distinct', + 'synonyms' => 'synonyms', + 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', + 'minProximity' => 'minProximity', + 'responseFields' => 'responseFields', + 'maxFacetHits' => 'maxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', + 'renderingContent' => 'renderingContent' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'searchableAttributes' => 'setSearchableAttributes', + 'attributesForFaceting' => 'setAttributesForFaceting', + 'unretrievableAttributes' => 'setUnretrievableAttributes', + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'restrictSearchableAttributes' => 'setRestrictSearchableAttributes', + 'ranking' => 'setRanking', + 'customRanking' => 'setCustomRanking', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'attributesToHighlight' => 'setAttributesToHighlight', + 'attributesToSnippet' => 'setAttributesToSnippet', + 'highlightPreTag' => 'setHighlightPreTag', + 'highlightPostTag' => 'setHighlightPostTag', + 'snippetEllipsisText' => 'setSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'setRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'setHitsPerPage', + 'minWordSizefor1Typo' => 'setMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'setMinWordSizefor2Typos', + 'typoTolerance' => 'setTypoTolerance', + 'allowTyposOnNumericTokens' => 'setAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'setDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'setSeparatorsToIndex', + 'ignorePlurals' => 'setIgnorePlurals', + 'removeStopWords' => 'setRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'setKeepDiacriticsOnCharacters', + 'queryLanguages' => 'setQueryLanguages', + 'decompoundQuery' => 'setDecompoundQuery', + 'enableRules' => 'setEnableRules', + 'enablePersonalization' => 'setEnablePersonalization', + 'queryType' => 'setQueryType', + 'removeWordsIfNoResults' => 'setRemoveWordsIfNoResults', + 'advancedSyntax' => 'setAdvancedSyntax', + 'optionalWords' => 'setOptionalWords', + 'disableExactOnAttributes' => 'setDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'setExactOnSingleWordQuery', + 'alternativesAsExact' => 'setAlternativesAsExact', + 'advancedSyntaxFeatures' => 'setAdvancedSyntaxFeatures', + 'distinct' => 'setDistinct', + 'synonyms' => 'setSynonyms', + 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', + 'minProximity' => 'setMinProximity', + 'responseFields' => 'setResponseFields', + 'maxFacetHits' => 'setMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'setRenderingContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'searchableAttributes' => 'getSearchableAttributes', + 'attributesForFaceting' => 'getAttributesForFaceting', + 'unretrievableAttributes' => 'getUnretrievableAttributes', + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'restrictSearchableAttributes' => 'getRestrictSearchableAttributes', + 'ranking' => 'getRanking', + 'customRanking' => 'getCustomRanking', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'attributesToHighlight' => 'getAttributesToHighlight', + 'attributesToSnippet' => 'getAttributesToSnippet', + 'highlightPreTag' => 'getHighlightPreTag', + 'highlightPostTag' => 'getHighlightPostTag', + 'snippetEllipsisText' => 'getSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'getRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'getHitsPerPage', + 'minWordSizefor1Typo' => 'getMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'getMinWordSizefor2Typos', + 'typoTolerance' => 'getTypoTolerance', + 'allowTyposOnNumericTokens' => 'getAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'getDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'getSeparatorsToIndex', + 'ignorePlurals' => 'getIgnorePlurals', + 'removeStopWords' => 'getRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'getKeepDiacriticsOnCharacters', + 'queryLanguages' => 'getQueryLanguages', + 'decompoundQuery' => 'getDecompoundQuery', + 'enableRules' => 'getEnableRules', + 'enablePersonalization' => 'getEnablePersonalization', + 'queryType' => 'getQueryType', + 'removeWordsIfNoResults' => 'getRemoveWordsIfNoResults', + 'advancedSyntax' => 'getAdvancedSyntax', + 'optionalWords' => 'getOptionalWords', + 'disableExactOnAttributes' => 'getDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'getExactOnSingleWordQuery', + 'alternativesAsExact' => 'getAlternativesAsExact', + 'advancedSyntaxFeatures' => 'getAdvancedSyntaxFeatures', + 'distinct' => 'getDistinct', + 'synonyms' => 'getSynonyms', + 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', + 'minProximity' => 'getMinProximity', + 'responseFields' => 'getResponseFields', + 'maxFacetHits' => 'getMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'getRenderingContent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const TYPO_TOLERANCE_TRUE = 'true'; + const TYPO_TOLERANCE_FALSE = 'false'; + const TYPO_TOLERANCE_MIN = 'min'; + const TYPO_TOLERANCE_STRICT = 'strict'; + const QUERY_TYPE_PREFIX_LAST = 'prefixLast'; + const QUERY_TYPE_PREFIX_ALL = 'prefixAll'; + const QUERY_TYPE_PREFIX_NONE = 'prefixNone'; + const REMOVE_WORDS_IF_NO_RESULTS_NONE = 'none'; + const REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS = 'lastWords'; + const REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS = 'firstWords'; + const REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL = 'allOptional'; + const EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE = 'attribute'; + const EXACT_ON_SINGLE_WORD_QUERY_NONE = 'none'; + const EXACT_ON_SINGLE_WORD_QUERY_WORD = 'word'; + const ALTERNATIVES_AS_EXACT_IGNORE_PLURALS = 'ignorePlurals'; + const ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM = 'singleWordSynonym'; + const ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM = 'multiWordsSynonym'; + const ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE = 'exactPhrase'; + const ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS = 'excludeWords'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypoToleranceAllowableValues() + { + return [ + self::TYPO_TOLERANCE_TRUE, + self::TYPO_TOLERANCE_FALSE, + self::TYPO_TOLERANCE_MIN, + self::TYPO_TOLERANCE_STRICT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getQueryTypeAllowableValues() + { + return [ + self::QUERY_TYPE_PREFIX_LAST, + self::QUERY_TYPE_PREFIX_ALL, + self::QUERY_TYPE_PREFIX_NONE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemoveWordsIfNoResultsAllowableValues() + { + return [ + self::REMOVE_WORDS_IF_NO_RESULTS_NONE, + self::REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExactOnSingleWordQueryAllowableValues() + { + return [ + self::EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE, + self::EXACT_ON_SINGLE_WORD_QUERY_NONE, + self::EXACT_ON_SINGLE_WORD_QUERY_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAlternativesAsExactAllowableValues() + { + return [ + self::ALTERNATIVES_AS_EXACT_IGNORE_PLURALS, + self::ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM, + self::ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdvancedSyntaxFeaturesAllowableValues() + { + return [ + self::ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE, + self::ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['searchableAttributes'] = $data['searchableAttributes'] ?? null; + $this->container['attributesForFaceting'] = $data['attributesForFaceting'] ?? null; + $this->container['unretrievableAttributes'] = $data['unretrievableAttributes'] ?? null; + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve'] ?? null; + $this->container['restrictSearchableAttributes'] = $data['restrictSearchableAttributes'] ?? null; + $this->container['ranking'] = $data['ranking'] ?? null; + $this->container['customRanking'] = $data['customRanking'] ?? null; + $this->container['relevancyStrictness'] = $data['relevancyStrictness'] ?? 100; + $this->container['attributesToHighlight'] = $data['attributesToHighlight'] ?? null; + $this->container['attributesToSnippet'] = $data['attributesToSnippet'] ?? null; + $this->container['highlightPreTag'] = $data['highlightPreTag'] ?? ''; + $this->container['highlightPostTag'] = $data['highlightPostTag'] ?? ''; + $this->container['snippetEllipsisText'] = $data['snippetEllipsisText'] ?? '…'; + $this->container['restrictHighlightAndSnippetArrays'] = $data['restrictHighlightAndSnippetArrays'] ?? false; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['minWordSizefor1Typo'] = $data['minWordSizefor1Typo'] ?? 4; + $this->container['minWordSizefor2Typos'] = $data['minWordSizefor2Typos'] ?? 8; + $this->container['typoTolerance'] = $data['typoTolerance'] ?? 'true'; + $this->container['allowTyposOnNumericTokens'] = $data['allowTyposOnNumericTokens'] ?? true; + $this->container['disableTypoToleranceOnAttributes'] = $data['disableTypoToleranceOnAttributes'] ?? null; + $this->container['separatorsToIndex'] = $data['separatorsToIndex'] ?? ''; + $this->container['ignorePlurals'] = $data['ignorePlurals'] ?? 'false'; + $this->container['removeStopWords'] = $data['removeStopWords'] ?? 'false'; + $this->container['keepDiacriticsOnCharacters'] = $data['keepDiacriticsOnCharacters'] ?? ''; + $this->container['queryLanguages'] = $data['queryLanguages'] ?? null; + $this->container['decompoundQuery'] = $data['decompoundQuery'] ?? true; + $this->container['enableRules'] = $data['enableRules'] ?? true; + $this->container['enablePersonalization'] = $data['enablePersonalization'] ?? false; + $this->container['queryType'] = $data['queryType'] ?? 'prefixLast'; + $this->container['removeWordsIfNoResults'] = $data['removeWordsIfNoResults'] ?? 'none'; + $this->container['advancedSyntax'] = $data['advancedSyntax'] ?? false; + $this->container['optionalWords'] = $data['optionalWords'] ?? null; + $this->container['disableExactOnAttributes'] = $data['disableExactOnAttributes'] ?? null; + $this->container['exactOnSingleWordQuery'] = $data['exactOnSingleWordQuery'] ?? 'attribute'; + $this->container['alternativesAsExact'] = $data['alternativesAsExact'] ?? null; + $this->container['advancedSyntaxFeatures'] = $data['advancedSyntaxFeatures'] ?? null; + $this->container['distinct'] = $data['distinct'] ?? 0; + $this->container['synonyms'] = $data['synonyms'] ?? true; + $this->container['replaceSynonymsInHighlight'] = $data['replaceSynonymsInHighlight'] ?? false; + $this->container['minProximity'] = $data['minProximity'] ?? 1; + $this->container['responseFields'] = $data['responseFields'] ?? null; + $this->container['maxFacetHits'] = $data['maxFacetHits'] ?? 10; + $this->container['attributeCriteriaComputedByMinProximity'] = $data['attributeCriteriaComputedByMinProximity'] ?? false; + $this->container['renderingContent'] = $data['renderingContent'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($this->container['typoTolerance']) && !in_array($this->container['typoTolerance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'typoTolerance', must be one of '%s'", + $this->container['typoTolerance'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'queryType', must be one of '%s'", + $this->container['queryType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($this->container['removeWordsIfNoResults']) && !in_array($this->container['removeWordsIfNoResults'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $this->container['removeWordsIfNoResults'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($this->container['exactOnSingleWordQuery']) && !in_array($this->container['exactOnSingleWordQuery'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $this->container['exactOnSingleWordQuery'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['distinct']) && ($this->container['distinct'] > 4)) { + $invalidProperties[] = "invalid value for 'distinct', must be smaller than or equal to 4."; + } + + if (!is_null($this->container['distinct']) && ($this->container['distinct'] < 0)) { + $invalidProperties[] = "invalid value for 'distinct', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['minProximity']) && ($this->container['minProximity'] > 7)) { + $invalidProperties[] = "invalid value for 'minProximity', must be smaller than or equal to 7."; + } + + if (!is_null($this->container['minProximity']) && ($this->container['minProximity'] < 1)) { + $invalidProperties[] = "invalid value for 'minProximity', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + 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 searchableAttributes + * + * @return string[]|null + */ + public function getSearchableAttributes() + { + return $this->container['searchableAttributes']; + } + + /** + * Sets searchableAttributes + * + * @param string[]|null $searchableAttributes The complete list of attributes used for searching. + * + * @return self + */ + public function setSearchableAttributes($searchableAttributes) + { + $this->container['searchableAttributes'] = $searchableAttributes; + + return $this; + } + + /** + * Gets attributesForFaceting + * + * @return string[]|null + */ + public function getAttributesForFaceting() + { + return $this->container['attributesForFaceting']; + } + + /** + * Sets attributesForFaceting + * + * @param string[]|null $attributesForFaceting The complete list of attributes that will be used for faceting. + * + * @return self + */ + public function setAttributesForFaceting($attributesForFaceting) + { + $this->container['attributesForFaceting'] = $attributesForFaceting; + + return $this; + } + + /** + * Gets unretrievableAttributes + * + * @return string[]|null + */ + public function getUnretrievableAttributes() + { + return $this->container['unretrievableAttributes']; + } + + /** + * Sets unretrievableAttributes + * + * @param string[]|null $unretrievableAttributes List of attributes that can't be retrieved at query time. + * + * @return self + */ + public function setUnretrievableAttributes($unretrievableAttributes) + { + $this->container['unretrievableAttributes'] = $unretrievableAttributes; + + return $this; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve']; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve This parameter controls which attributes to retrieve and which not to retrieve. + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets restrictSearchableAttributes + * + * @return string[]|null + */ + public function getRestrictSearchableAttributes() + { + return $this->container['restrictSearchableAttributes']; + } + + /** + * Sets restrictSearchableAttributes + * + * @param string[]|null $restrictSearchableAttributes Restricts a given query to look in only a subset of your searchable attributes. + * + * @return self + */ + public function setRestrictSearchableAttributes($restrictSearchableAttributes) + { + $this->container['restrictSearchableAttributes'] = $restrictSearchableAttributes; + + return $this; + } + + /** + * Gets ranking + * + * @return string[]|null + */ + public function getRanking() + { + return $this->container['ranking']; + } + + /** + * Sets ranking + * + * @param string[]|null $ranking Controls how Algolia should sort your results. + * + * @return self + */ + public function setRanking($ranking) + { + $this->container['ranking'] = $ranking; + + return $this; + } + + /** + * Gets customRanking + * + * @return string[]|null + */ + public function getCustomRanking() + { + return $this->container['customRanking']; + } + + /** + * Sets customRanking + * + * @param string[]|null $customRanking Specifies the custom ranking criterion. + * + * @return self + */ + public function setCustomRanking($customRanking) + { + $this->container['customRanking'] = $customRanking; + + return $this; + } + + /** + * Gets relevancyStrictness + * + * @return int|null + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness']; + } + + /** + * Sets relevancyStrictness + * + * @param int|null $relevancyStrictness Controls the relevancy threshold below which less relevant results aren't included in the results. + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets attributesToHighlight + * + * @return string[]|null + */ + public function getAttributesToHighlight() + { + return $this->container['attributesToHighlight']; + } + + /** + * Sets attributesToHighlight + * + * @param string[]|null $attributesToHighlight List of attributes to highlight. + * + * @return self + */ + public function setAttributesToHighlight($attributesToHighlight) + { + $this->container['attributesToHighlight'] = $attributesToHighlight; + + return $this; + } + + /** + * Gets attributesToSnippet + * + * @return string[]|null + */ + public function getAttributesToSnippet() + { + return $this->container['attributesToSnippet']; + } + + /** + * Sets attributesToSnippet + * + * @param string[]|null $attributesToSnippet List of attributes to snippet, with an optional maximum number of words to snippet. + * + * @return self + */ + public function setAttributesToSnippet($attributesToSnippet) + { + $this->container['attributesToSnippet'] = $attributesToSnippet; + + return $this; + } + + /** + * Gets highlightPreTag + * + * @return string|null + */ + public function getHighlightPreTag() + { + return $this->container['highlightPreTag']; + } + + /** + * Sets highlightPreTag + * + * @param string|null $highlightPreTag The HTML string to insert before the highlighted parts in all highlight and snippet results. + * + * @return self + */ + public function setHighlightPreTag($highlightPreTag) + { + $this->container['highlightPreTag'] = $highlightPreTag; + + return $this; + } + + /** + * Gets highlightPostTag + * + * @return string|null + */ + public function getHighlightPostTag() + { + return $this->container['highlightPostTag']; + } + + /** + * Sets highlightPostTag + * + * @param string|null $highlightPostTag The HTML string to insert after the highlighted parts in all highlight and snippet results. + * + * @return self + */ + public function setHighlightPostTag($highlightPostTag) + { + $this->container['highlightPostTag'] = $highlightPostTag; + + return $this; + } + + /** + * Gets snippetEllipsisText + * + * @return string|null + */ + public function getSnippetEllipsisText() + { + return $this->container['snippetEllipsisText']; + } + + /** + * Sets snippetEllipsisText + * + * @param string|null $snippetEllipsisText String used as an ellipsis indicator when a snippet is truncated. + * + * @return self + */ + public function setSnippetEllipsisText($snippetEllipsisText) + { + $this->container['snippetEllipsisText'] = $snippetEllipsisText; + + return $this; + } + + /** + * Gets restrictHighlightAndSnippetArrays + * + * @return bool|null + */ + public function getRestrictHighlightAndSnippetArrays() + { + return $this->container['restrictHighlightAndSnippetArrays']; + } + + /** + * Sets restrictHighlightAndSnippetArrays + * + * @param bool|null $restrictHighlightAndSnippetArrays Restrict highlighting and snippeting to items that matched the query. + * + * @return self + */ + public function setRestrictHighlightAndSnippetArrays($restrictHighlightAndSnippetArrays) + { + $this->container['restrictHighlightAndSnippetArrays'] = $restrictHighlightAndSnippetArrays; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage Set the number of hits per page. + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets minWordSizefor1Typo + * + * @return int|null + */ + public function getMinWordSizefor1Typo() + { + return $this->container['minWordSizefor1Typo']; + } + + /** + * Sets minWordSizefor1Typo + * + * @param int|null $minWordSizefor1Typo Minimum number of characters a word in the query string must contain to accept matches with 1 typo. + * + * @return self + */ + public function setMinWordSizefor1Typo($minWordSizefor1Typo) + { + $this->container['minWordSizefor1Typo'] = $minWordSizefor1Typo; + + return $this; + } + + /** + * Gets minWordSizefor2Typos + * + * @return int|null + */ + public function getMinWordSizefor2Typos() + { + return $this->container['minWordSizefor2Typos']; + } + + /** + * Sets minWordSizefor2Typos + * + * @param int|null $minWordSizefor2Typos Minimum number of characters a word in the query string must contain to accept matches with 2 typos. + * + * @return self + */ + public function setMinWordSizefor2Typos($minWordSizefor2Typos) + { + $this->container['minWordSizefor2Typos'] = $minWordSizefor2Typos; + + return $this; + } + + /** + * Gets typoTolerance + * + * @return string|null + */ + public function getTypoTolerance() + { + return $this->container['typoTolerance']; + } + + /** + * Sets typoTolerance + * + * @param string|null $typoTolerance Controls whether typo tolerance is enabled and how it is applied. + * + * @return self + */ + public function setTypoTolerance($typoTolerance) + { + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($typoTolerance) && !in_array($typoTolerance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'typoTolerance', must be one of '%s'", + $typoTolerance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['typoTolerance'] = $typoTolerance; + + return $this; + } + + /** + * Gets allowTyposOnNumericTokens + * + * @return bool|null + */ + public function getAllowTyposOnNumericTokens() + { + return $this->container['allowTyposOnNumericTokens']; + } + + /** + * Sets allowTyposOnNumericTokens + * + * @param bool|null $allowTyposOnNumericTokens Whether to allow typos on numbers (\"numeric tokens\") in the query string. + * + * @return self + */ + public function setAllowTyposOnNumericTokens($allowTyposOnNumericTokens) + { + $this->container['allowTyposOnNumericTokens'] = $allowTyposOnNumericTokens; + + return $this; + } + + /** + * Gets disableTypoToleranceOnAttributes + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnAttributes() + { + return $this->container['disableTypoToleranceOnAttributes']; + } + + /** + * Sets disableTypoToleranceOnAttributes + * + * @param string[]|null $disableTypoToleranceOnAttributes List of attributes on which you want to disable typo tolerance. + * + * @return self + */ + public function setDisableTypoToleranceOnAttributes($disableTypoToleranceOnAttributes) + { + $this->container['disableTypoToleranceOnAttributes'] = $disableTypoToleranceOnAttributes; + + return $this; + } + + /** + * Gets separatorsToIndex + * + * @return string|null + */ + public function getSeparatorsToIndex() + { + return $this->container['separatorsToIndex']; + } + + /** + * Sets separatorsToIndex + * + * @param string|null $separatorsToIndex Control which separators are indexed. + * + * @return self + */ + public function setSeparatorsToIndex($separatorsToIndex) + { + $this->container['separatorsToIndex'] = $separatorsToIndex; + + return $this; + } + + /** + * Gets ignorePlurals + * + * @return string|null + */ + public function getIgnorePlurals() + { + return $this->container['ignorePlurals']; + } + + /** + * Sets ignorePlurals + * + * @param string|null $ignorePlurals Treats singular, plurals, and other forms of declensions as matching terms. + * + * @return self + */ + public function setIgnorePlurals($ignorePlurals) + { + $this->container['ignorePlurals'] = $ignorePlurals; + + return $this; + } + + /** + * Gets removeStopWords + * + * @return string|null + */ + public function getRemoveStopWords() + { + return $this->container['removeStopWords']; + } + + /** + * Sets removeStopWords + * + * @param string|null $removeStopWords Removes stop (common) words from the query before executing it. + * + * @return self + */ + public function setRemoveStopWords($removeStopWords) + { + $this->container['removeStopWords'] = $removeStopWords; + + return $this; + } + + /** + * Gets keepDiacriticsOnCharacters + * + * @return string|null + */ + public function getKeepDiacriticsOnCharacters() + { + return $this->container['keepDiacriticsOnCharacters']; + } + + /** + * Sets keepDiacriticsOnCharacters + * + * @param string|null $keepDiacriticsOnCharacters List of characters that the engine shouldn't automatically normalize. + * + * @return self + */ + public function setKeepDiacriticsOnCharacters($keepDiacriticsOnCharacters) + { + $this->container['keepDiacriticsOnCharacters'] = $keepDiacriticsOnCharacters; + + return $this; + } + + /** + * Gets queryLanguages + * + * @return string[]|null + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages']; + } + + /** + * Sets queryLanguages + * + * @param string[]|null $queryLanguages Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets decompoundQuery + * + * @return bool|null + */ + public function getDecompoundQuery() + { + return $this->container['decompoundQuery']; + } + + /** + * Sets decompoundQuery + * + * @param bool|null $decompoundQuery Splits compound words into their composing atoms in the query. + * + * @return self + */ + public function setDecompoundQuery($decompoundQuery) + { + $this->container['decompoundQuery'] = $decompoundQuery; + + return $this; + } + + /** + * Gets enableRules + * + * @return bool|null + */ + public function getEnableRules() + { + return $this->container['enableRules']; + } + + /** + * Sets enableRules + * + * @param bool|null $enableRules Whether Rules should be globally enabled. + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets enablePersonalization + * + * @return bool|null + */ + public function getEnablePersonalization() + { + return $this->container['enablePersonalization']; + } + + /** + * Sets enablePersonalization + * + * @param bool|null $enablePersonalization Enable the Personalization feature. + * + * @return self + */ + public function setEnablePersonalization($enablePersonalization) + { + $this->container['enablePersonalization'] = $enablePersonalization; + + return $this; + } + + /** + * Gets queryType + * + * @return string|null + */ + public function getQueryType() + { + return $this->container['queryType']; + } + + /** + * Sets queryType + * + * @param string|null $queryType Controls if and how query words are interpreted as prefixes. + * + * @return self + */ + public function setQueryType($queryType) + { + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($queryType) && !in_array($queryType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'queryType', must be one of '%s'", + $queryType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['queryType'] = $queryType; + + return $this; + } + + /** + * Gets removeWordsIfNoResults + * + * @return string|null + */ + public function getRemoveWordsIfNoResults() + { + return $this->container['removeWordsIfNoResults']; + } + + /** + * Sets removeWordsIfNoResults + * + * @param string|null $removeWordsIfNoResults Selects a strategy to remove words from the query when it doesn't match any hits. + * + * @return self + */ + public function setRemoveWordsIfNoResults($removeWordsIfNoResults) + { + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($removeWordsIfNoResults) && !in_array($removeWordsIfNoResults, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $removeWordsIfNoResults, + implode("', '", $allowedValues) + ) + ); + } + $this->container['removeWordsIfNoResults'] = $removeWordsIfNoResults; + + return $this; + } + + /** + * Gets advancedSyntax + * + * @return bool|null + */ + public function getAdvancedSyntax() + { + return $this->container['advancedSyntax']; + } + + /** + * Sets advancedSyntax + * + * @param bool|null $advancedSyntax Enables the advanced query syntax. + * + * @return self + */ + public function setAdvancedSyntax($advancedSyntax) + { + $this->container['advancedSyntax'] = $advancedSyntax; + + return $this; + } + + /** + * Gets optionalWords + * + * @return string[]|null + */ + public function getOptionalWords() + { + return $this->container['optionalWords']; + } + + /** + * Sets optionalWords + * + * @param string[]|null $optionalWords A list of words that should be considered as optional when found in the query. + * + * @return self + */ + public function setOptionalWords($optionalWords) + { + $this->container['optionalWords'] = $optionalWords; + + return $this; + } + + /** + * Gets disableExactOnAttributes + * + * @return string[]|null + */ + public function getDisableExactOnAttributes() + { + return $this->container['disableExactOnAttributes']; + } + + /** + * Sets disableExactOnAttributes + * + * @param string[]|null $disableExactOnAttributes List of attributes on which you want to disable the exact ranking criterion. + * + * @return self + */ + public function setDisableExactOnAttributes($disableExactOnAttributes) + { + $this->container['disableExactOnAttributes'] = $disableExactOnAttributes; + + return $this; + } + + /** + * Gets exactOnSingleWordQuery + * + * @return string|null + */ + public function getExactOnSingleWordQuery() + { + return $this->container['exactOnSingleWordQuery']; + } + + /** + * Sets exactOnSingleWordQuery + * + * @param string|null $exactOnSingleWordQuery Controls how the exact ranking criterion is computed when the query contains only one word. + * + * @return self + */ + public function setExactOnSingleWordQuery($exactOnSingleWordQuery) + { + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($exactOnSingleWordQuery) && !in_array($exactOnSingleWordQuery, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $exactOnSingleWordQuery, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exactOnSingleWordQuery'] = $exactOnSingleWordQuery; + + return $this; + } + + /** + * Gets alternativesAsExact + * + * @return string[]|null + */ + public function getAlternativesAsExact() + { + return $this->container['alternativesAsExact']; + } + + /** + * Sets alternativesAsExact + * + * @param string[]|null $alternativesAsExact List of alternatives that should be considered an exact match by the exact ranking criterion. + * + * @return self + */ + public function setAlternativesAsExact($alternativesAsExact) + { + $allowedValues = $this->getAlternativesAsExactAllowableValues(); + if (!is_null($alternativesAsExact) && array_diff($alternativesAsExact, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'alternativesAsExact', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['alternativesAsExact'] = $alternativesAsExact; + + return $this; + } + + /** + * Gets advancedSyntaxFeatures + * + * @return string[]|null + */ + public function getAdvancedSyntaxFeatures() + { + return $this->container['advancedSyntaxFeatures']; + } + + /** + * Sets advancedSyntaxFeatures + * + * @param string[]|null $advancedSyntaxFeatures Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. + * + * @return self + */ + public function setAdvancedSyntaxFeatures($advancedSyntaxFeatures) + { + $allowedValues = $this->getAdvancedSyntaxFeaturesAllowableValues(); + if (!is_null($advancedSyntaxFeatures) && array_diff($advancedSyntaxFeatures, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'advancedSyntaxFeatures', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['advancedSyntaxFeatures'] = $advancedSyntaxFeatures; + + return $this; + } + + /** + * Gets distinct + * + * @return int|null + */ + public function getDistinct() + { + return $this->container['distinct']; + } + + /** + * Sets distinct + * + * @param int|null $distinct Enables de-duplication or grouping of results. + * + * @return self + */ + public function setDistinct($distinct) + { + + if (!is_null($distinct) && ($distinct > 4)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling IndexSettingsAsSearchParams., must be smaller than or equal to 4.'); + } + if (!is_null($distinct) && ($distinct < 0)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling IndexSettingsAsSearchParams., must be bigger than or equal to 0.'); + } + + $this->container['distinct'] = $distinct; + + return $this; + } + + /** + * Gets synonyms + * + * @return bool|null + */ + public function getSynonyms() + { + return $this->container['synonyms']; + } + + /** + * Sets synonyms + * + * @param bool|null $synonyms Whether to take into account an index's synonyms for a particular search. + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets replaceSynonymsInHighlight + * + * @return bool|null + */ + public function getReplaceSynonymsInHighlight() + { + return $this->container['replaceSynonymsInHighlight']; + } + + /** + * Sets replaceSynonymsInHighlight + * + * @param bool|null $replaceSynonymsInHighlight Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + * + * @return self + */ + public function setReplaceSynonymsInHighlight($replaceSynonymsInHighlight) + { + $this->container['replaceSynonymsInHighlight'] = $replaceSynonymsInHighlight; + + return $this; + } + + /** + * Gets minProximity + * + * @return int|null + */ + public function getMinProximity() + { + return $this->container['minProximity']; + } + + /** + * Sets minProximity + * + * @param int|null $minProximity Precision of the proximity ranking criterion. + * + * @return self + */ + public function setMinProximity($minProximity) + { + + if (!is_null($minProximity) && ($minProximity > 7)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling IndexSettingsAsSearchParams., must be smaller than or equal to 7.'); + } + if (!is_null($minProximity) && ($minProximity < 1)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling IndexSettingsAsSearchParams., must be bigger than or equal to 1.'); + } + + $this->container['minProximity'] = $minProximity; + + return $this; + } + + /** + * Gets responseFields + * + * @return string[]|null + */ + public function getResponseFields() + { + return $this->container['responseFields']; + } + + /** + * Sets responseFields + * + * @param string[]|null $responseFields Choose which fields to return in the API response. This parameters applies to search and browse queries. + * + * @return self + */ + public function setResponseFields($responseFields) + { + $this->container['responseFields'] = $responseFields; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits']; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling IndexSettingsAsSearchParams., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets attributeCriteriaComputedByMinProximity + * + * @return bool|null + */ + public function getAttributeCriteriaComputedByMinProximity() + { + return $this->container['attributeCriteriaComputedByMinProximity']; + } + + /** + * Sets attributeCriteriaComputedByMinProximity + * + * @param bool|null $attributeCriteriaComputedByMinProximity When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. + * + * @return self + */ + public function setAttributeCriteriaComputedByMinProximity($attributeCriteriaComputedByMinProximity) + { + $this->container['attributeCriteriaComputedByMinProximity'] = $attributeCriteriaComputedByMinProximity; + + return $this; + } + + /** + * Gets renderingContent + * + * @return object|null + */ + public function getRenderingContent() + { + return $this->container['renderingContent']; + } + + /** + * Sets renderingContent + * + * @param object|null $renderingContent Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/KeyObject.php b/clients/algoliasearch-client-php/lib/Model/KeyObject.php new file mode 100644 index 0000000000..070d8b2f0f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/KeyObject.php @@ -0,0 +1,614 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class KeyObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'keyObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acl' => 'string[]', + 'description' => 'string', + 'indexes' => 'string[]', + 'maxHitsPerQuery' => 'int', + 'maxQueriesPerIPPerHour' => 'int', + 'queryParameters' => 'string', + 'referers' => 'string[]', + 'validity' => 'int', + 'createdAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acl' => null, + 'description' => null, + 'indexes' => null, + 'maxHitsPerQuery' => null, + 'maxQueriesPerIPPerHour' => null, + 'queryParameters' => null, + 'referers' => null, + 'validity' => null, + 'createdAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'acl' => 'acl', + 'description' => 'description', + 'indexes' => 'indexes', + 'maxHitsPerQuery' => 'maxHitsPerQuery', + 'maxQueriesPerIPPerHour' => 'maxQueriesPerIPPerHour', + 'queryParameters' => 'queryParameters', + 'referers' => 'referers', + 'validity' => 'validity', + 'createdAt' => 'createdAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acl' => 'setAcl', + 'description' => 'setDescription', + 'indexes' => 'setIndexes', + 'maxHitsPerQuery' => 'setMaxHitsPerQuery', + 'maxQueriesPerIPPerHour' => 'setMaxQueriesPerIPPerHour', + 'queryParameters' => 'setQueryParameters', + 'referers' => 'setReferers', + 'validity' => 'setValidity', + 'createdAt' => 'setCreatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acl' => 'getAcl', + 'description' => 'getDescription', + 'indexes' => 'getIndexes', + 'maxHitsPerQuery' => 'getMaxHitsPerQuery', + 'maxQueriesPerIPPerHour' => 'getMaxQueriesPerIPPerHour', + 'queryParameters' => 'getQueryParameters', + 'referers' => 'getReferers', + 'validity' => 'getValidity', + 'createdAt' => 'getCreatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const ACL_ADD_OBJECT = 'addObject'; + const ACL_ANALYTICS = 'analytics'; + const ACL_BROWSE = 'browse'; + const ACL_DELETE_OBJECT = 'deleteObject'; + const ACL_DELETE_INDEX = 'deleteIndex'; + const ACL_EDIT_SETTINGS = 'editSettings'; + const ACL_LIST_INDEXES = 'listIndexes'; + const ACL_LOGS = 'logs'; + const ACL_PERSONALIZATION = 'personalization'; + const ACL_RECOMMENDATION = 'recommendation'; + const ACL_SEARCH = 'search'; + const ACL_SEE_UNRETRIEVABLE_ATTRIBUTES = 'seeUnretrievableAttributes'; + const ACL_SETTINGS = 'settings'; + const ACL_USAGE = 'usage'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAclAllowableValues() + { + return [ + self::ACL_ADD_OBJECT, + self::ACL_ANALYTICS, + self::ACL_BROWSE, + self::ACL_DELETE_OBJECT, + self::ACL_DELETE_INDEX, + self::ACL_EDIT_SETTINGS, + self::ACL_LIST_INDEXES, + self::ACL_LOGS, + self::ACL_PERSONALIZATION, + self::ACL_RECOMMENDATION, + self::ACL_SEARCH, + self::ACL_SEE_UNRETRIEVABLE_ATTRIBUTES, + self::ACL_SETTINGS, + self::ACL_USAGE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['acl'] = $data['acl'] ?? null; + $this->container['description'] = $data['description'] ?? ''; + $this->container['indexes'] = $data['indexes'] ?? null; + $this->container['maxHitsPerQuery'] = $data['maxHitsPerQuery'] ?? 0; + $this->container['maxQueriesPerIPPerHour'] = $data['maxQueriesPerIPPerHour'] ?? 0; + $this->container['queryParameters'] = $data['queryParameters'] ?? ''; + $this->container['referers'] = $data['referers'] ?? null; + $this->container['validity'] = $data['validity'] ?? 0; + $this->container['createdAt'] = $data['createdAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['acl'] === null) { + $invalidProperties[] = "'acl' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' 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 acl + * + * @return string[] + */ + public function getAcl() + { + return $this->container['acl']; + } + + /** + * Sets acl + * + * @param string[] $acl Set of permissions associated with the key. + * + * @return self + */ + public function setAcl($acl) + { + $allowedValues = $this->getAclAllowableValues(); + if (array_diff($acl, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'acl', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['acl'] = $acl; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A comment used to identify a key more easily in the dashboard. It is not interpreted by the API. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets indexes + * + * @return string[]|null + */ + public function getIndexes() + { + return $this->container['indexes']; + } + + /** + * Sets indexes + * + * @param string[]|null $indexes Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed. + * + * @return self + */ + public function setIndexes($indexes) + { + $this->container['indexes'] = $indexes; + + return $this; + } + + /** + * Gets maxHitsPerQuery + * + * @return int|null + */ + public function getMaxHitsPerQuery() + { + return $this->container['maxHitsPerQuery']; + } + + /** + * Sets maxHitsPerQuery + * + * @param int|null $maxHitsPerQuery Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. + * + * @return self + */ + public function setMaxHitsPerQuery($maxHitsPerQuery) + { + $this->container['maxHitsPerQuery'] = $maxHitsPerQuery; + + return $this; + } + + /** + * Gets maxQueriesPerIPPerHour + * + * @return int|null + */ + public function getMaxQueriesPerIPPerHour() + { + return $this->container['maxQueriesPerIPPerHour']; + } + + /** + * Sets maxQueriesPerIPPerHour + * + * @param int|null $maxQueriesPerIPPerHour Maximum number of API calls per hour allowed from a given IP address or a user token. + * + * @return self + */ + public function setMaxQueriesPerIPPerHour($maxQueriesPerIPPerHour) + { + $this->container['maxQueriesPerIPPerHour'] = $maxQueriesPerIPPerHour; + + return $this; + } + + /** + * Gets queryParameters + * + * @return string|null + */ + public function getQueryParameters() + { + return $this->container['queryParameters']; + } + + /** + * Sets queryParameters + * + * @param string|null $queryParameters URL-encoded query string. Force some query parameters to be applied for each query made with this API key. + * + * @return self + */ + public function setQueryParameters($queryParameters) + { + $this->container['queryParameters'] = $queryParameters; + + return $this; + } + + /** + * Gets referers + * + * @return string[]|null + */ + public function getReferers() + { + return $this->container['referers']; + } + + /** + * Sets referers + * + * @param string[]|null $referers Restrict this new API key to specific referers. If empty or blank, defaults to all referers. + * + * @return self + */ + public function setReferers($referers) + { + $this->container['referers'] = $referers; + + return $this; + } + + /** + * Gets validity + * + * @return int|null + */ + public function getValidity() + { + return $this->container['validity']; + } + + /** + * Sets validity + * + * @param int|null $validity Validity limit for this key in seconds. The key will automatically be removed after this period of time. + * + * @return self + */ + public function setValidity($validity) + { + $this->container['validity'] = $validity; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt Date of creation (ISO-8601 format). + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/Languages.php b/clients/algoliasearch-client-php/lib/Model/Languages.php new file mode 100644 index 0000000000..d760c70ecc --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Languages.php @@ -0,0 +1,390 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Languages implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'languages'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'plurals' => '\Algolia\AlgoliaSearch\Model\DictionaryLanguage', + 'stopwords' => '\Algolia\AlgoliaSearch\Model\DictionaryLanguage', + 'compounds' => '\Algolia\AlgoliaSearch\Model\DictionaryLanguage' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'plurals' => null, + 'stopwords' => null, + 'compounds' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'plurals' => 'plurals', + 'stopwords' => 'stopwords', + 'compounds' => 'compounds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'plurals' => 'setPlurals', + 'stopwords' => 'setStopwords', + 'compounds' => 'setCompounds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'plurals' => 'getPlurals', + 'stopwords' => 'getStopwords', + 'compounds' => 'getCompounds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['plurals'] = $data['plurals'] ?? null; + $this->container['stopwords'] = $data['stopwords'] ?? null; + $this->container['compounds'] = $data['compounds'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['plurals'] === null) { + $invalidProperties[] = "'plurals' can't be null"; + } + if ($this->container['stopwords'] === null) { + $invalidProperties[] = "'stopwords' can't be null"; + } + if ($this->container['compounds'] === null) { + $invalidProperties[] = "'compounds' 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 plurals + * + * @return \Algolia\AlgoliaSearch\Model\DictionaryLanguage + */ + public function getPlurals() + { + return $this->container['plurals']; + } + + /** + * Sets plurals + * + * @param \Algolia\AlgoliaSearch\Model\DictionaryLanguage $plurals plurals + * + * @return self + */ + public function setPlurals($plurals) + { + $this->container['plurals'] = $plurals; + + return $this; + } + + /** + * Gets stopwords + * + * @return \Algolia\AlgoliaSearch\Model\DictionaryLanguage + */ + public function getStopwords() + { + return $this->container['stopwords']; + } + + /** + * Sets stopwords + * + * @param \Algolia\AlgoliaSearch\Model\DictionaryLanguage $stopwords stopwords + * + * @return self + */ + public function setStopwords($stopwords) + { + $this->container['stopwords'] = $stopwords; + + return $this; + } + + /** + * Gets compounds + * + * @return \Algolia\AlgoliaSearch\Model\DictionaryLanguage + */ + public function getCompounds() + { + return $this->container['compounds']; + } + + /** + * Sets compounds + * + * @param \Algolia\AlgoliaSearch\Model\DictionaryLanguage $compounds compounds + * + * @return self + */ + public function setCompounds($compounds) + { + $this->container['compounds'] = $compounds; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php b/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php new file mode 100644 index 0000000000..82807ca45e --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php @@ -0,0 +1,323 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListApiKeysResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'listApiKeysResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'keys' => '\Algolia\AlgoliaSearch\Model\KeyObject[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'keys' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'keys' => 'keys' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'keys' => 'setKeys' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'keys' => 'getKeys' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['keys'] = $data['keys'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['keys'] === null) { + $invalidProperties[] = "'keys' 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 keys + * + * @return \Algolia\AlgoliaSearch\Model\KeyObject[] + */ + public function getKeys() + { + return $this->container['keys']; + } + + /** + * Sets keys + * + * @param \Algolia\AlgoliaSearch\Model\KeyObject[] $keys List of api keys. + * + * @return self + */ + public function setKeys($keys) + { + $this->container['keys'] = $keys; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php b/clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php new file mode 100644 index 0000000000..14f50b8b27 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php @@ -0,0 +1,324 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListClustersResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'listClustersResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'topUsers' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'topUsers' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'topUsers' => 'topUsers' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'topUsers' => 'setTopUsers' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'topUsers' => 'getTopUsers' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['topUsers'] = $data['topUsers'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['topUsers'] === null) { + $invalidProperties[] = "'topUsers' 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 topUsers + * + * @return string[] + */ + public function getTopUsers() + { + return $this->container['topUsers']; + } + + /** + * Sets topUsers + * + * @param string[] $topUsers Mapping of cluster names to top users. + * + * @return self + */ + public function setTopUsers($topUsers) + { + $this->container['topUsers'] = $topUsers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php b/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php new file mode 100644 index 0000000000..f51013b74d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListIndicesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'listIndicesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'items' => '\Algolia\AlgoliaSearch\Model\Index[]', + 'nbPages' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null, + 'nbPages' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items', + 'nbPages' => 'nbPages' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems', + 'nbPages' => 'setNbPages' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems', + 'nbPages' => 'getNbPages' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['items'] = $data['items'] ?? null; + $this->container['nbPages'] = $data['nbPages'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 items + * + * @return \Algolia\AlgoliaSearch\Model\Index[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \Algolia\AlgoliaSearch\Model\Index[]|null $items List of the fetched indices. + * + * @return self + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets nbPages + * + * @return int|null + */ + public function getNbPages() + { + return $this->container['nbPages']; + } + + /** + * Sets nbPages + * + * @param int|null $nbPages Number of pages. + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php b/clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php new file mode 100644 index 0000000000..cfbc3d2bab --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php @@ -0,0 +1,324 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListUserIdsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'listUserIdsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'userIDs' => '\Algolia\AlgoliaSearch\Model\UserId[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'userIDs' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'userIDs' => 'userIDs' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userIDs' => 'setUserIDs' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userIDs' => 'getUserIDs' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['userIDs'] = $data['userIDs'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['userIDs'] === null) { + $invalidProperties[] = "'userIDs' 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 userIDs + * + * @return \Algolia\AlgoliaSearch\Model\UserId[] + */ + public function getUserIDs() + { + return $this->container['userIDs']; + } + + /** + * Sets userIDs + * + * @param \Algolia\AlgoliaSearch\Model\UserId[] $userIDs List of userIDs. + * + * @return self + */ + public function setUserIDs($userIDs) + { + $this->container['userIDs'] = $userIDs; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/ModelInterface.php b/clients/algoliasearch-client-php/lib/Model/ModelInterface.php new file mode 100644 index 0000000000..0168035fb2 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/ModelInterface.php @@ -0,0 +1,95 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MultipleBatchResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'multipleBatchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'taskID' => 'array', + 'objectIDs' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'taskID' => null, + 'objectIDs' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'taskID' => 'taskID', + 'objectIDs' => 'objectIDs' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'taskID' => 'setTaskID', + 'objectIDs' => 'setObjectIDs' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'taskID' => 'getTaskID', + 'objectIDs' => 'getObjectIDs' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['taskID'] = $data['taskID'] ?? null; + $this->container['objectIDs'] = $data['objectIDs'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 taskID + * + * @return array|null + */ + public function getTaskID() + { + return $this->container['taskID']; + } + + /** + * Sets taskID + * + * @param array|null $taskID List of tasksIDs per index. + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + + /** + * Gets objectIDs + * + * @return string[]|null + */ + public function getObjectIDs() + { + return $this->container['objectIDs']; + } + + /** + * Sets objectIDs + * + * @param string[]|null $objectIDs List of objectID. + * + * @return self + */ + public function setObjectIDs($objectIDs) + { + $this->container['objectIDs'] = $objectIDs; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php b/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php new file mode 100644 index 0000000000..b6bedbd847 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php @@ -0,0 +1,387 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MultipleGetObjectsObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'multipleGetObjectsObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'attributesToRetrieve' => 'string[]', + 'objectID' => 'string', + 'indexName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'attributesToRetrieve' => null, + 'objectID' => null, + 'indexName' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'attributesToRetrieve' => 'attributesToRetrieve', + 'objectID' => 'objectID', + 'indexName' => 'indexName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'objectID' => 'setObjectID', + 'indexName' => 'setIndexName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'objectID' => 'getObjectID', + 'indexName' => 'getIndexName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve'] ?? null; + $this->container['objectID'] = $data['objectID'] ?? null; + $this->container['indexName'] = $data['indexName'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if ($this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' 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 attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve']; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve List of attributes to retrieve. By default, all retrievable attributes are returned. + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string $objectID ID of the object within that index. + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName']; + } + + /** + * Sets indexName + * + * @param string $indexName name of the index containing the object. + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php b/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php new file mode 100644 index 0000000000..78c03e207f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php @@ -0,0 +1,477 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MultipleQueries implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'multipleQueries'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'indexName' => 'string', + 'query' => 'string', + 'type' => 'string', + 'facet' => 'string', + 'params' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'indexName' => null, + 'query' => null, + 'type' => null, + 'facet' => null, + 'params' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'indexName' => 'indexName', + 'query' => 'query', + 'type' => 'type', + 'facet' => 'facet', + 'params' => 'params' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + 'query' => 'setQuery', + 'type' => 'setType', + 'facet' => 'setFacet', + 'params' => 'setParams' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'indexName' => 'getIndexName', + 'query' => 'getQuery', + 'type' => 'getType', + 'facet' => 'getFacet', + 'params' => 'getParams' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const TYPE__DEFAULT = 'default'; + const TYPE_FACET = 'facet'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE__DEFAULT, + self::TYPE_FACET, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['indexName'] = $data['indexName'] ?? null; + $this->container['query'] = $data['query'] ?? ''; + $this->container['type'] = $data['type'] ?? 'default'; + $this->container['facet'] = $data['facet'] ?? null; + $this->container['params'] = $data['params'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName']; + } + + /** + * Sets indexName + * + * @param string $indexName The Algolia index name. + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets query + * + * @return string|null + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string|null $query The text to search in the index. + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Perform a search query with `default`, will search for facet values if `facet` is given. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($type) && !in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets facet + * + * @return string|null + */ + public function getFacet() + { + return $this->container['facet']; + } + + /** + * Sets facet + * + * @param string|null $facet The `facet` name. + * + * @return self + */ + public function setFacet($facet) + { + $this->container['facet'] = $facet; + + return $this; + } + + /** + * Gets params + * + * @return string|null + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param string|null $params A query string of search parameters. + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php new file mode 100644 index 0000000000..364d2bbff2 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php @@ -0,0 +1,387 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MultipleQueriesObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'multipleQueriesObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'requests' => '\Algolia\AlgoliaSearch\Model\MultipleQueries[]', + 'strategy' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'requests' => null, + 'strategy' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'requests' => 'requests', + 'strategy' => 'strategy' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests', + 'strategy' => 'setStrategy' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests', + 'strategy' => 'getStrategy' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const STRATEGY_NONE = 'none'; + const STRATEGY_STOP_IF_ENOUGH_MATCHES = 'stopIfEnoughMatches'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStrategyAllowableValues() + { + return [ + self::STRATEGY_NONE, + self::STRATEGY_STOP_IF_ENOUGH_MATCHES, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['requests'] = $data['requests'] ?? null; + $this->container['strategy'] = $data['strategy'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['requests'] === null) { + $invalidProperties[] = "'requests' can't be null"; + } + $allowedValues = $this->getStrategyAllowableValues(); + if (!is_null($this->container['strategy']) && !in_array($this->container['strategy'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'strategy', must be one of '%s'", + $this->container['strategy'], + implode("', '", $allowedValues) + ); + } + + 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 requests + * + * @return \Algolia\AlgoliaSearch\Model\MultipleQueries[] + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\MultipleQueries[] $requests requests + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + + /** + * Gets strategy + * + * @return string|null + */ + public function getStrategy() + { + return $this->container['strategy']; + } + + /** + * Sets strategy + * + * @param string|null $strategy strategy + * + * @return self + */ + public function setStrategy($strategy) + { + $allowedValues = $this->getStrategyAllowableValues(); + if (!is_null($strategy) && !in_array($strategy, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'strategy', must be one of '%s'", + $strategy, + implode("', '", $allowedValues) + ) + ); + } + $this->container['strategy'] = $strategy; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php new file mode 100644 index 0000000000..a3ae8a211a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php @@ -0,0 +1,320 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MultipleQueriesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'multipleQueriesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\Algolia\AlgoliaSearch\Model\SearchResponse[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['results'] = $data['results'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 results + * + * @return \Algolia\AlgoliaSearch\Model\SearchResponse[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \Algolia\AlgoliaSearch\Model\SearchResponse[]|null $results results + * + * @return self + */ + public function setResults($results) + { + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/Operation.php b/clients/algoliasearch-client-php/lib/Model/Operation.php new file mode 100644 index 0000000000..6acd193b41 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Operation.php @@ -0,0 +1,380 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Operation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Operation_'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'action' => '\Algolia\AlgoliaSearch\Model\Action', + 'body' => 'array', + 'indexName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'action' => null, + 'body' => null, + 'indexName' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'action' => 'action', + 'body' => 'body', + 'indexName' => 'indexName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction', + 'body' => 'setBody', + 'indexName' => 'setIndexName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction', + 'body' => 'getBody', + 'indexName' => 'getIndexName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['action'] = $data['action'] ?? null; + $this->container['body'] = $data['body'] ?? null; + $this->container['indexName'] = $data['indexName'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 action + * + * @return \Algolia\AlgoliaSearch\Model\Action|null + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param \Algolia\AlgoliaSearch\Model\Action|null $action action + * + * @return self + */ + public function setAction($action) + { + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets body + * + * @return array|null + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * + * @param array|null $body arguments to the operation (depends on the type of the operation). + * + * @return self + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + + /** + * Gets indexName + * + * @return string|null + */ + public function getIndexName() + { + return $this->container['indexName']; + } + + /** + * Sets indexName + * + * @param string|null $indexName Index to target for this operation. + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php b/clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php new file mode 100644 index 0000000000..c159e57455 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php @@ -0,0 +1,446 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OperationIndexObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'operationIndexObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'destination' => 'string', + 'scope' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'destination' => null, + 'scope' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'destination' => 'destination', + 'scope' => 'scope' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'destination' => 'setDestination', + 'scope' => 'setScope' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'destination' => 'getDestination', + 'scope' => 'getScope' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const OPERATION_MOVE = 'move'; + const OPERATION_COPY = 'copy'; + const SCOPE_SETTINGS = 'settings'; + const SCOPE_SYNONYMS = 'synonyms'; + const SCOPE_RULES = 'rules'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getOperationAllowableValues() + { + return [ + self::OPERATION_MOVE, + self::OPERATION_COPY, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getScopeAllowableValues() + { + return [ + self::SCOPE_SETTINGS, + self::SCOPE_SYNONYMS, + self::SCOPE_RULES, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['operation'] = $data['operation'] ?? null; + $this->container['destination'] = $data['destination'] ?? null; + $this->container['scope'] = $data['scope'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' can't be null"; + } + $allowedValues = $this->getOperationAllowableValues(); + if (!is_null($this->container['operation']) && !in_array($this->container['operation'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'operation', must be one of '%s'", + $this->container['operation'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['destination'] === null) { + $invalidProperties[] = "'destination' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation Type of operation to perform (move or copy). + * + * @return self + */ + public function setOperation($operation) + { + $allowedValues = $this->getOperationAllowableValues(); + if (!in_array($operation, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'operation', must be one of '%s'", + $operation, + implode("', '", $allowedValues) + ) + ); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets destination + * + * @return string + */ + public function getDestination() + { + return $this->container['destination']; + } + + /** + * Sets destination + * + * @param string $destination The Algolia index name. + * + * @return self + */ + public function setDestination($destination) + { + $this->container['destination'] = $destination; + + return $this; + } + + /** + * Gets scope + * + * @return string[]|null + */ + public function getScope() + { + return $this->container['scope']; + } + + /** + * Sets scope + * + * @param string[]|null $scope Scope of the data to copy. When absent, a full copy is performed. When present, only the selected scopes are copied. + * + * @return self + */ + public function setScope($scope) + { + $allowedValues = $this->getScopeAllowableValues(); + if (!is_null($scope) && array_diff($scope, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'scope', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['scope'] = $scope; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/Params.php b/clients/algoliasearch-client-php/lib/Model/Params.php new file mode 100644 index 0000000000..ce0b7bf720 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Params.php @@ -0,0 +1,381 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Params implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'params'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'query' => 'string', + 'automaticFacetFilters' => '\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]', + 'automaticOptionalFacetFilters' => '\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'query' => null, + 'automaticFacetFilters' => null, + 'automaticOptionalFacetFilters' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'query' => 'query', + 'automaticFacetFilters' => 'automaticFacetFilters', + 'automaticOptionalFacetFilters' => 'automaticOptionalFacetFilters' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'automaticFacetFilters' => 'setAutomaticFacetFilters', + 'automaticOptionalFacetFilters' => 'setAutomaticOptionalFacetFilters' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'automaticFacetFilters' => 'getAutomaticFacetFilters', + 'automaticOptionalFacetFilters' => 'getAutomaticOptionalFacetFilters' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['query'] = $data['query'] ?? null; + $this->container['automaticFacetFilters'] = $data['automaticFacetFilters'] ?? null; + $this->container['automaticOptionalFacetFilters'] = $data['automaticOptionalFacetFilters'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 query + * + * @return string|null + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string|null $query Query string. + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets automaticFacetFilters + * + * @return \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null + */ + public function getAutomaticFacetFilters() + { + return $this->container['automaticFacetFilters']; + } + + /** + * Sets automaticFacetFilters + * + * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticFacetFilters Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern. + * + * @return self + */ + public function setAutomaticFacetFilters($automaticFacetFilters) + { + $this->container['automaticFacetFilters'] = $automaticFacetFilters; + + return $this; + } + + /** + * Gets automaticOptionalFacetFilters + * + * @return \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null + */ + public function getAutomaticOptionalFacetFilters() + { + return $this->container['automaticOptionalFacetFilters']; + } + + /** + * Sets automaticOptionalFacetFilters + * + * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticOptionalFacetFilters Same syntax as automaticFacetFilters, but the engine treats the filters as optional. + * + * @return self + */ + public function setAutomaticOptionalFacetFilters($automaticOptionalFacetFilters) + { + $this->container['automaticOptionalFacetFilters'] = $automaticOptionalFacetFilters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/Promote.php b/clients/algoliasearch-client-php/lib/Model/Promote.php new file mode 100644 index 0000000000..a13cdd05ff --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Promote.php @@ -0,0 +1,384 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Promote implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'promote'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'objectID' => 'string', + 'objectIDs' => 'string[]', + 'position' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'objectID' => null, + 'objectIDs' => null, + 'position' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'objectID' => 'objectID', + 'objectIDs' => 'objectIDs', + 'position' => 'position' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'objectIDs' => 'setObjectIDs', + 'position' => 'setPosition' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'objectIDs' => 'getObjectIDs', + 'position' => 'getPosition' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['objectID'] = $data['objectID'] ?? null; + $this->container['objectIDs'] = $data['objectIDs'] ?? null; + $this->container['position'] = $data['position'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['position'] === null) { + $invalidProperties[] = "'position' 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 objectID + * + * @return string|null + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string|null $objectID Unique identifier of the object to promote. + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets objectIDs + * + * @return string[]|null + */ + public function getObjectIDs() + { + return $this->container['objectIDs']; + } + + /** + * Sets objectIDs + * + * @param string[]|null $objectIDs Array of unique identifiers of the objects to promote. + * + * @return self + */ + public function setObjectIDs($objectIDs) + { + $this->container['objectIDs'] = $objectIDs; + + return $this; + } + + /** + * Gets position + * + * @return int + */ + public function getPosition() + { + return $this->container['position']; + } + + /** + * Sets position + * + * @param int $position The position to promote the objects to (zero-based). If you pass objectIDs, the objects are placed at this position as a group. For example, if you pass four objectIDs to position 0, the objects take the first four positions. + * + * @return self + */ + public function setPosition($position) + { + $this->container['position'] = $position; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/RankingInfo.php b/clients/algoliasearch-client-php/lib/Model/RankingInfo.php new file mode 100644 index 0000000000..64b80f554a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/RankingInfo.php @@ -0,0 +1,620 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RankingInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'rankingInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'filters' => 'int', + 'firstMatchedWord' => 'int', + 'geoDistance' => 'int', + 'geoPrecision' => 'int', + 'matchedGeoLocation' => 'array', + 'nbExactWords' => 'int', + 'nbTypos' => 'int', + 'promoted' => 'bool', + 'proximityDistance' => 'int', + 'userScore' => 'int', + 'word' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'filters' => null, + 'firstMatchedWord' => null, + 'geoDistance' => null, + 'geoPrecision' => null, + 'matchedGeoLocation' => null, + 'nbExactWords' => null, + 'nbTypos' => null, + 'promoted' => null, + 'proximityDistance' => null, + 'userScore' => null, + 'word' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'filters' => 'filters', + 'firstMatchedWord' => 'firstMatchedWord', + 'geoDistance' => 'geoDistance', + 'geoPrecision' => 'geoPrecision', + 'matchedGeoLocation' => 'matchedGeoLocation', + 'nbExactWords' => 'nbExactWords', + 'nbTypos' => 'nbTypos', + 'promoted' => 'promoted', + 'proximityDistance' => 'proximityDistance', + 'userScore' => 'userScore', + 'word' => 'word' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'filters' => 'setFilters', + 'firstMatchedWord' => 'setFirstMatchedWord', + 'geoDistance' => 'setGeoDistance', + 'geoPrecision' => 'setGeoPrecision', + 'matchedGeoLocation' => 'setMatchedGeoLocation', + 'nbExactWords' => 'setNbExactWords', + 'nbTypos' => 'setNbTypos', + 'promoted' => 'setPromoted', + 'proximityDistance' => 'setProximityDistance', + 'userScore' => 'setUserScore', + 'word' => 'setWord' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'filters' => 'getFilters', + 'firstMatchedWord' => 'getFirstMatchedWord', + 'geoDistance' => 'getGeoDistance', + 'geoPrecision' => 'getGeoPrecision', + 'matchedGeoLocation' => 'getMatchedGeoLocation', + 'nbExactWords' => 'getNbExactWords', + 'nbTypos' => 'getNbTypos', + 'promoted' => 'getPromoted', + 'proximityDistance' => 'getProximityDistance', + 'userScore' => 'getUserScore', + 'word' => 'getWord' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['filters'] = $data['filters'] ?? null; + $this->container['firstMatchedWord'] = $data['firstMatchedWord'] ?? null; + $this->container['geoDistance'] = $data['geoDistance'] ?? null; + $this->container['geoPrecision'] = $data['geoPrecision'] ?? null; + $this->container['matchedGeoLocation'] = $data['matchedGeoLocation'] ?? null; + $this->container['nbExactWords'] = $data['nbExactWords'] ?? null; + $this->container['nbTypos'] = $data['nbTypos'] ?? null; + $this->container['promoted'] = $data['promoted'] ?? null; + $this->container['proximityDistance'] = $data['proximityDistance'] ?? null; + $this->container['userScore'] = $data['userScore'] ?? null; + $this->container['word'] = $data['word'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 filters + * + * @return int|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param int|null $filters This field is reserved for advanced usage. + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets firstMatchedWord + * + * @return int|null + */ + public function getFirstMatchedWord() + { + return $this->container['firstMatchedWord']; + } + + /** + * Sets firstMatchedWord + * + * @param int|null $firstMatchedWord Position of the most important matched attribute in the attributes to index list. + * + * @return self + */ + public function setFirstMatchedWord($firstMatchedWord) + { + $this->container['firstMatchedWord'] = $firstMatchedWord; + + return $this; + } + + /** + * Gets geoDistance + * + * @return int|null + */ + public function getGeoDistance() + { + return $this->container['geoDistance']; + } + + /** + * Sets geoDistance + * + * @param int|null $geoDistance Distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters). + * + * @return self + */ + public function setGeoDistance($geoDistance) + { + $this->container['geoDistance'] = $geoDistance; + + return $this; + } + + /** + * Gets geoPrecision + * + * @return int|null + */ + public function getGeoPrecision() + { + return $this->container['geoPrecision']; + } + + /** + * Sets geoPrecision + * + * @param int|null $geoPrecision Precision used when computing the geo distance, in meters. + * + * @return self + */ + public function setGeoPrecision($geoPrecision) + { + $this->container['geoPrecision'] = $geoPrecision; + + return $this; + } + + /** + * Gets matchedGeoLocation + * + * @return array|null + */ + public function getMatchedGeoLocation() + { + return $this->container['matchedGeoLocation']; + } + + /** + * Sets matchedGeoLocation + * + * @param array|null $matchedGeoLocation matchedGeoLocation + * + * @return self + */ + public function setMatchedGeoLocation($matchedGeoLocation) + { + $this->container['matchedGeoLocation'] = $matchedGeoLocation; + + return $this; + } + + /** + * Gets nbExactWords + * + * @return int|null + */ + public function getNbExactWords() + { + return $this->container['nbExactWords']; + } + + /** + * Sets nbExactWords + * + * @param int|null $nbExactWords Number of exactly matched words. + * + * @return self + */ + public function setNbExactWords($nbExactWords) + { + $this->container['nbExactWords'] = $nbExactWords; + + return $this; + } + + /** + * Gets nbTypos + * + * @return int|null + */ + public function getNbTypos() + { + return $this->container['nbTypos']; + } + + /** + * Sets nbTypos + * + * @param int|null $nbTypos Number of typos encountered when matching the record. + * + * @return self + */ + public function setNbTypos($nbTypos) + { + $this->container['nbTypos'] = $nbTypos; + + return $this; + } + + /** + * Gets promoted + * + * @return bool|null + */ + public function getPromoted() + { + return $this->container['promoted']; + } + + /** + * Sets promoted + * + * @param bool|null $promoted Present and set to true if a Rule promoted the hit. + * + * @return self + */ + public function setPromoted($promoted) + { + $this->container['promoted'] = $promoted; + + return $this; + } + + /** + * Gets proximityDistance + * + * @return int|null + */ + public function getProximityDistance() + { + return $this->container['proximityDistance']; + } + + /** + * Sets proximityDistance + * + * @param int|null $proximityDistance When the query contains more than one word, the sum of the distances between matched words (in meters). + * + * @return self + */ + public function setProximityDistance($proximityDistance) + { + $this->container['proximityDistance'] = $proximityDistance; + + return $this; + } + + /** + * Gets userScore + * + * @return int|null + */ + public function getUserScore() + { + return $this->container['userScore']; + } + + /** + * Sets userScore + * + * @param int|null $userScore Custom ranking for the object, expressed as a single integer value. + * + * @return self + */ + public function setUserScore($userScore) + { + $this->container['userScore'] = $userScore; + + return $this; + } + + /** + * Gets word + * + * @return int|null + */ + public function getWord() + { + return $this->container['word']; + } + + /** + * Sets word + * + * @param int|null $word Number of matched words, including prefixes and typos. + * + * @return self + */ + public function setWord($word) + { + $this->container['word'] = $word; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php b/clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php new file mode 100644 index 0000000000..aa50e9c526 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php @@ -0,0 +1,380 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RankingInfoMatchedGeoLocation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'rankingInfo_matchedGeoLocation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'lat' => 'double', + 'lng' => 'double', + 'distance' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'lat' => 'double', + 'lng' => 'double', + 'distance' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'lat' => 'lat', + 'lng' => 'lng', + 'distance' => 'distance' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'lat' => 'setLat', + 'lng' => 'setLng', + 'distance' => 'setDistance' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'lat' => 'getLat', + 'lng' => 'getLng', + 'distance' => 'getDistance' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['lat'] = $data['lat'] ?? null; + $this->container['lng'] = $data['lng'] ?? null; + $this->container['distance'] = $data['distance'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 lat + * + * @return double|null + */ + public function getLat() + { + return $this->container['lat']; + } + + /** + * Sets lat + * + * @param double|null $lat Latitude of the matched location. + * + * @return self + */ + public function setLat($lat) + { + $this->container['lat'] = $lat; + + return $this; + } + + /** + * Gets lng + * + * @return double|null + */ + public function getLng() + { + return $this->container['lng']; + } + + /** + * Sets lng + * + * @param double|null $lng Longitude of the matched location. + * + * @return self + */ + public function setLng($lng) + { + $this->container['lng'] = $lng; + + return $this; + } + + /** + * Gets distance + * + * @return int|null + */ + public function getDistance() + { + return $this->container['distance']; + } + + /** + * Sets distance + * + * @param int|null $distance Distance between the matched location and the search location (in meters). + * + * @return self + */ + public function setDistance($distance) + { + $this->container['distance'] = $distance; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/Record.php b/clients/algoliasearch-client-php/lib/Model/Record.php new file mode 100644 index 0000000000..74f975408c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Record.php @@ -0,0 +1,444 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Record implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'record'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'objectID' => 'string', + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\HighlightResult', + 'snippetResult' => '\Algolia\AlgoliaSearch\Model\SnippetResult', + 'rankingInfo' => '\Algolia\AlgoliaSearch\Model\RankingInfo', + 'distinctSeqID' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'objectID' => null, + 'highlightResult' => null, + 'snippetResult' => null, + 'rankingInfo' => null, + 'distinctSeqID' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'objectID' => 'objectID', + 'highlightResult' => '_highlightResult', + 'snippetResult' => '_snippetResult', + 'rankingInfo' => '_rankingInfo', + 'distinctSeqID' => '_distinctSeqID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'highlightResult' => 'setHighlightResult', + 'snippetResult' => 'setSnippetResult', + 'rankingInfo' => 'setRankingInfo', + 'distinctSeqID' => 'setDistinctSeqID' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'highlightResult' => 'getHighlightResult', + 'snippetResult' => 'getSnippetResult', + 'rankingInfo' => 'getRankingInfo', + 'distinctSeqID' => 'getDistinctSeqID' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['objectID'] = $data['objectID'] ?? null; + $this->container['highlightResult'] = $data['highlightResult'] ?? null; + $this->container['snippetResult'] = $data['snippetResult'] ?? null; + $this->container['rankingInfo'] = $data['rankingInfo'] ?? null; + $this->container['distinctSeqID'] = $data['distinctSeqID'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' 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 objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string $objectID Unique identifier of the object. + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets highlightResult + * + * @return \Algolia\AlgoliaSearch\Model\HighlightResult|null + */ + public function getHighlightResult() + { + return $this->container['highlightResult']; + } + + /** + * Sets highlightResult + * + * @param \Algolia\AlgoliaSearch\Model\HighlightResult|null $highlightResult highlightResult + * + * @return self + */ + public function setHighlightResult($highlightResult) + { + $this->container['highlightResult'] = $highlightResult; + + return $this; + } + + /** + * Gets snippetResult + * + * @return \Algolia\AlgoliaSearch\Model\SnippetResult|null + */ + public function getSnippetResult() + { + return $this->container['snippetResult']; + } + + /** + * Sets snippetResult + * + * @param \Algolia\AlgoliaSearch\Model\SnippetResult|null $snippetResult snippetResult + * + * @return self + */ + public function setSnippetResult($snippetResult) + { + $this->container['snippetResult'] = $snippetResult; + + return $this; + } + + /** + * Gets rankingInfo + * + * @return \Algolia\AlgoliaSearch\Model\RankingInfo|null + */ + public function getRankingInfo() + { + return $this->container['rankingInfo']; + } + + /** + * Sets rankingInfo + * + * @param \Algolia\AlgoliaSearch\Model\RankingInfo|null $rankingInfo rankingInfo + * + * @return self + */ + public function setRankingInfo($rankingInfo) + { + $this->container['rankingInfo'] = $rankingInfo; + + return $this; + } + + /** + * Gets distinctSeqID + * + * @return int|null + */ + public function getDistinctSeqID() + { + return $this->container['distinctSeqID']; + } + + /** + * Sets distinctSeqID + * + * @param int|null $distinctSeqID distinctSeqID + * + * @return self + */ + public function setDistinctSeqID($distinctSeqID) + { + $this->container['distinctSeqID'] = $distinctSeqID; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php b/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php new file mode 100644 index 0000000000..cfdc2bb649 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php @@ -0,0 +1,323 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RemoveUserIdResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'removeUserIdResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'deletedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'deletedAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'deletedAt' => 'deletedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deletedAt' => 'setDeletedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deletedAt' => 'getDeletedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['deletedAt'] = $data['deletedAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['deletedAt'] === null) { + $invalidProperties[] = "'deletedAt' 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 deletedAt + * + * @return \DateTime + */ + public function getDeletedAt() + { + return $this->container['deletedAt']; + } + + /** + * Sets deletedAt + * + * @param \DateTime $deletedAt Date of deletion (ISO-8601 format). + * + * @return self + */ + public function setDeletedAt($deletedAt) + { + $this->container['deletedAt'] = $deletedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php b/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php new file mode 100644 index 0000000000..86e2e46303 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php @@ -0,0 +1,323 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ReplaceSourceResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'replaceSourceResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'updatedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'updatedAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'updatedAt' => 'updatedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'updatedAt' => 'setUpdatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'updatedAt' => 'getUpdatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['updatedAt'] = $data['updatedAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' 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 updatedAt + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime $updatedAt Date of last update (ISO-8601 format). + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/RequiredSearchParams.php b/clients/algoliasearch-client-php/lib/Model/RequiredSearchParams.php new file mode 100644 index 0000000000..f867b7bc15 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/RequiredSearchParams.php @@ -0,0 +1,323 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RequiredSearchParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'requiredSearchParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'query' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'query' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'query' => 'query' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['query'] = $data['query'] ?? ''; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' 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 query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query The text to search in the index. + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/Rule.php b/clients/algoliasearch-client-php/lib/Model/Rule.php new file mode 100644 index 0000000000..208a43c287 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Rule.php @@ -0,0 +1,477 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Rule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'rule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'objectID' => 'string', + 'conditions' => '\Algolia\AlgoliaSearch\Model\Condition[]', + 'consequence' => '\Algolia\AlgoliaSearch\Model\Consequence', + 'description' => 'string', + 'enabled' => 'bool', + 'validity' => '\Algolia\AlgoliaSearch\Model\TimeRange[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'objectID' => null, + 'conditions' => null, + 'consequence' => null, + 'description' => null, + 'enabled' => null, + 'validity' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'objectID' => 'objectID', + 'conditions' => 'conditions', + 'consequence' => 'consequence', + 'description' => 'description', + 'enabled' => 'enabled', + 'validity' => 'validity' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'conditions' => 'setConditions', + 'consequence' => 'setConsequence', + 'description' => 'setDescription', + 'enabled' => 'setEnabled', + 'validity' => 'setValidity' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'conditions' => 'getConditions', + 'consequence' => 'getConsequence', + 'description' => 'getDescription', + 'enabled' => 'getEnabled', + 'validity' => 'getValidity' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['objectID'] = $data['objectID'] ?? null; + $this->container['conditions'] = $data['conditions'] ?? null; + $this->container['consequence'] = $data['consequence'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['enabled'] = $data['enabled'] ?? true; + $this->container['validity'] = $data['validity'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if ($this->container['consequence'] === null) { + $invalidProperties[] = "'consequence' 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 objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string $objectID Unique identifier of the object. + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets conditions + * + * @return \Algolia\AlgoliaSearch\Model\Condition[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param \Algolia\AlgoliaSearch\Model\Condition[]|null $conditions A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule. + * + * @return self + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets consequence + * + * @return \Algolia\AlgoliaSearch\Model\Consequence + */ + public function getConsequence() + { + return $this->container['consequence']; + } + + /** + * Sets consequence + * + * @param \Algolia\AlgoliaSearch\Model\Consequence $consequence consequence + * + * @return self + */ + public function setConsequence($consequence) + { + $this->container['consequence'] = $consequence; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It's not interpreted by the API. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Whether the Rule is enabled. Disabled Rules remain in the index, but aren't applied at query time. + * + * @return self + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets validity + * + * @return \Algolia\AlgoliaSearch\Model\TimeRange[]|null + */ + public function getValidity() + { + return $this->container['validity']; + } + + /** + * Sets validity + * + * @param \Algolia\AlgoliaSearch\Model\TimeRange[]|null $validity By default, Rules are permanently valid. When validity periods are specified, the Rule applies only during those periods; it's ignored the rest of the time. The list must not be empty. + * + * @return self + */ + public function setValidity($validity) + { + $this->container['validity'] = $validity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php b/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php new file mode 100644 index 0000000000..d16eb8b9e8 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php @@ -0,0 +1,380 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SaveObjectResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'saveObjectResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'createdAt' => 'string', + 'taskID' => 'int', + 'objectID' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'createdAt' => null, + 'taskID' => null, + 'objectID' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'createdAt' => 'createdAt', + 'taskID' => 'taskID', + 'objectID' => 'objectID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt', + 'taskID' => 'setTaskID', + 'objectID' => 'setObjectID' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt', + 'taskID' => 'getTaskID', + 'objectID' => 'getObjectID' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['createdAt'] = $data['createdAt'] ?? null; + $this->container['taskID'] = $data['taskID'] ?? null; + $this->container['objectID'] = $data['objectID'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 createdAt + * + * @return string|null + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param string|null $createdAt createdAt + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets taskID + * + * @return int|null + */ + public function getTaskID() + { + return $this->container['taskID']; + } + + /** + * Sets taskID + * + * @param int|null $taskID taskID of the indexing task to wait for. + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + + /** + * Gets objectID + * + * @return string|null + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string|null $objectID Unique identifier of the object. + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php b/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php new file mode 100644 index 0000000000..528986e0fa --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php @@ -0,0 +1,389 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SaveSynonymResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'saveSynonymResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'taskID' => 'int', + 'updatedAt' => '\DateTime', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'taskID' => null, + 'updatedAt' => 'date-time', + 'id' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'taskID' => 'taskID', + 'updatedAt' => 'updatedAt', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'taskID' => 'setTaskID', + 'updatedAt' => 'setUpdatedAt', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'taskID' => 'getTaskID', + 'updatedAt' => 'getUpdatedAt', + 'id' => 'getId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['taskID'] = $data['taskID'] ?? null; + $this->container['updatedAt'] = $data['updatedAt'] ?? null; + $this->container['id'] = $data['id'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['taskID'] === null) { + $invalidProperties[] = "'taskID' can't be null"; + } + if ($this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' 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 taskID + * + * @return int + */ + public function getTaskID() + { + return $this->container['taskID']; + } + + /** + * Sets taskID + * + * @param int $taskID taskID of the indexing task to wait for. + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + + /** + * Gets updatedAt + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime $updatedAt Date of last update (ISO-8601 format). + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id objectID of the inserted object. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchDictionaryEntries.php b/clients/algoliasearch-client-php/lib/Model/SearchDictionaryEntries.php new file mode 100644 index 0000000000..899ca3a393 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchDictionaryEntries.php @@ -0,0 +1,414 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchDictionaryEntries implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchDictionaryEntries'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'query' => 'string', + 'page' => 'int', + 'hitsPerPage' => 'int', + 'language' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'query' => null, + 'page' => null, + 'hitsPerPage' => null, + 'language' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'query' => 'query', + 'page' => 'page', + 'hitsPerPage' => 'hitsPerPage', + 'language' => 'language' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'page' => 'setPage', + 'hitsPerPage' => 'setHitsPerPage', + 'language' => 'setLanguage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'page' => 'getPage', + 'hitsPerPage' => 'getHitsPerPage', + 'language' => 'getLanguage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['query'] = $data['query'] ?? ''; + $this->container['page'] = $data['page'] ?? 0; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['language'] = $data['language'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' 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 query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query The text to search in the index. + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page Specify the page to retrieve. + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage Set the number of hits per page. + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets language + * + * @return string|null + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string|null $language Language ISO code supported by the dictionary (e.g., \"en\" for English). + * + * @return self + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesRequest.php b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesRequest.php new file mode 100644 index 0000000000..68c4966f2b --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesRequest.php @@ -0,0 +1,389 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchForFacetValuesRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchForFacetValuesRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'params' => 'string', + 'facetQuery' => 'string', + 'maxFacetHits' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'params' => null, + 'facetQuery' => null, + 'maxFacetHits' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'params' => 'params', + 'facetQuery' => 'facetQuery', + 'maxFacetHits' => 'maxFacetHits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'params' => 'setParams', + 'facetQuery' => 'setFacetQuery', + 'maxFacetHits' => 'setMaxFacetHits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'params' => 'getParams', + 'facetQuery' => 'getFacetQuery', + 'maxFacetHits' => 'getMaxFacetHits' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['params'] = $data['params'] ?? ''; + $this->container['facetQuery'] = $data['facetQuery'] ?? ''; + $this->container['maxFacetHits'] = $data['maxFacetHits'] ?? 10; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + 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 params + * + * @return string|null + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param string|null $params Search parameters as URL-encoded query string. + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets facetQuery + * + * @return string|null + */ + public function getFacetQuery() + { + return $this->container['facetQuery']; + } + + /** + * Sets facetQuery + * + * @param string|null $facetQuery Text to search inside the facet's values. + * + * @return self + */ + public function setFacetQuery($facetQuery) + { + $this->container['facetQuery'] = $facetQuery; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits']; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling SearchForFacetValuesRequest., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponse.php new file mode 100644 index 0000000000..224d294af8 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponse.php @@ -0,0 +1,323 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchForFacetValuesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchForFacetValuesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'facetHits' => '\Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponseFacetHits[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'facetHits' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'facetHits' => 'facetHits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'facetHits' => 'setFacetHits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'facetHits' => 'getFacetHits' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['facetHits'] = $data['facetHits'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['facetHits'] === null) { + $invalidProperties[] = "'facetHits' 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 facetHits + * + * @return \Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponseFacetHits[] + */ + public function getFacetHits() + { + return $this->container['facetHits']; + } + + /** + * Sets facetHits + * + * @param \Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponseFacetHits[] $facetHits facetHits + * + * @return self + */ + public function setFacetHits($facetHits) + { + $this->container['facetHits'] = $facetHits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php new file mode 100644 index 0000000000..0213a8da2f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php @@ -0,0 +1,389 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchForFacetValuesResponseFacetHits implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchForFacetValuesResponse_facetHits'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'value' => 'string', + 'highlighted' => 'string', + 'count' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'highlighted' => null, + 'count' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'highlighted' => 'highlighted', + 'count' => 'count' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'highlighted' => 'setHighlighted', + 'count' => 'setCount' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'highlighted' => 'getHighlighted', + 'count' => 'getCount' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + $this->container['highlighted'] = $data['highlighted'] ?? null; + $this->container['count'] = $data['count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['highlighted'] === null) { + $invalidProperties[] = "'highlighted' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' 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 value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value Raw value of the facet. + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets highlighted + * + * @return string + */ + public function getHighlighted() + { + return $this->container['highlighted']; + } + + /** + * Sets highlighted + * + * @param string $highlighted Markup text with occurrences highlighted. + * + * @return self + */ + public function setHighlighted($highlighted) + { + $this->container['highlighted'] = $highlighted; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count How many objects contain this facet value. This takes into account the extra search parameters specified in the query. Like for a regular search query, the counts may not be exhaustive. + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchHits.php b/clients/algoliasearch-client-php/lib/Model/SearchHits.php new file mode 100644 index 0000000000..af0410537b --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchHits.php @@ -0,0 +1,320 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchHits implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchHits'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'hits' => '\Algolia\AlgoliaSearch\Model\Record[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'hits' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'hits' => 'hits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['hits'] = $data['hits'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 hits + * + * @return \Algolia\AlgoliaSearch\Model\Record[]|null + */ + public function getHits() + { + return $this->container['hits']; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Record[]|null $hits hits + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchParams.php b/clients/algoliasearch-client-php/lib/Model/SearchParams.php new file mode 100644 index 0000000000..8de21015f4 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchParams.php @@ -0,0 +1,2897 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'params' => 'string', + 'similarQuery' => 'string', + 'filters' => 'string', + 'facetFilters' => 'string[]', + 'optionalFilters' => 'string[]', + 'numericFilters' => 'string[]', + 'tagFilters' => 'string[]', + 'sumOrFiltersScores' => 'bool', + 'facets' => 'string[]', + 'maxValuesPerFacet' => 'int', + 'facetingAfterDistinct' => 'bool', + 'sortFacetValuesBy' => 'string', + 'page' => 'int', + 'offset' => 'int', + 'length' => 'int', + 'aroundLatLng' => 'string', + 'aroundLatLngViaIP' => 'bool', + 'aroundRadius' => 'OneOfIntegerString', + 'aroundPrecision' => 'int', + 'minimumAroundRadius' => 'int', + 'insideBoundingBox' => 'float[]', + 'insidePolygon' => 'float[]', + 'naturalLanguages' => 'string[]', + 'ruleContexts' => 'string[]', + 'personalizationImpact' => 'int', + 'userToken' => 'string', + 'getRankingInfo' => 'bool', + 'clickAnalytics' => 'bool', + 'analytics' => 'bool', + 'analyticsTags' => 'string[]', + 'percentileComputation' => 'bool', + 'enableABTest' => 'bool', + 'enableReRanking' => 'bool', + 'query' => 'string', + 'searchableAttributes' => 'string[]', + 'attributesForFaceting' => 'string[]', + 'unretrievableAttributes' => 'string[]', + 'attributesToRetrieve' => 'string[]', + 'restrictSearchableAttributes' => 'string[]', + 'ranking' => 'string[]', + 'customRanking' => 'string[]', + 'relevancyStrictness' => 'int', + 'attributesToHighlight' => 'string[]', + 'attributesToSnippet' => 'string[]', + 'highlightPreTag' => 'string', + 'highlightPostTag' => 'string', + 'snippetEllipsisText' => 'string', + 'restrictHighlightAndSnippetArrays' => 'bool', + 'hitsPerPage' => 'int', + 'minWordSizefor1Typo' => 'int', + 'minWordSizefor2Typos' => 'int', + 'typoTolerance' => 'string', + 'allowTyposOnNumericTokens' => 'bool', + 'disableTypoToleranceOnAttributes' => 'string[]', + 'separatorsToIndex' => 'string', + 'ignorePlurals' => 'string', + 'removeStopWords' => 'string', + 'keepDiacriticsOnCharacters' => 'string', + 'queryLanguages' => 'string[]', + 'decompoundQuery' => 'bool', + 'enableRules' => 'bool', + 'enablePersonalization' => 'bool', + 'queryType' => 'string', + 'removeWordsIfNoResults' => 'string', + 'advancedSyntax' => 'bool', + 'optionalWords' => 'string[]', + 'disableExactOnAttributes' => 'string[]', + 'exactOnSingleWordQuery' => 'string', + 'alternativesAsExact' => 'string[]', + 'advancedSyntaxFeatures' => 'string[]', + 'distinct' => 'int', + 'synonyms' => 'bool', + 'replaceSynonymsInHighlight' => 'bool', + 'minProximity' => 'int', + 'responseFields' => 'string[]', + 'maxFacetHits' => 'int', + 'attributeCriteriaComputedByMinProximity' => 'bool', + 'renderingContent' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'params' => null, + 'similarQuery' => null, + 'filters' => null, + 'facetFilters' => null, + 'optionalFilters' => null, + 'numericFilters' => null, + 'tagFilters' => null, + 'sumOrFiltersScores' => null, + 'facets' => null, + 'maxValuesPerFacet' => null, + 'facetingAfterDistinct' => null, + 'sortFacetValuesBy' => null, + 'page' => null, + 'offset' => null, + 'length' => null, + 'aroundLatLng' => null, + 'aroundLatLngViaIP' => null, + 'aroundRadius' => null, + 'aroundPrecision' => null, + 'minimumAroundRadius' => null, + 'insideBoundingBox' => null, + 'insidePolygon' => null, + 'naturalLanguages' => null, + 'ruleContexts' => null, + 'personalizationImpact' => null, + 'userToken' => null, + 'getRankingInfo' => null, + 'clickAnalytics' => null, + 'analytics' => null, + 'analyticsTags' => null, + 'percentileComputation' => null, + 'enableABTest' => null, + 'enableReRanking' => null, + 'query' => null, + 'searchableAttributes' => null, + 'attributesForFaceting' => null, + 'unretrievableAttributes' => null, + 'attributesToRetrieve' => null, + 'restrictSearchableAttributes' => null, + 'ranking' => null, + 'customRanking' => null, + 'relevancyStrictness' => null, + 'attributesToHighlight' => null, + 'attributesToSnippet' => null, + 'highlightPreTag' => null, + 'highlightPostTag' => null, + 'snippetEllipsisText' => null, + 'restrictHighlightAndSnippetArrays' => null, + 'hitsPerPage' => null, + 'minWordSizefor1Typo' => null, + 'minWordSizefor2Typos' => null, + 'typoTolerance' => null, + 'allowTyposOnNumericTokens' => null, + 'disableTypoToleranceOnAttributes' => null, + 'separatorsToIndex' => null, + 'ignorePlurals' => null, + 'removeStopWords' => null, + 'keepDiacriticsOnCharacters' => null, + 'queryLanguages' => null, + 'decompoundQuery' => null, + 'enableRules' => null, + 'enablePersonalization' => null, + 'queryType' => null, + 'removeWordsIfNoResults' => null, + 'advancedSyntax' => null, + 'optionalWords' => null, + 'disableExactOnAttributes' => null, + 'exactOnSingleWordQuery' => null, + 'alternativesAsExact' => null, + 'advancedSyntaxFeatures' => null, + 'distinct' => null, + 'synonyms' => null, + 'replaceSynonymsInHighlight' => null, + 'minProximity' => null, + 'responseFields' => null, + 'maxFacetHits' => null, + 'attributeCriteriaComputedByMinProximity' => null, + 'renderingContent' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'params' => 'params', + 'similarQuery' => 'similarQuery', + 'filters' => 'filters', + 'facetFilters' => 'facetFilters', + 'optionalFilters' => 'optionalFilters', + 'numericFilters' => 'numericFilters', + 'tagFilters' => 'tagFilters', + 'sumOrFiltersScores' => 'sumOrFiltersScores', + 'facets' => 'facets', + 'maxValuesPerFacet' => 'maxValuesPerFacet', + 'facetingAfterDistinct' => 'facetingAfterDistinct', + 'sortFacetValuesBy' => 'sortFacetValuesBy', + 'page' => 'page', + 'offset' => 'offset', + 'length' => 'length', + 'aroundLatLng' => 'aroundLatLng', + 'aroundLatLngViaIP' => 'aroundLatLngViaIP', + 'aroundRadius' => 'aroundRadius', + 'aroundPrecision' => 'aroundPrecision', + 'minimumAroundRadius' => 'minimumAroundRadius', + 'insideBoundingBox' => 'insideBoundingBox', + 'insidePolygon' => 'insidePolygon', + 'naturalLanguages' => 'naturalLanguages', + 'ruleContexts' => 'ruleContexts', + 'personalizationImpact' => 'personalizationImpact', + 'userToken' => 'userToken', + 'getRankingInfo' => 'getRankingInfo', + 'clickAnalytics' => 'clickAnalytics', + 'analytics' => 'analytics', + 'analyticsTags' => 'analyticsTags', + 'percentileComputation' => 'percentileComputation', + 'enableABTest' => 'enableABTest', + 'enableReRanking' => 'enableReRanking', + 'query' => 'query', + 'searchableAttributes' => 'searchableAttributes', + 'attributesForFaceting' => 'attributesForFaceting', + 'unretrievableAttributes' => 'unretrievableAttributes', + 'attributesToRetrieve' => 'attributesToRetrieve', + 'restrictSearchableAttributes' => 'restrictSearchableAttributes', + 'ranking' => 'ranking', + 'customRanking' => 'customRanking', + 'relevancyStrictness' => 'relevancyStrictness', + 'attributesToHighlight' => 'attributesToHighlight', + 'attributesToSnippet' => 'attributesToSnippet', + 'highlightPreTag' => 'highlightPreTag', + 'highlightPostTag' => 'highlightPostTag', + 'snippetEllipsisText' => 'snippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'restrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'hitsPerPage', + 'minWordSizefor1Typo' => 'minWordSizefor1Typo', + 'minWordSizefor2Typos' => 'minWordSizefor2Typos', + 'typoTolerance' => 'typoTolerance', + 'allowTyposOnNumericTokens' => 'allowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'disableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'separatorsToIndex', + 'ignorePlurals' => 'ignorePlurals', + 'removeStopWords' => 'removeStopWords', + 'keepDiacriticsOnCharacters' => 'keepDiacriticsOnCharacters', + 'queryLanguages' => 'queryLanguages', + 'decompoundQuery' => 'decompoundQuery', + 'enableRules' => 'enableRules', + 'enablePersonalization' => 'enablePersonalization', + 'queryType' => 'queryType', + 'removeWordsIfNoResults' => 'removeWordsIfNoResults', + 'advancedSyntax' => 'advancedSyntax', + 'optionalWords' => 'optionalWords', + 'disableExactOnAttributes' => 'disableExactOnAttributes', + 'exactOnSingleWordQuery' => 'exactOnSingleWordQuery', + 'alternativesAsExact' => 'alternativesAsExact', + 'advancedSyntaxFeatures' => 'advancedSyntaxFeatures', + 'distinct' => 'distinct', + 'synonyms' => 'synonyms', + 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', + 'minProximity' => 'minProximity', + 'responseFields' => 'responseFields', + 'maxFacetHits' => 'maxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', + 'renderingContent' => 'renderingContent' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'params' => 'setParams', + 'similarQuery' => 'setSimilarQuery', + 'filters' => 'setFilters', + 'facetFilters' => 'setFacetFilters', + 'optionalFilters' => 'setOptionalFilters', + 'numericFilters' => 'setNumericFilters', + 'tagFilters' => 'setTagFilters', + 'sumOrFiltersScores' => 'setSumOrFiltersScores', + 'facets' => 'setFacets', + 'maxValuesPerFacet' => 'setMaxValuesPerFacet', + 'facetingAfterDistinct' => 'setFacetingAfterDistinct', + 'sortFacetValuesBy' => 'setSortFacetValuesBy', + 'page' => 'setPage', + 'offset' => 'setOffset', + 'length' => 'setLength', + 'aroundLatLng' => 'setAroundLatLng', + 'aroundLatLngViaIP' => 'setAroundLatLngViaIP', + 'aroundRadius' => 'setAroundRadius', + 'aroundPrecision' => 'setAroundPrecision', + 'minimumAroundRadius' => 'setMinimumAroundRadius', + 'insideBoundingBox' => 'setInsideBoundingBox', + 'insidePolygon' => 'setInsidePolygon', + 'naturalLanguages' => 'setNaturalLanguages', + 'ruleContexts' => 'setRuleContexts', + 'personalizationImpact' => 'setPersonalizationImpact', + 'userToken' => 'setUserToken', + 'getRankingInfo' => 'setGetRankingInfo', + 'clickAnalytics' => 'setClickAnalytics', + 'analytics' => 'setAnalytics', + 'analyticsTags' => 'setAnalyticsTags', + 'percentileComputation' => 'setPercentileComputation', + 'enableABTest' => 'setEnableABTest', + 'enableReRanking' => 'setEnableReRanking', + 'query' => 'setQuery', + 'searchableAttributes' => 'setSearchableAttributes', + 'attributesForFaceting' => 'setAttributesForFaceting', + 'unretrievableAttributes' => 'setUnretrievableAttributes', + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'restrictSearchableAttributes' => 'setRestrictSearchableAttributes', + 'ranking' => 'setRanking', + 'customRanking' => 'setCustomRanking', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'attributesToHighlight' => 'setAttributesToHighlight', + 'attributesToSnippet' => 'setAttributesToSnippet', + 'highlightPreTag' => 'setHighlightPreTag', + 'highlightPostTag' => 'setHighlightPostTag', + 'snippetEllipsisText' => 'setSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'setRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'setHitsPerPage', + 'minWordSizefor1Typo' => 'setMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'setMinWordSizefor2Typos', + 'typoTolerance' => 'setTypoTolerance', + 'allowTyposOnNumericTokens' => 'setAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'setDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'setSeparatorsToIndex', + 'ignorePlurals' => 'setIgnorePlurals', + 'removeStopWords' => 'setRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'setKeepDiacriticsOnCharacters', + 'queryLanguages' => 'setQueryLanguages', + 'decompoundQuery' => 'setDecompoundQuery', + 'enableRules' => 'setEnableRules', + 'enablePersonalization' => 'setEnablePersonalization', + 'queryType' => 'setQueryType', + 'removeWordsIfNoResults' => 'setRemoveWordsIfNoResults', + 'advancedSyntax' => 'setAdvancedSyntax', + 'optionalWords' => 'setOptionalWords', + 'disableExactOnAttributes' => 'setDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'setExactOnSingleWordQuery', + 'alternativesAsExact' => 'setAlternativesAsExact', + 'advancedSyntaxFeatures' => 'setAdvancedSyntaxFeatures', + 'distinct' => 'setDistinct', + 'synonyms' => 'setSynonyms', + 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', + 'minProximity' => 'setMinProximity', + 'responseFields' => 'setResponseFields', + 'maxFacetHits' => 'setMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'setRenderingContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'params' => 'getParams', + 'similarQuery' => 'getSimilarQuery', + 'filters' => 'getFilters', + 'facetFilters' => 'getFacetFilters', + 'optionalFilters' => 'getOptionalFilters', + 'numericFilters' => 'getNumericFilters', + 'tagFilters' => 'getTagFilters', + 'sumOrFiltersScores' => 'getSumOrFiltersScores', + 'facets' => 'getFacets', + 'maxValuesPerFacet' => 'getMaxValuesPerFacet', + 'facetingAfterDistinct' => 'getFacetingAfterDistinct', + 'sortFacetValuesBy' => 'getSortFacetValuesBy', + 'page' => 'getPage', + 'offset' => 'getOffset', + 'length' => 'getLength', + 'aroundLatLng' => 'getAroundLatLng', + 'aroundLatLngViaIP' => 'getAroundLatLngViaIP', + 'aroundRadius' => 'getAroundRadius', + 'aroundPrecision' => 'getAroundPrecision', + 'minimumAroundRadius' => 'getMinimumAroundRadius', + 'insideBoundingBox' => 'getInsideBoundingBox', + 'insidePolygon' => 'getInsidePolygon', + 'naturalLanguages' => 'getNaturalLanguages', + 'ruleContexts' => 'getRuleContexts', + 'personalizationImpact' => 'getPersonalizationImpact', + 'userToken' => 'getUserToken', + 'getRankingInfo' => 'getGetRankingInfo', + 'clickAnalytics' => 'getClickAnalytics', + 'analytics' => 'getAnalytics', + 'analyticsTags' => 'getAnalyticsTags', + 'percentileComputation' => 'getPercentileComputation', + 'enableABTest' => 'getEnableABTest', + 'enableReRanking' => 'getEnableReRanking', + 'query' => 'getQuery', + 'searchableAttributes' => 'getSearchableAttributes', + 'attributesForFaceting' => 'getAttributesForFaceting', + 'unretrievableAttributes' => 'getUnretrievableAttributes', + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'restrictSearchableAttributes' => 'getRestrictSearchableAttributes', + 'ranking' => 'getRanking', + 'customRanking' => 'getCustomRanking', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'attributesToHighlight' => 'getAttributesToHighlight', + 'attributesToSnippet' => 'getAttributesToSnippet', + 'highlightPreTag' => 'getHighlightPreTag', + 'highlightPostTag' => 'getHighlightPostTag', + 'snippetEllipsisText' => 'getSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'getRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'getHitsPerPage', + 'minWordSizefor1Typo' => 'getMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'getMinWordSizefor2Typos', + 'typoTolerance' => 'getTypoTolerance', + 'allowTyposOnNumericTokens' => 'getAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'getDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'getSeparatorsToIndex', + 'ignorePlurals' => 'getIgnorePlurals', + 'removeStopWords' => 'getRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'getKeepDiacriticsOnCharacters', + 'queryLanguages' => 'getQueryLanguages', + 'decompoundQuery' => 'getDecompoundQuery', + 'enableRules' => 'getEnableRules', + 'enablePersonalization' => 'getEnablePersonalization', + 'queryType' => 'getQueryType', + 'removeWordsIfNoResults' => 'getRemoveWordsIfNoResults', + 'advancedSyntax' => 'getAdvancedSyntax', + 'optionalWords' => 'getOptionalWords', + 'disableExactOnAttributes' => 'getDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'getExactOnSingleWordQuery', + 'alternativesAsExact' => 'getAlternativesAsExact', + 'advancedSyntaxFeatures' => 'getAdvancedSyntaxFeatures', + 'distinct' => 'getDistinct', + 'synonyms' => 'getSynonyms', + 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', + 'minProximity' => 'getMinProximity', + 'responseFields' => 'getResponseFields', + 'maxFacetHits' => 'getMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'getRenderingContent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const TYPO_TOLERANCE_TRUE = 'true'; + const TYPO_TOLERANCE_FALSE = 'false'; + const TYPO_TOLERANCE_MIN = 'min'; + const TYPO_TOLERANCE_STRICT = 'strict'; + const QUERY_TYPE_PREFIX_LAST = 'prefixLast'; + const QUERY_TYPE_PREFIX_ALL = 'prefixAll'; + const QUERY_TYPE_PREFIX_NONE = 'prefixNone'; + const REMOVE_WORDS_IF_NO_RESULTS_NONE = 'none'; + const REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS = 'lastWords'; + const REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS = 'firstWords'; + const REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL = 'allOptional'; + const EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE = 'attribute'; + const EXACT_ON_SINGLE_WORD_QUERY_NONE = 'none'; + const EXACT_ON_SINGLE_WORD_QUERY_WORD = 'word'; + const ALTERNATIVES_AS_EXACT_IGNORE_PLURALS = 'ignorePlurals'; + const ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM = 'singleWordSynonym'; + const ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM = 'multiWordsSynonym'; + const ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE = 'exactPhrase'; + const ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS = 'excludeWords'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypoToleranceAllowableValues() + { + return [ + self::TYPO_TOLERANCE_TRUE, + self::TYPO_TOLERANCE_FALSE, + self::TYPO_TOLERANCE_MIN, + self::TYPO_TOLERANCE_STRICT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getQueryTypeAllowableValues() + { + return [ + self::QUERY_TYPE_PREFIX_LAST, + self::QUERY_TYPE_PREFIX_ALL, + self::QUERY_TYPE_PREFIX_NONE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemoveWordsIfNoResultsAllowableValues() + { + return [ + self::REMOVE_WORDS_IF_NO_RESULTS_NONE, + self::REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExactOnSingleWordQueryAllowableValues() + { + return [ + self::EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE, + self::EXACT_ON_SINGLE_WORD_QUERY_NONE, + self::EXACT_ON_SINGLE_WORD_QUERY_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAlternativesAsExactAllowableValues() + { + return [ + self::ALTERNATIVES_AS_EXACT_IGNORE_PLURALS, + self::ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM, + self::ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdvancedSyntaxFeaturesAllowableValues() + { + return [ + self::ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE, + self::ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['params'] = $data['params'] ?? ''; + $this->container['similarQuery'] = $data['similarQuery'] ?? ''; + $this->container['filters'] = $data['filters'] ?? ''; + $this->container['facetFilters'] = $data['facetFilters'] ?? null; + $this->container['optionalFilters'] = $data['optionalFilters'] ?? null; + $this->container['numericFilters'] = $data['numericFilters'] ?? null; + $this->container['tagFilters'] = $data['tagFilters'] ?? null; + $this->container['sumOrFiltersScores'] = $data['sumOrFiltersScores'] ?? false; + $this->container['facets'] = $data['facets'] ?? null; + $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet'] ?? 100; + $this->container['facetingAfterDistinct'] = $data['facetingAfterDistinct'] ?? false; + $this->container['sortFacetValuesBy'] = $data['sortFacetValuesBy'] ?? 'count'; + $this->container['page'] = $data['page'] ?? 0; + $this->container['offset'] = $data['offset'] ?? null; + $this->container['length'] = $data['length'] ?? null; + $this->container['aroundLatLng'] = $data['aroundLatLng'] ?? ''; + $this->container['aroundLatLngViaIP'] = $data['aroundLatLngViaIP'] ?? false; + $this->container['aroundRadius'] = $data['aroundRadius'] ?? null; + $this->container['aroundPrecision'] = $data['aroundPrecision'] ?? 10; + $this->container['minimumAroundRadius'] = $data['minimumAroundRadius'] ?? null; + $this->container['insideBoundingBox'] = $data['insideBoundingBox'] ?? null; + $this->container['insidePolygon'] = $data['insidePolygon'] ?? null; + $this->container['naturalLanguages'] = $data['naturalLanguages'] ?? null; + $this->container['ruleContexts'] = $data['ruleContexts'] ?? null; + $this->container['personalizationImpact'] = $data['personalizationImpact'] ?? 100; + $this->container['userToken'] = $data['userToken'] ?? null; + $this->container['getRankingInfo'] = $data['getRankingInfo'] ?? false; + $this->container['clickAnalytics'] = $data['clickAnalytics'] ?? false; + $this->container['analytics'] = $data['analytics'] ?? true; + $this->container['analyticsTags'] = $data['analyticsTags'] ?? null; + $this->container['percentileComputation'] = $data['percentileComputation'] ?? true; + $this->container['enableABTest'] = $data['enableABTest'] ?? true; + $this->container['enableReRanking'] = $data['enableReRanking'] ?? true; + $this->container['query'] = $data['query'] ?? ''; + $this->container['searchableAttributes'] = $data['searchableAttributes'] ?? null; + $this->container['attributesForFaceting'] = $data['attributesForFaceting'] ?? null; + $this->container['unretrievableAttributes'] = $data['unretrievableAttributes'] ?? null; + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve'] ?? null; + $this->container['restrictSearchableAttributes'] = $data['restrictSearchableAttributes'] ?? null; + $this->container['ranking'] = $data['ranking'] ?? null; + $this->container['customRanking'] = $data['customRanking'] ?? null; + $this->container['relevancyStrictness'] = $data['relevancyStrictness'] ?? 100; + $this->container['attributesToHighlight'] = $data['attributesToHighlight'] ?? null; + $this->container['attributesToSnippet'] = $data['attributesToSnippet'] ?? null; + $this->container['highlightPreTag'] = $data['highlightPreTag'] ?? ''; + $this->container['highlightPostTag'] = $data['highlightPostTag'] ?? ''; + $this->container['snippetEllipsisText'] = $data['snippetEllipsisText'] ?? '…'; + $this->container['restrictHighlightAndSnippetArrays'] = $data['restrictHighlightAndSnippetArrays'] ?? false; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['minWordSizefor1Typo'] = $data['minWordSizefor1Typo'] ?? 4; + $this->container['minWordSizefor2Typos'] = $data['minWordSizefor2Typos'] ?? 8; + $this->container['typoTolerance'] = $data['typoTolerance'] ?? 'true'; + $this->container['allowTyposOnNumericTokens'] = $data['allowTyposOnNumericTokens'] ?? true; + $this->container['disableTypoToleranceOnAttributes'] = $data['disableTypoToleranceOnAttributes'] ?? null; + $this->container['separatorsToIndex'] = $data['separatorsToIndex'] ?? ''; + $this->container['ignorePlurals'] = $data['ignorePlurals'] ?? 'false'; + $this->container['removeStopWords'] = $data['removeStopWords'] ?? 'false'; + $this->container['keepDiacriticsOnCharacters'] = $data['keepDiacriticsOnCharacters'] ?? ''; + $this->container['queryLanguages'] = $data['queryLanguages'] ?? null; + $this->container['decompoundQuery'] = $data['decompoundQuery'] ?? true; + $this->container['enableRules'] = $data['enableRules'] ?? true; + $this->container['enablePersonalization'] = $data['enablePersonalization'] ?? false; + $this->container['queryType'] = $data['queryType'] ?? 'prefixLast'; + $this->container['removeWordsIfNoResults'] = $data['removeWordsIfNoResults'] ?? 'none'; + $this->container['advancedSyntax'] = $data['advancedSyntax'] ?? false; + $this->container['optionalWords'] = $data['optionalWords'] ?? null; + $this->container['disableExactOnAttributes'] = $data['disableExactOnAttributes'] ?? null; + $this->container['exactOnSingleWordQuery'] = $data['exactOnSingleWordQuery'] ?? 'attribute'; + $this->container['alternativesAsExact'] = $data['alternativesAsExact'] ?? null; + $this->container['advancedSyntaxFeatures'] = $data['advancedSyntaxFeatures'] ?? null; + $this->container['distinct'] = $data['distinct'] ?? 0; + $this->container['synonyms'] = $data['synonyms'] ?? true; + $this->container['replaceSynonymsInHighlight'] = $data['replaceSynonymsInHighlight'] ?? false; + $this->container['minProximity'] = $data['minProximity'] ?? 1; + $this->container['responseFields'] = $data['responseFields'] ?? null; + $this->container['maxFacetHits'] = $data['maxFacetHits'] ?? 10; + $this->container['attributeCriteriaComputedByMinProximity'] = $data['attributeCriteriaComputedByMinProximity'] ?? false; + $this->container['renderingContent'] = $data['renderingContent'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['length']) && ($this->container['length'] > 1000)) { + $invalidProperties[] = "invalid value for 'length', must be smaller than or equal to 1000."; + } + + if (!is_null($this->container['length']) && ($this->container['length'] < 1)) { + $invalidProperties[] = "invalid value for 'length', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['minimumAroundRadius']) && ($this->container['minimumAroundRadius'] < 1)) { + $invalidProperties[] = "invalid value for 'minimumAroundRadius', must be bigger than or equal to 1."; + } + + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($this->container['typoTolerance']) && !in_array($this->container['typoTolerance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'typoTolerance', must be one of '%s'", + $this->container['typoTolerance'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'queryType', must be one of '%s'", + $this->container['queryType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($this->container['removeWordsIfNoResults']) && !in_array($this->container['removeWordsIfNoResults'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $this->container['removeWordsIfNoResults'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($this->container['exactOnSingleWordQuery']) && !in_array($this->container['exactOnSingleWordQuery'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $this->container['exactOnSingleWordQuery'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['distinct']) && ($this->container['distinct'] > 4)) { + $invalidProperties[] = "invalid value for 'distinct', must be smaller than or equal to 4."; + } + + if (!is_null($this->container['distinct']) && ($this->container['distinct'] < 0)) { + $invalidProperties[] = "invalid value for 'distinct', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['minProximity']) && ($this->container['minProximity'] > 7)) { + $invalidProperties[] = "invalid value for 'minProximity', must be smaller than or equal to 7."; + } + + if (!is_null($this->container['minProximity']) && ($this->container['minProximity'] < 1)) { + $invalidProperties[] = "invalid value for 'minProximity', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + 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 params + * + * @return string|null + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param string|null $params Search parameters as URL-encoded query string. + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets similarQuery + * + * @return string|null + */ + public function getSimilarQuery() + { + return $this->container['similarQuery']; + } + + /** + * Sets similarQuery + * + * @param string|null $similarQuery Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. + * + * @return self + */ + public function setSimilarQuery($similarQuery) + { + $this->container['similarQuery'] = $similarQuery; + + return $this; + } + + /** + * Gets filters + * + * @return string|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param string|null $filters Filter the query with numeric, facet and/or tag filters. + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets facetFilters + * + * @return string[]|null + */ + public function getFacetFilters() + { + return $this->container['facetFilters']; + } + + /** + * Sets facetFilters + * + * @param string[]|null $facetFilters Filter hits by facet value. + * + * @return self + */ + public function setFacetFilters($facetFilters) + { + $this->container['facetFilters'] = $facetFilters; + + return $this; + } + + /** + * Gets optionalFilters + * + * @return string[]|null + */ + public function getOptionalFilters() + { + return $this->container['optionalFilters']; + } + + /** + * Sets optionalFilters + * + * @param string[]|null $optionalFilters Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. + * + * @return self + */ + public function setOptionalFilters($optionalFilters) + { + $this->container['optionalFilters'] = $optionalFilters; + + return $this; + } + + /** + * Gets numericFilters + * + * @return string[]|null + */ + public function getNumericFilters() + { + return $this->container['numericFilters']; + } + + /** + * Sets numericFilters + * + * @param string[]|null $numericFilters Filter on numeric attributes. + * + * @return self + */ + public function setNumericFilters($numericFilters) + { + $this->container['numericFilters'] = $numericFilters; + + return $this; + } + + /** + * Gets tagFilters + * + * @return string[]|null + */ + public function getTagFilters() + { + return $this->container['tagFilters']; + } + + /** + * Sets tagFilters + * + * @param string[]|null $tagFilters Filter hits by tags. + * + * @return self + */ + public function setTagFilters($tagFilters) + { + $this->container['tagFilters'] = $tagFilters; + + return $this; + } + + /** + * Gets sumOrFiltersScores + * + * @return bool|null + */ + public function getSumOrFiltersScores() + { + return $this->container['sumOrFiltersScores']; + } + + /** + * Sets sumOrFiltersScores + * + * @param bool|null $sumOrFiltersScores Determines how to calculate the total score for filtering. + * + * @return self + */ + public function setSumOrFiltersScores($sumOrFiltersScores) + { + $this->container['sumOrFiltersScores'] = $sumOrFiltersScores; + + return $this; + } + + /** + * Gets facets + * + * @return string[]|null + */ + public function getFacets() + { + return $this->container['facets']; + } + + /** + * Sets facets + * + * @param string[]|null $facets Retrieve facets and their facet values. + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets maxValuesPerFacet + * + * @return int|null + */ + public function getMaxValuesPerFacet() + { + return $this->container['maxValuesPerFacet']; + } + + /** + * Sets maxValuesPerFacet + * + * @param int|null $maxValuesPerFacet Maximum number of facet values to return for each facet during a regular search. + * + * @return self + */ + public function setMaxValuesPerFacet($maxValuesPerFacet) + { + $this->container['maxValuesPerFacet'] = $maxValuesPerFacet; + + return $this; + } + + /** + * Gets facetingAfterDistinct + * + * @return bool|null + */ + public function getFacetingAfterDistinct() + { + return $this->container['facetingAfterDistinct']; + } + + /** + * Sets facetingAfterDistinct + * + * @param bool|null $facetingAfterDistinct Force faceting to be applied after de-duplication (via the Distinct setting). + * + * @return self + */ + public function setFacetingAfterDistinct($facetingAfterDistinct) + { + $this->container['facetingAfterDistinct'] = $facetingAfterDistinct; + + return $this; + } + + /** + * Gets sortFacetValuesBy + * + * @return string|null + */ + public function getSortFacetValuesBy() + { + return $this->container['sortFacetValuesBy']; + } + + /** + * Sets sortFacetValuesBy + * + * @param string|null $sortFacetValuesBy Controls how facet values are fetched. + * + * @return self + */ + public function setSortFacetValuesBy($sortFacetValuesBy) + { + $this->container['sortFacetValuesBy'] = $sortFacetValuesBy; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page Specify the page to retrieve. + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets offset + * + * @return int|null + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * + * @param int|null $offset Specify the offset of the first hit to return. + * + * @return self + */ + public function setOffset($offset) + { + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets length + * + * @return int|null + */ + public function getLength() + { + return $this->container['length']; + } + + /** + * Sets length + * + * @param int|null $length Set the number of hits to retrieve (used only with offset). + * + * @return self + */ + public function setLength($length) + { + + if (!is_null($length) && ($length > 1000)) { + throw new \InvalidArgumentException('invalid value for $length when calling SearchParams., must be smaller than or equal to 1000.'); + } + if (!is_null($length) && ($length < 1)) { + throw new \InvalidArgumentException('invalid value for $length when calling SearchParams., must be bigger than or equal to 1.'); + } + + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng']; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng Search for entries around a central geolocation, enabling a geo search within a circular area. + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets aroundLatLngViaIP + * + * @return bool|null + */ + public function getAroundLatLngViaIP() + { + return $this->container['aroundLatLngViaIP']; + } + + /** + * Sets aroundLatLngViaIP + * + * @param bool|null $aroundLatLngViaIP Search for entries around a given location automatically computed from the requester's IP address. + * + * @return self + */ + public function setAroundLatLngViaIP($aroundLatLngViaIP) + { + $this->container['aroundLatLngViaIP'] = $aroundLatLngViaIP; + + return $this; + } + + /** + * Gets aroundRadius + * + * @return OneOfIntegerString|null + */ + public function getAroundRadius() + { + return $this->container['aroundRadius']; + } + + /** + * Sets aroundRadius + * + * @param OneOfIntegerString|null $aroundRadius Define the maximum radius for a geo search (in meters). + * + * @return self + */ + public function setAroundRadius($aroundRadius) + { + $this->container['aroundRadius'] = $aroundRadius; + + return $this; + } + + /** + * Gets aroundPrecision + * + * @return int|null + */ + public function getAroundPrecision() + { + return $this->container['aroundPrecision']; + } + + /** + * Sets aroundPrecision + * + * @param int|null $aroundPrecision Precision of geo search (in meters), to add grouping by geo location to the ranking formula. + * + * @return self + */ + public function setAroundPrecision($aroundPrecision) + { + $this->container['aroundPrecision'] = $aroundPrecision; + + return $this; + } + + /** + * Gets minimumAroundRadius + * + * @return int|null + */ + public function getMinimumAroundRadius() + { + return $this->container['minimumAroundRadius']; + } + + /** + * Sets minimumAroundRadius + * + * @param int|null $minimumAroundRadius Minimum radius (in meters) used for a geo search when aroundRadius is not set. + * + * @return self + */ + public function setMinimumAroundRadius($minimumAroundRadius) + { + + if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { + throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling SearchParams., must be bigger than or equal to 1.'); + } + + $this->container['minimumAroundRadius'] = $minimumAroundRadius; + + return $this; + } + + /** + * Gets insideBoundingBox + * + * @return float[]|null + */ + public function getInsideBoundingBox() + { + return $this->container['insideBoundingBox']; + } + + /** + * Sets insideBoundingBox + * + * @param float[]|null $insideBoundingBox Search inside a rectangular area (in geo coordinates). + * + * @return self + */ + public function setInsideBoundingBox($insideBoundingBox) + { + $this->container['insideBoundingBox'] = $insideBoundingBox; + + return $this; + } + + /** + * Gets insidePolygon + * + * @return float[]|null + */ + public function getInsidePolygon() + { + return $this->container['insidePolygon']; + } + + /** + * Sets insidePolygon + * + * @param float[]|null $insidePolygon Search inside a polygon (in geo coordinates). + * + * @return self + */ + public function setInsidePolygon($insidePolygon) + { + $this->container['insidePolygon'] = $insidePolygon; + + return $this; + } + + /** + * Gets naturalLanguages + * + * @return string[]|null + */ + public function getNaturalLanguages() + { + return $this->container['naturalLanguages']; + } + + /** + * Sets naturalLanguages + * + * @param string[]|null $naturalLanguages This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. + * + * @return self + */ + public function setNaturalLanguages($naturalLanguages) + { + $this->container['naturalLanguages'] = $naturalLanguages; + + return $this; + } + + /** + * Gets ruleContexts + * + * @return string[]|null + */ + public function getRuleContexts() + { + return $this->container['ruleContexts']; + } + + /** + * Sets ruleContexts + * + * @param string[]|null $ruleContexts Enables contextual rules. + * + * @return self + */ + public function setRuleContexts($ruleContexts) + { + $this->container['ruleContexts'] = $ruleContexts; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int|null + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact']; + } + + /** + * Sets personalizationImpact + * + * @param int|null $personalizationImpact Define the impact of the Personalization feature. + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + return $this; + } + + /** + * Gets userToken + * + * @return string|null + */ + public function getUserToken() + { + return $this->container['userToken']; + } + + /** + * Sets userToken + * + * @param string|null $userToken Associates a certain user token with the current search. + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets getRankingInfo + * + * @return bool|null + */ + public function getGetRankingInfo() + { + return $this->container['getRankingInfo']; + } + + /** + * Sets getRankingInfo + * + * @param bool|null $getRankingInfo Retrieve detailed ranking information. + * + * @return self + */ + public function setGetRankingInfo($getRankingInfo) + { + $this->container['getRankingInfo'] = $getRankingInfo; + + return $this; + } + + /** + * Gets clickAnalytics + * + * @return bool|null + */ + public function getClickAnalytics() + { + return $this->container['clickAnalytics']; + } + + /** + * Sets clickAnalytics + * + * @param bool|null $clickAnalytics Enable the Click Analytics feature. + * + * @return self + */ + public function setClickAnalytics($clickAnalytics) + { + $this->container['clickAnalytics'] = $clickAnalytics; + + return $this; + } + + /** + * Gets analytics + * + * @return bool|null + */ + public function getAnalytics() + { + return $this->container['analytics']; + } + + /** + * Sets analytics + * + * @param bool|null $analytics Whether the current query will be taken into account in the Analytics. + * + * @return self + */ + public function setAnalytics($analytics) + { + $this->container['analytics'] = $analytics; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[]|null + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags']; + } + + /** + * Sets analyticsTags + * + * @param string[]|null $analyticsTags List of tags to apply to the query for analytics purposes. + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets percentileComputation + * + * @return bool|null + */ + public function getPercentileComputation() + { + return $this->container['percentileComputation']; + } + + /** + * Sets percentileComputation + * + * @param bool|null $percentileComputation Whether to include or exclude a query from the processing-time percentile computation. + * + * @return self + */ + public function setPercentileComputation($percentileComputation) + { + $this->container['percentileComputation'] = $percentileComputation; + + return $this; + } + + /** + * Gets enableABTest + * + * @return bool|null + */ + public function getEnableABTest() + { + return $this->container['enableABTest']; + } + + /** + * Sets enableABTest + * + * @param bool|null $enableABTest Whether this search should participate in running AB tests. + * + * @return self + */ + public function setEnableABTest($enableABTest) + { + $this->container['enableABTest'] = $enableABTest; + + return $this; + } + + /** + * Gets enableReRanking + * + * @return bool|null + */ + public function getEnableReRanking() + { + return $this->container['enableReRanking']; + } + + /** + * Sets enableReRanking + * + * @param bool|null $enableReRanking Whether this search should use AI Re-Ranking. + * + * @return self + */ + public function setEnableReRanking($enableReRanking) + { + $this->container['enableReRanking'] = $enableReRanking; + + return $this; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query The text to search in the index. + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets searchableAttributes + * + * @return string[]|null + */ + public function getSearchableAttributes() + { + return $this->container['searchableAttributes']; + } + + /** + * Sets searchableAttributes + * + * @param string[]|null $searchableAttributes The complete list of attributes used for searching. + * + * @return self + */ + public function setSearchableAttributes($searchableAttributes) + { + $this->container['searchableAttributes'] = $searchableAttributes; + + return $this; + } + + /** + * Gets attributesForFaceting + * + * @return string[]|null + */ + public function getAttributesForFaceting() + { + return $this->container['attributesForFaceting']; + } + + /** + * Sets attributesForFaceting + * + * @param string[]|null $attributesForFaceting The complete list of attributes that will be used for faceting. + * + * @return self + */ + public function setAttributesForFaceting($attributesForFaceting) + { + $this->container['attributesForFaceting'] = $attributesForFaceting; + + return $this; + } + + /** + * Gets unretrievableAttributes + * + * @return string[]|null + */ + public function getUnretrievableAttributes() + { + return $this->container['unretrievableAttributes']; + } + + /** + * Sets unretrievableAttributes + * + * @param string[]|null $unretrievableAttributes List of attributes that can't be retrieved at query time. + * + * @return self + */ + public function setUnretrievableAttributes($unretrievableAttributes) + { + $this->container['unretrievableAttributes'] = $unretrievableAttributes; + + return $this; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve']; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve This parameter controls which attributes to retrieve and which not to retrieve. + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets restrictSearchableAttributes + * + * @return string[]|null + */ + public function getRestrictSearchableAttributes() + { + return $this->container['restrictSearchableAttributes']; + } + + /** + * Sets restrictSearchableAttributes + * + * @param string[]|null $restrictSearchableAttributes Restricts a given query to look in only a subset of your searchable attributes. + * + * @return self + */ + public function setRestrictSearchableAttributes($restrictSearchableAttributes) + { + $this->container['restrictSearchableAttributes'] = $restrictSearchableAttributes; + + return $this; + } + + /** + * Gets ranking + * + * @return string[]|null + */ + public function getRanking() + { + return $this->container['ranking']; + } + + /** + * Sets ranking + * + * @param string[]|null $ranking Controls how Algolia should sort your results. + * + * @return self + */ + public function setRanking($ranking) + { + $this->container['ranking'] = $ranking; + + return $this; + } + + /** + * Gets customRanking + * + * @return string[]|null + */ + public function getCustomRanking() + { + return $this->container['customRanking']; + } + + /** + * Sets customRanking + * + * @param string[]|null $customRanking Specifies the custom ranking criterion. + * + * @return self + */ + public function setCustomRanking($customRanking) + { + $this->container['customRanking'] = $customRanking; + + return $this; + } + + /** + * Gets relevancyStrictness + * + * @return int|null + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness']; + } + + /** + * Sets relevancyStrictness + * + * @param int|null $relevancyStrictness Controls the relevancy threshold below which less relevant results aren't included in the results. + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets attributesToHighlight + * + * @return string[]|null + */ + public function getAttributesToHighlight() + { + return $this->container['attributesToHighlight']; + } + + /** + * Sets attributesToHighlight + * + * @param string[]|null $attributesToHighlight List of attributes to highlight. + * + * @return self + */ + public function setAttributesToHighlight($attributesToHighlight) + { + $this->container['attributesToHighlight'] = $attributesToHighlight; + + return $this; + } + + /** + * Gets attributesToSnippet + * + * @return string[]|null + */ + public function getAttributesToSnippet() + { + return $this->container['attributesToSnippet']; + } + + /** + * Sets attributesToSnippet + * + * @param string[]|null $attributesToSnippet List of attributes to snippet, with an optional maximum number of words to snippet. + * + * @return self + */ + public function setAttributesToSnippet($attributesToSnippet) + { + $this->container['attributesToSnippet'] = $attributesToSnippet; + + return $this; + } + + /** + * Gets highlightPreTag + * + * @return string|null + */ + public function getHighlightPreTag() + { + return $this->container['highlightPreTag']; + } + + /** + * Sets highlightPreTag + * + * @param string|null $highlightPreTag The HTML string to insert before the highlighted parts in all highlight and snippet results. + * + * @return self + */ + public function setHighlightPreTag($highlightPreTag) + { + $this->container['highlightPreTag'] = $highlightPreTag; + + return $this; + } + + /** + * Gets highlightPostTag + * + * @return string|null + */ + public function getHighlightPostTag() + { + return $this->container['highlightPostTag']; + } + + /** + * Sets highlightPostTag + * + * @param string|null $highlightPostTag The HTML string to insert after the highlighted parts in all highlight and snippet results. + * + * @return self + */ + public function setHighlightPostTag($highlightPostTag) + { + $this->container['highlightPostTag'] = $highlightPostTag; + + return $this; + } + + /** + * Gets snippetEllipsisText + * + * @return string|null + */ + public function getSnippetEllipsisText() + { + return $this->container['snippetEllipsisText']; + } + + /** + * Sets snippetEllipsisText + * + * @param string|null $snippetEllipsisText String used as an ellipsis indicator when a snippet is truncated. + * + * @return self + */ + public function setSnippetEllipsisText($snippetEllipsisText) + { + $this->container['snippetEllipsisText'] = $snippetEllipsisText; + + return $this; + } + + /** + * Gets restrictHighlightAndSnippetArrays + * + * @return bool|null + */ + public function getRestrictHighlightAndSnippetArrays() + { + return $this->container['restrictHighlightAndSnippetArrays']; + } + + /** + * Sets restrictHighlightAndSnippetArrays + * + * @param bool|null $restrictHighlightAndSnippetArrays Restrict highlighting and snippeting to items that matched the query. + * + * @return self + */ + public function setRestrictHighlightAndSnippetArrays($restrictHighlightAndSnippetArrays) + { + $this->container['restrictHighlightAndSnippetArrays'] = $restrictHighlightAndSnippetArrays; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage Set the number of hits per page. + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets minWordSizefor1Typo + * + * @return int|null + */ + public function getMinWordSizefor1Typo() + { + return $this->container['minWordSizefor1Typo']; + } + + /** + * Sets minWordSizefor1Typo + * + * @param int|null $minWordSizefor1Typo Minimum number of characters a word in the query string must contain to accept matches with 1 typo. + * + * @return self + */ + public function setMinWordSizefor1Typo($minWordSizefor1Typo) + { + $this->container['minWordSizefor1Typo'] = $minWordSizefor1Typo; + + return $this; + } + + /** + * Gets minWordSizefor2Typos + * + * @return int|null + */ + public function getMinWordSizefor2Typos() + { + return $this->container['minWordSizefor2Typos']; + } + + /** + * Sets minWordSizefor2Typos + * + * @param int|null $minWordSizefor2Typos Minimum number of characters a word in the query string must contain to accept matches with 2 typos. + * + * @return self + */ + public function setMinWordSizefor2Typos($minWordSizefor2Typos) + { + $this->container['minWordSizefor2Typos'] = $minWordSizefor2Typos; + + return $this; + } + + /** + * Gets typoTolerance + * + * @return string|null + */ + public function getTypoTolerance() + { + return $this->container['typoTolerance']; + } + + /** + * Sets typoTolerance + * + * @param string|null $typoTolerance Controls whether typo tolerance is enabled and how it is applied. + * + * @return self + */ + public function setTypoTolerance($typoTolerance) + { + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($typoTolerance) && !in_array($typoTolerance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'typoTolerance', must be one of '%s'", + $typoTolerance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['typoTolerance'] = $typoTolerance; + + return $this; + } + + /** + * Gets allowTyposOnNumericTokens + * + * @return bool|null + */ + public function getAllowTyposOnNumericTokens() + { + return $this->container['allowTyposOnNumericTokens']; + } + + /** + * Sets allowTyposOnNumericTokens + * + * @param bool|null $allowTyposOnNumericTokens Whether to allow typos on numbers (\"numeric tokens\") in the query string. + * + * @return self + */ + public function setAllowTyposOnNumericTokens($allowTyposOnNumericTokens) + { + $this->container['allowTyposOnNumericTokens'] = $allowTyposOnNumericTokens; + + return $this; + } + + /** + * Gets disableTypoToleranceOnAttributes + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnAttributes() + { + return $this->container['disableTypoToleranceOnAttributes']; + } + + /** + * Sets disableTypoToleranceOnAttributes + * + * @param string[]|null $disableTypoToleranceOnAttributes List of attributes on which you want to disable typo tolerance. + * + * @return self + */ + public function setDisableTypoToleranceOnAttributes($disableTypoToleranceOnAttributes) + { + $this->container['disableTypoToleranceOnAttributes'] = $disableTypoToleranceOnAttributes; + + return $this; + } + + /** + * Gets separatorsToIndex + * + * @return string|null + */ + public function getSeparatorsToIndex() + { + return $this->container['separatorsToIndex']; + } + + /** + * Sets separatorsToIndex + * + * @param string|null $separatorsToIndex Control which separators are indexed. + * + * @return self + */ + public function setSeparatorsToIndex($separatorsToIndex) + { + $this->container['separatorsToIndex'] = $separatorsToIndex; + + return $this; + } + + /** + * Gets ignorePlurals + * + * @return string|null + */ + public function getIgnorePlurals() + { + return $this->container['ignorePlurals']; + } + + /** + * Sets ignorePlurals + * + * @param string|null $ignorePlurals Treats singular, plurals, and other forms of declensions as matching terms. + * + * @return self + */ + public function setIgnorePlurals($ignorePlurals) + { + $this->container['ignorePlurals'] = $ignorePlurals; + + return $this; + } + + /** + * Gets removeStopWords + * + * @return string|null + */ + public function getRemoveStopWords() + { + return $this->container['removeStopWords']; + } + + /** + * Sets removeStopWords + * + * @param string|null $removeStopWords Removes stop (common) words from the query before executing it. + * + * @return self + */ + public function setRemoveStopWords($removeStopWords) + { + $this->container['removeStopWords'] = $removeStopWords; + + return $this; + } + + /** + * Gets keepDiacriticsOnCharacters + * + * @return string|null + */ + public function getKeepDiacriticsOnCharacters() + { + return $this->container['keepDiacriticsOnCharacters']; + } + + /** + * Sets keepDiacriticsOnCharacters + * + * @param string|null $keepDiacriticsOnCharacters List of characters that the engine shouldn't automatically normalize. + * + * @return self + */ + public function setKeepDiacriticsOnCharacters($keepDiacriticsOnCharacters) + { + $this->container['keepDiacriticsOnCharacters'] = $keepDiacriticsOnCharacters; + + return $this; + } + + /** + * Gets queryLanguages + * + * @return string[]|null + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages']; + } + + /** + * Sets queryLanguages + * + * @param string[]|null $queryLanguages Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets decompoundQuery + * + * @return bool|null + */ + public function getDecompoundQuery() + { + return $this->container['decompoundQuery']; + } + + /** + * Sets decompoundQuery + * + * @param bool|null $decompoundQuery Splits compound words into their composing atoms in the query. + * + * @return self + */ + public function setDecompoundQuery($decompoundQuery) + { + $this->container['decompoundQuery'] = $decompoundQuery; + + return $this; + } + + /** + * Gets enableRules + * + * @return bool|null + */ + public function getEnableRules() + { + return $this->container['enableRules']; + } + + /** + * Sets enableRules + * + * @param bool|null $enableRules Whether Rules should be globally enabled. + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets enablePersonalization + * + * @return bool|null + */ + public function getEnablePersonalization() + { + return $this->container['enablePersonalization']; + } + + /** + * Sets enablePersonalization + * + * @param bool|null $enablePersonalization Enable the Personalization feature. + * + * @return self + */ + public function setEnablePersonalization($enablePersonalization) + { + $this->container['enablePersonalization'] = $enablePersonalization; + + return $this; + } + + /** + * Gets queryType + * + * @return string|null + */ + public function getQueryType() + { + return $this->container['queryType']; + } + + /** + * Sets queryType + * + * @param string|null $queryType Controls if and how query words are interpreted as prefixes. + * + * @return self + */ + public function setQueryType($queryType) + { + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($queryType) && !in_array($queryType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'queryType', must be one of '%s'", + $queryType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['queryType'] = $queryType; + + return $this; + } + + /** + * Gets removeWordsIfNoResults + * + * @return string|null + */ + public function getRemoveWordsIfNoResults() + { + return $this->container['removeWordsIfNoResults']; + } + + /** + * Sets removeWordsIfNoResults + * + * @param string|null $removeWordsIfNoResults Selects a strategy to remove words from the query when it doesn't match any hits. + * + * @return self + */ + public function setRemoveWordsIfNoResults($removeWordsIfNoResults) + { + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($removeWordsIfNoResults) && !in_array($removeWordsIfNoResults, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $removeWordsIfNoResults, + implode("', '", $allowedValues) + ) + ); + } + $this->container['removeWordsIfNoResults'] = $removeWordsIfNoResults; + + return $this; + } + + /** + * Gets advancedSyntax + * + * @return bool|null + */ + public function getAdvancedSyntax() + { + return $this->container['advancedSyntax']; + } + + /** + * Sets advancedSyntax + * + * @param bool|null $advancedSyntax Enables the advanced query syntax. + * + * @return self + */ + public function setAdvancedSyntax($advancedSyntax) + { + $this->container['advancedSyntax'] = $advancedSyntax; + + return $this; + } + + /** + * Gets optionalWords + * + * @return string[]|null + */ + public function getOptionalWords() + { + return $this->container['optionalWords']; + } + + /** + * Sets optionalWords + * + * @param string[]|null $optionalWords A list of words that should be considered as optional when found in the query. + * + * @return self + */ + public function setOptionalWords($optionalWords) + { + $this->container['optionalWords'] = $optionalWords; + + return $this; + } + + /** + * Gets disableExactOnAttributes + * + * @return string[]|null + */ + public function getDisableExactOnAttributes() + { + return $this->container['disableExactOnAttributes']; + } + + /** + * Sets disableExactOnAttributes + * + * @param string[]|null $disableExactOnAttributes List of attributes on which you want to disable the exact ranking criterion. + * + * @return self + */ + public function setDisableExactOnAttributes($disableExactOnAttributes) + { + $this->container['disableExactOnAttributes'] = $disableExactOnAttributes; + + return $this; + } + + /** + * Gets exactOnSingleWordQuery + * + * @return string|null + */ + public function getExactOnSingleWordQuery() + { + return $this->container['exactOnSingleWordQuery']; + } + + /** + * Sets exactOnSingleWordQuery + * + * @param string|null $exactOnSingleWordQuery Controls how the exact ranking criterion is computed when the query contains only one word. + * + * @return self + */ + public function setExactOnSingleWordQuery($exactOnSingleWordQuery) + { + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($exactOnSingleWordQuery) && !in_array($exactOnSingleWordQuery, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $exactOnSingleWordQuery, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exactOnSingleWordQuery'] = $exactOnSingleWordQuery; + + return $this; + } + + /** + * Gets alternativesAsExact + * + * @return string[]|null + */ + public function getAlternativesAsExact() + { + return $this->container['alternativesAsExact']; + } + + /** + * Sets alternativesAsExact + * + * @param string[]|null $alternativesAsExact List of alternatives that should be considered an exact match by the exact ranking criterion. + * + * @return self + */ + public function setAlternativesAsExact($alternativesAsExact) + { + $allowedValues = $this->getAlternativesAsExactAllowableValues(); + if (!is_null($alternativesAsExact) && array_diff($alternativesAsExact, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'alternativesAsExact', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['alternativesAsExact'] = $alternativesAsExact; + + return $this; + } + + /** + * Gets advancedSyntaxFeatures + * + * @return string[]|null + */ + public function getAdvancedSyntaxFeatures() + { + return $this->container['advancedSyntaxFeatures']; + } + + /** + * Sets advancedSyntaxFeatures + * + * @param string[]|null $advancedSyntaxFeatures Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. + * + * @return self + */ + public function setAdvancedSyntaxFeatures($advancedSyntaxFeatures) + { + $allowedValues = $this->getAdvancedSyntaxFeaturesAllowableValues(); + if (!is_null($advancedSyntaxFeatures) && array_diff($advancedSyntaxFeatures, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'advancedSyntaxFeatures', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['advancedSyntaxFeatures'] = $advancedSyntaxFeatures; + + return $this; + } + + /** + * Gets distinct + * + * @return int|null + */ + public function getDistinct() + { + return $this->container['distinct']; + } + + /** + * Sets distinct + * + * @param int|null $distinct Enables de-duplication or grouping of results. + * + * @return self + */ + public function setDistinct($distinct) + { + + if (!is_null($distinct) && ($distinct > 4)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling SearchParams., must be smaller than or equal to 4.'); + } + if (!is_null($distinct) && ($distinct < 0)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling SearchParams., must be bigger than or equal to 0.'); + } + + $this->container['distinct'] = $distinct; + + return $this; + } + + /** + * Gets synonyms + * + * @return bool|null + */ + public function getSynonyms() + { + return $this->container['synonyms']; + } + + /** + * Sets synonyms + * + * @param bool|null $synonyms Whether to take into account an index's synonyms for a particular search. + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets replaceSynonymsInHighlight + * + * @return bool|null + */ + public function getReplaceSynonymsInHighlight() + { + return $this->container['replaceSynonymsInHighlight']; + } + + /** + * Sets replaceSynonymsInHighlight + * + * @param bool|null $replaceSynonymsInHighlight Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + * + * @return self + */ + public function setReplaceSynonymsInHighlight($replaceSynonymsInHighlight) + { + $this->container['replaceSynonymsInHighlight'] = $replaceSynonymsInHighlight; + + return $this; + } + + /** + * Gets minProximity + * + * @return int|null + */ + public function getMinProximity() + { + return $this->container['minProximity']; + } + + /** + * Sets minProximity + * + * @param int|null $minProximity Precision of the proximity ranking criterion. + * + * @return self + */ + public function setMinProximity($minProximity) + { + + if (!is_null($minProximity) && ($minProximity > 7)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling SearchParams., must be smaller than or equal to 7.'); + } + if (!is_null($minProximity) && ($minProximity < 1)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling SearchParams., must be bigger than or equal to 1.'); + } + + $this->container['minProximity'] = $minProximity; + + return $this; + } + + /** + * Gets responseFields + * + * @return string[]|null + */ + public function getResponseFields() + { + return $this->container['responseFields']; + } + + /** + * Sets responseFields + * + * @param string[]|null $responseFields Choose which fields to return in the API response. This parameters applies to search and browse queries. + * + * @return self + */ + public function setResponseFields($responseFields) + { + $this->container['responseFields'] = $responseFields; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits']; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling SearchParams., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets attributeCriteriaComputedByMinProximity + * + * @return bool|null + */ + public function getAttributeCriteriaComputedByMinProximity() + { + return $this->container['attributeCriteriaComputedByMinProximity']; + } + + /** + * Sets attributeCriteriaComputedByMinProximity + * + * @param bool|null $attributeCriteriaComputedByMinProximity When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. + * + * @return self + */ + public function setAttributeCriteriaComputedByMinProximity($attributeCriteriaComputedByMinProximity) + { + $this->container['attributeCriteriaComputedByMinProximity'] = $attributeCriteriaComputedByMinProximity; + + return $this; + } + + /** + * Gets renderingContent + * + * @return object|null + */ + public function getRenderingContent() + { + return $this->container['renderingContent']; + } + + /** + * Sets renderingContent + * + * @param object|null $renderingContent Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchParamsObject.php b/clients/algoliasearch-client-php/lib/Model/SearchParamsObject.php new file mode 100644 index 0000000000..aa4e7fe7a6 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchParamsObject.php @@ -0,0 +1,2867 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchParamsObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchParamsObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'similarQuery' => 'string', + 'filters' => 'string', + 'facetFilters' => 'string[]', + 'optionalFilters' => 'string[]', + 'numericFilters' => 'string[]', + 'tagFilters' => 'string[]', + 'sumOrFiltersScores' => 'bool', + 'facets' => 'string[]', + 'maxValuesPerFacet' => 'int', + 'facetingAfterDistinct' => 'bool', + 'sortFacetValuesBy' => 'string', + 'page' => 'int', + 'offset' => 'int', + 'length' => 'int', + 'aroundLatLng' => 'string', + 'aroundLatLngViaIP' => 'bool', + 'aroundRadius' => 'OneOfIntegerString', + 'aroundPrecision' => 'int', + 'minimumAroundRadius' => 'int', + 'insideBoundingBox' => 'float[]', + 'insidePolygon' => 'float[]', + 'naturalLanguages' => 'string[]', + 'ruleContexts' => 'string[]', + 'personalizationImpact' => 'int', + 'userToken' => 'string', + 'getRankingInfo' => 'bool', + 'clickAnalytics' => 'bool', + 'analytics' => 'bool', + 'analyticsTags' => 'string[]', + 'percentileComputation' => 'bool', + 'enableABTest' => 'bool', + 'enableReRanking' => 'bool', + 'query' => 'string', + 'searchableAttributes' => 'string[]', + 'attributesForFaceting' => 'string[]', + 'unretrievableAttributes' => 'string[]', + 'attributesToRetrieve' => 'string[]', + 'restrictSearchableAttributes' => 'string[]', + 'ranking' => 'string[]', + 'customRanking' => 'string[]', + 'relevancyStrictness' => 'int', + 'attributesToHighlight' => 'string[]', + 'attributesToSnippet' => 'string[]', + 'highlightPreTag' => 'string', + 'highlightPostTag' => 'string', + 'snippetEllipsisText' => 'string', + 'restrictHighlightAndSnippetArrays' => 'bool', + 'hitsPerPage' => 'int', + 'minWordSizefor1Typo' => 'int', + 'minWordSizefor2Typos' => 'int', + 'typoTolerance' => 'string', + 'allowTyposOnNumericTokens' => 'bool', + 'disableTypoToleranceOnAttributes' => 'string[]', + 'separatorsToIndex' => 'string', + 'ignorePlurals' => 'string', + 'removeStopWords' => 'string', + 'keepDiacriticsOnCharacters' => 'string', + 'queryLanguages' => 'string[]', + 'decompoundQuery' => 'bool', + 'enableRules' => 'bool', + 'enablePersonalization' => 'bool', + 'queryType' => 'string', + 'removeWordsIfNoResults' => 'string', + 'advancedSyntax' => 'bool', + 'optionalWords' => 'string[]', + 'disableExactOnAttributes' => 'string[]', + 'exactOnSingleWordQuery' => 'string', + 'alternativesAsExact' => 'string[]', + 'advancedSyntaxFeatures' => 'string[]', + 'distinct' => 'int', + 'synonyms' => 'bool', + 'replaceSynonymsInHighlight' => 'bool', + 'minProximity' => 'int', + 'responseFields' => 'string[]', + 'maxFacetHits' => 'int', + 'attributeCriteriaComputedByMinProximity' => 'bool', + 'renderingContent' => 'object' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'similarQuery' => null, + 'filters' => null, + 'facetFilters' => null, + 'optionalFilters' => null, + 'numericFilters' => null, + 'tagFilters' => null, + 'sumOrFiltersScores' => null, + 'facets' => null, + 'maxValuesPerFacet' => null, + 'facetingAfterDistinct' => null, + 'sortFacetValuesBy' => null, + 'page' => null, + 'offset' => null, + 'length' => null, + 'aroundLatLng' => null, + 'aroundLatLngViaIP' => null, + 'aroundRadius' => null, + 'aroundPrecision' => null, + 'minimumAroundRadius' => null, + 'insideBoundingBox' => null, + 'insidePolygon' => null, + 'naturalLanguages' => null, + 'ruleContexts' => null, + 'personalizationImpact' => null, + 'userToken' => null, + 'getRankingInfo' => null, + 'clickAnalytics' => null, + 'analytics' => null, + 'analyticsTags' => null, + 'percentileComputation' => null, + 'enableABTest' => null, + 'enableReRanking' => null, + 'query' => null, + 'searchableAttributes' => null, + 'attributesForFaceting' => null, + 'unretrievableAttributes' => null, + 'attributesToRetrieve' => null, + 'restrictSearchableAttributes' => null, + 'ranking' => null, + 'customRanking' => null, + 'relevancyStrictness' => null, + 'attributesToHighlight' => null, + 'attributesToSnippet' => null, + 'highlightPreTag' => null, + 'highlightPostTag' => null, + 'snippetEllipsisText' => null, + 'restrictHighlightAndSnippetArrays' => null, + 'hitsPerPage' => null, + 'minWordSizefor1Typo' => null, + 'minWordSizefor2Typos' => null, + 'typoTolerance' => null, + 'allowTyposOnNumericTokens' => null, + 'disableTypoToleranceOnAttributes' => null, + 'separatorsToIndex' => null, + 'ignorePlurals' => null, + 'removeStopWords' => null, + 'keepDiacriticsOnCharacters' => null, + 'queryLanguages' => null, + 'decompoundQuery' => null, + 'enableRules' => null, + 'enablePersonalization' => null, + 'queryType' => null, + 'removeWordsIfNoResults' => null, + 'advancedSyntax' => null, + 'optionalWords' => null, + 'disableExactOnAttributes' => null, + 'exactOnSingleWordQuery' => null, + 'alternativesAsExact' => null, + 'advancedSyntaxFeatures' => null, + 'distinct' => null, + 'synonyms' => null, + 'replaceSynonymsInHighlight' => null, + 'minProximity' => null, + 'responseFields' => null, + 'maxFacetHits' => null, + 'attributeCriteriaComputedByMinProximity' => null, + 'renderingContent' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'similarQuery' => 'similarQuery', + 'filters' => 'filters', + 'facetFilters' => 'facetFilters', + 'optionalFilters' => 'optionalFilters', + 'numericFilters' => 'numericFilters', + 'tagFilters' => 'tagFilters', + 'sumOrFiltersScores' => 'sumOrFiltersScores', + 'facets' => 'facets', + 'maxValuesPerFacet' => 'maxValuesPerFacet', + 'facetingAfterDistinct' => 'facetingAfterDistinct', + 'sortFacetValuesBy' => 'sortFacetValuesBy', + 'page' => 'page', + 'offset' => 'offset', + 'length' => 'length', + 'aroundLatLng' => 'aroundLatLng', + 'aroundLatLngViaIP' => 'aroundLatLngViaIP', + 'aroundRadius' => 'aroundRadius', + 'aroundPrecision' => 'aroundPrecision', + 'minimumAroundRadius' => 'minimumAroundRadius', + 'insideBoundingBox' => 'insideBoundingBox', + 'insidePolygon' => 'insidePolygon', + 'naturalLanguages' => 'naturalLanguages', + 'ruleContexts' => 'ruleContexts', + 'personalizationImpact' => 'personalizationImpact', + 'userToken' => 'userToken', + 'getRankingInfo' => 'getRankingInfo', + 'clickAnalytics' => 'clickAnalytics', + 'analytics' => 'analytics', + 'analyticsTags' => 'analyticsTags', + 'percentileComputation' => 'percentileComputation', + 'enableABTest' => 'enableABTest', + 'enableReRanking' => 'enableReRanking', + 'query' => 'query', + 'searchableAttributes' => 'searchableAttributes', + 'attributesForFaceting' => 'attributesForFaceting', + 'unretrievableAttributes' => 'unretrievableAttributes', + 'attributesToRetrieve' => 'attributesToRetrieve', + 'restrictSearchableAttributes' => 'restrictSearchableAttributes', + 'ranking' => 'ranking', + 'customRanking' => 'customRanking', + 'relevancyStrictness' => 'relevancyStrictness', + 'attributesToHighlight' => 'attributesToHighlight', + 'attributesToSnippet' => 'attributesToSnippet', + 'highlightPreTag' => 'highlightPreTag', + 'highlightPostTag' => 'highlightPostTag', + 'snippetEllipsisText' => 'snippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'restrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'hitsPerPage', + 'minWordSizefor1Typo' => 'minWordSizefor1Typo', + 'minWordSizefor2Typos' => 'minWordSizefor2Typos', + 'typoTolerance' => 'typoTolerance', + 'allowTyposOnNumericTokens' => 'allowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'disableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'separatorsToIndex', + 'ignorePlurals' => 'ignorePlurals', + 'removeStopWords' => 'removeStopWords', + 'keepDiacriticsOnCharacters' => 'keepDiacriticsOnCharacters', + 'queryLanguages' => 'queryLanguages', + 'decompoundQuery' => 'decompoundQuery', + 'enableRules' => 'enableRules', + 'enablePersonalization' => 'enablePersonalization', + 'queryType' => 'queryType', + 'removeWordsIfNoResults' => 'removeWordsIfNoResults', + 'advancedSyntax' => 'advancedSyntax', + 'optionalWords' => 'optionalWords', + 'disableExactOnAttributes' => 'disableExactOnAttributes', + 'exactOnSingleWordQuery' => 'exactOnSingleWordQuery', + 'alternativesAsExact' => 'alternativesAsExact', + 'advancedSyntaxFeatures' => 'advancedSyntaxFeatures', + 'distinct' => 'distinct', + 'synonyms' => 'synonyms', + 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', + 'minProximity' => 'minProximity', + 'responseFields' => 'responseFields', + 'maxFacetHits' => 'maxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', + 'renderingContent' => 'renderingContent' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'similarQuery' => 'setSimilarQuery', + 'filters' => 'setFilters', + 'facetFilters' => 'setFacetFilters', + 'optionalFilters' => 'setOptionalFilters', + 'numericFilters' => 'setNumericFilters', + 'tagFilters' => 'setTagFilters', + 'sumOrFiltersScores' => 'setSumOrFiltersScores', + 'facets' => 'setFacets', + 'maxValuesPerFacet' => 'setMaxValuesPerFacet', + 'facetingAfterDistinct' => 'setFacetingAfterDistinct', + 'sortFacetValuesBy' => 'setSortFacetValuesBy', + 'page' => 'setPage', + 'offset' => 'setOffset', + 'length' => 'setLength', + 'aroundLatLng' => 'setAroundLatLng', + 'aroundLatLngViaIP' => 'setAroundLatLngViaIP', + 'aroundRadius' => 'setAroundRadius', + 'aroundPrecision' => 'setAroundPrecision', + 'minimumAroundRadius' => 'setMinimumAroundRadius', + 'insideBoundingBox' => 'setInsideBoundingBox', + 'insidePolygon' => 'setInsidePolygon', + 'naturalLanguages' => 'setNaturalLanguages', + 'ruleContexts' => 'setRuleContexts', + 'personalizationImpact' => 'setPersonalizationImpact', + 'userToken' => 'setUserToken', + 'getRankingInfo' => 'setGetRankingInfo', + 'clickAnalytics' => 'setClickAnalytics', + 'analytics' => 'setAnalytics', + 'analyticsTags' => 'setAnalyticsTags', + 'percentileComputation' => 'setPercentileComputation', + 'enableABTest' => 'setEnableABTest', + 'enableReRanking' => 'setEnableReRanking', + 'query' => 'setQuery', + 'searchableAttributes' => 'setSearchableAttributes', + 'attributesForFaceting' => 'setAttributesForFaceting', + 'unretrievableAttributes' => 'setUnretrievableAttributes', + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'restrictSearchableAttributes' => 'setRestrictSearchableAttributes', + 'ranking' => 'setRanking', + 'customRanking' => 'setCustomRanking', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'attributesToHighlight' => 'setAttributesToHighlight', + 'attributesToSnippet' => 'setAttributesToSnippet', + 'highlightPreTag' => 'setHighlightPreTag', + 'highlightPostTag' => 'setHighlightPostTag', + 'snippetEllipsisText' => 'setSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'setRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'setHitsPerPage', + 'minWordSizefor1Typo' => 'setMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'setMinWordSizefor2Typos', + 'typoTolerance' => 'setTypoTolerance', + 'allowTyposOnNumericTokens' => 'setAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'setDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'setSeparatorsToIndex', + 'ignorePlurals' => 'setIgnorePlurals', + 'removeStopWords' => 'setRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'setKeepDiacriticsOnCharacters', + 'queryLanguages' => 'setQueryLanguages', + 'decompoundQuery' => 'setDecompoundQuery', + 'enableRules' => 'setEnableRules', + 'enablePersonalization' => 'setEnablePersonalization', + 'queryType' => 'setQueryType', + 'removeWordsIfNoResults' => 'setRemoveWordsIfNoResults', + 'advancedSyntax' => 'setAdvancedSyntax', + 'optionalWords' => 'setOptionalWords', + 'disableExactOnAttributes' => 'setDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'setExactOnSingleWordQuery', + 'alternativesAsExact' => 'setAlternativesAsExact', + 'advancedSyntaxFeatures' => 'setAdvancedSyntaxFeatures', + 'distinct' => 'setDistinct', + 'synonyms' => 'setSynonyms', + 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', + 'minProximity' => 'setMinProximity', + 'responseFields' => 'setResponseFields', + 'maxFacetHits' => 'setMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'setRenderingContent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'similarQuery' => 'getSimilarQuery', + 'filters' => 'getFilters', + 'facetFilters' => 'getFacetFilters', + 'optionalFilters' => 'getOptionalFilters', + 'numericFilters' => 'getNumericFilters', + 'tagFilters' => 'getTagFilters', + 'sumOrFiltersScores' => 'getSumOrFiltersScores', + 'facets' => 'getFacets', + 'maxValuesPerFacet' => 'getMaxValuesPerFacet', + 'facetingAfterDistinct' => 'getFacetingAfterDistinct', + 'sortFacetValuesBy' => 'getSortFacetValuesBy', + 'page' => 'getPage', + 'offset' => 'getOffset', + 'length' => 'getLength', + 'aroundLatLng' => 'getAroundLatLng', + 'aroundLatLngViaIP' => 'getAroundLatLngViaIP', + 'aroundRadius' => 'getAroundRadius', + 'aroundPrecision' => 'getAroundPrecision', + 'minimumAroundRadius' => 'getMinimumAroundRadius', + 'insideBoundingBox' => 'getInsideBoundingBox', + 'insidePolygon' => 'getInsidePolygon', + 'naturalLanguages' => 'getNaturalLanguages', + 'ruleContexts' => 'getRuleContexts', + 'personalizationImpact' => 'getPersonalizationImpact', + 'userToken' => 'getUserToken', + 'getRankingInfo' => 'getGetRankingInfo', + 'clickAnalytics' => 'getClickAnalytics', + 'analytics' => 'getAnalytics', + 'analyticsTags' => 'getAnalyticsTags', + 'percentileComputation' => 'getPercentileComputation', + 'enableABTest' => 'getEnableABTest', + 'enableReRanking' => 'getEnableReRanking', + 'query' => 'getQuery', + 'searchableAttributes' => 'getSearchableAttributes', + 'attributesForFaceting' => 'getAttributesForFaceting', + 'unretrievableAttributes' => 'getUnretrievableAttributes', + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'restrictSearchableAttributes' => 'getRestrictSearchableAttributes', + 'ranking' => 'getRanking', + 'customRanking' => 'getCustomRanking', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'attributesToHighlight' => 'getAttributesToHighlight', + 'attributesToSnippet' => 'getAttributesToSnippet', + 'highlightPreTag' => 'getHighlightPreTag', + 'highlightPostTag' => 'getHighlightPostTag', + 'snippetEllipsisText' => 'getSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'getRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'getHitsPerPage', + 'minWordSizefor1Typo' => 'getMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'getMinWordSizefor2Typos', + 'typoTolerance' => 'getTypoTolerance', + 'allowTyposOnNumericTokens' => 'getAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'getDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'getSeparatorsToIndex', + 'ignorePlurals' => 'getIgnorePlurals', + 'removeStopWords' => 'getRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'getKeepDiacriticsOnCharacters', + 'queryLanguages' => 'getQueryLanguages', + 'decompoundQuery' => 'getDecompoundQuery', + 'enableRules' => 'getEnableRules', + 'enablePersonalization' => 'getEnablePersonalization', + 'queryType' => 'getQueryType', + 'removeWordsIfNoResults' => 'getRemoveWordsIfNoResults', + 'advancedSyntax' => 'getAdvancedSyntax', + 'optionalWords' => 'getOptionalWords', + 'disableExactOnAttributes' => 'getDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'getExactOnSingleWordQuery', + 'alternativesAsExact' => 'getAlternativesAsExact', + 'advancedSyntaxFeatures' => 'getAdvancedSyntaxFeatures', + 'distinct' => 'getDistinct', + 'synonyms' => 'getSynonyms', + 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', + 'minProximity' => 'getMinProximity', + 'responseFields' => 'getResponseFields', + 'maxFacetHits' => 'getMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'getRenderingContent' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const TYPO_TOLERANCE_TRUE = 'true'; + const TYPO_TOLERANCE_FALSE = 'false'; + const TYPO_TOLERANCE_MIN = 'min'; + const TYPO_TOLERANCE_STRICT = 'strict'; + const QUERY_TYPE_PREFIX_LAST = 'prefixLast'; + const QUERY_TYPE_PREFIX_ALL = 'prefixAll'; + const QUERY_TYPE_PREFIX_NONE = 'prefixNone'; + const REMOVE_WORDS_IF_NO_RESULTS_NONE = 'none'; + const REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS = 'lastWords'; + const REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS = 'firstWords'; + const REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL = 'allOptional'; + const EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE = 'attribute'; + const EXACT_ON_SINGLE_WORD_QUERY_NONE = 'none'; + const EXACT_ON_SINGLE_WORD_QUERY_WORD = 'word'; + const ALTERNATIVES_AS_EXACT_IGNORE_PLURALS = 'ignorePlurals'; + const ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM = 'singleWordSynonym'; + const ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM = 'multiWordsSynonym'; + const ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE = 'exactPhrase'; + const ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS = 'excludeWords'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypoToleranceAllowableValues() + { + return [ + self::TYPO_TOLERANCE_TRUE, + self::TYPO_TOLERANCE_FALSE, + self::TYPO_TOLERANCE_MIN, + self::TYPO_TOLERANCE_STRICT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getQueryTypeAllowableValues() + { + return [ + self::QUERY_TYPE_PREFIX_LAST, + self::QUERY_TYPE_PREFIX_ALL, + self::QUERY_TYPE_PREFIX_NONE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemoveWordsIfNoResultsAllowableValues() + { + return [ + self::REMOVE_WORDS_IF_NO_RESULTS_NONE, + self::REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExactOnSingleWordQueryAllowableValues() + { + return [ + self::EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE, + self::EXACT_ON_SINGLE_WORD_QUERY_NONE, + self::EXACT_ON_SINGLE_WORD_QUERY_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAlternativesAsExactAllowableValues() + { + return [ + self::ALTERNATIVES_AS_EXACT_IGNORE_PLURALS, + self::ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM, + self::ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdvancedSyntaxFeaturesAllowableValues() + { + return [ + self::ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE, + self::ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['similarQuery'] = $data['similarQuery'] ?? ''; + $this->container['filters'] = $data['filters'] ?? ''; + $this->container['facetFilters'] = $data['facetFilters'] ?? null; + $this->container['optionalFilters'] = $data['optionalFilters'] ?? null; + $this->container['numericFilters'] = $data['numericFilters'] ?? null; + $this->container['tagFilters'] = $data['tagFilters'] ?? null; + $this->container['sumOrFiltersScores'] = $data['sumOrFiltersScores'] ?? false; + $this->container['facets'] = $data['facets'] ?? null; + $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet'] ?? 100; + $this->container['facetingAfterDistinct'] = $data['facetingAfterDistinct'] ?? false; + $this->container['sortFacetValuesBy'] = $data['sortFacetValuesBy'] ?? 'count'; + $this->container['page'] = $data['page'] ?? 0; + $this->container['offset'] = $data['offset'] ?? null; + $this->container['length'] = $data['length'] ?? null; + $this->container['aroundLatLng'] = $data['aroundLatLng'] ?? ''; + $this->container['aroundLatLngViaIP'] = $data['aroundLatLngViaIP'] ?? false; + $this->container['aroundRadius'] = $data['aroundRadius'] ?? null; + $this->container['aroundPrecision'] = $data['aroundPrecision'] ?? 10; + $this->container['minimumAroundRadius'] = $data['minimumAroundRadius'] ?? null; + $this->container['insideBoundingBox'] = $data['insideBoundingBox'] ?? null; + $this->container['insidePolygon'] = $data['insidePolygon'] ?? null; + $this->container['naturalLanguages'] = $data['naturalLanguages'] ?? null; + $this->container['ruleContexts'] = $data['ruleContexts'] ?? null; + $this->container['personalizationImpact'] = $data['personalizationImpact'] ?? 100; + $this->container['userToken'] = $data['userToken'] ?? null; + $this->container['getRankingInfo'] = $data['getRankingInfo'] ?? false; + $this->container['clickAnalytics'] = $data['clickAnalytics'] ?? false; + $this->container['analytics'] = $data['analytics'] ?? true; + $this->container['analyticsTags'] = $data['analyticsTags'] ?? null; + $this->container['percentileComputation'] = $data['percentileComputation'] ?? true; + $this->container['enableABTest'] = $data['enableABTest'] ?? true; + $this->container['enableReRanking'] = $data['enableReRanking'] ?? true; + $this->container['query'] = $data['query'] ?? ''; + $this->container['searchableAttributes'] = $data['searchableAttributes'] ?? null; + $this->container['attributesForFaceting'] = $data['attributesForFaceting'] ?? null; + $this->container['unretrievableAttributes'] = $data['unretrievableAttributes'] ?? null; + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve'] ?? null; + $this->container['restrictSearchableAttributes'] = $data['restrictSearchableAttributes'] ?? null; + $this->container['ranking'] = $data['ranking'] ?? null; + $this->container['customRanking'] = $data['customRanking'] ?? null; + $this->container['relevancyStrictness'] = $data['relevancyStrictness'] ?? 100; + $this->container['attributesToHighlight'] = $data['attributesToHighlight'] ?? null; + $this->container['attributesToSnippet'] = $data['attributesToSnippet'] ?? null; + $this->container['highlightPreTag'] = $data['highlightPreTag'] ?? ''; + $this->container['highlightPostTag'] = $data['highlightPostTag'] ?? ''; + $this->container['snippetEllipsisText'] = $data['snippetEllipsisText'] ?? '…'; + $this->container['restrictHighlightAndSnippetArrays'] = $data['restrictHighlightAndSnippetArrays'] ?? false; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['minWordSizefor1Typo'] = $data['minWordSizefor1Typo'] ?? 4; + $this->container['minWordSizefor2Typos'] = $data['minWordSizefor2Typos'] ?? 8; + $this->container['typoTolerance'] = $data['typoTolerance'] ?? 'true'; + $this->container['allowTyposOnNumericTokens'] = $data['allowTyposOnNumericTokens'] ?? true; + $this->container['disableTypoToleranceOnAttributes'] = $data['disableTypoToleranceOnAttributes'] ?? null; + $this->container['separatorsToIndex'] = $data['separatorsToIndex'] ?? ''; + $this->container['ignorePlurals'] = $data['ignorePlurals'] ?? 'false'; + $this->container['removeStopWords'] = $data['removeStopWords'] ?? 'false'; + $this->container['keepDiacriticsOnCharacters'] = $data['keepDiacriticsOnCharacters'] ?? ''; + $this->container['queryLanguages'] = $data['queryLanguages'] ?? null; + $this->container['decompoundQuery'] = $data['decompoundQuery'] ?? true; + $this->container['enableRules'] = $data['enableRules'] ?? true; + $this->container['enablePersonalization'] = $data['enablePersonalization'] ?? false; + $this->container['queryType'] = $data['queryType'] ?? 'prefixLast'; + $this->container['removeWordsIfNoResults'] = $data['removeWordsIfNoResults'] ?? 'none'; + $this->container['advancedSyntax'] = $data['advancedSyntax'] ?? false; + $this->container['optionalWords'] = $data['optionalWords'] ?? null; + $this->container['disableExactOnAttributes'] = $data['disableExactOnAttributes'] ?? null; + $this->container['exactOnSingleWordQuery'] = $data['exactOnSingleWordQuery'] ?? 'attribute'; + $this->container['alternativesAsExact'] = $data['alternativesAsExact'] ?? null; + $this->container['advancedSyntaxFeatures'] = $data['advancedSyntaxFeatures'] ?? null; + $this->container['distinct'] = $data['distinct'] ?? 0; + $this->container['synonyms'] = $data['synonyms'] ?? true; + $this->container['replaceSynonymsInHighlight'] = $data['replaceSynonymsInHighlight'] ?? false; + $this->container['minProximity'] = $data['minProximity'] ?? 1; + $this->container['responseFields'] = $data['responseFields'] ?? null; + $this->container['maxFacetHits'] = $data['maxFacetHits'] ?? 10; + $this->container['attributeCriteriaComputedByMinProximity'] = $data['attributeCriteriaComputedByMinProximity'] ?? false; + $this->container['renderingContent'] = $data['renderingContent'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['length']) && ($this->container['length'] > 1000)) { + $invalidProperties[] = "invalid value for 'length', must be smaller than or equal to 1000."; + } + + if (!is_null($this->container['length']) && ($this->container['length'] < 1)) { + $invalidProperties[] = "invalid value for 'length', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['minimumAroundRadius']) && ($this->container['minimumAroundRadius'] < 1)) { + $invalidProperties[] = "invalid value for 'minimumAroundRadius', must be bigger than or equal to 1."; + } + + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($this->container['typoTolerance']) && !in_array($this->container['typoTolerance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'typoTolerance', must be one of '%s'", + $this->container['typoTolerance'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'queryType', must be one of '%s'", + $this->container['queryType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($this->container['removeWordsIfNoResults']) && !in_array($this->container['removeWordsIfNoResults'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $this->container['removeWordsIfNoResults'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($this->container['exactOnSingleWordQuery']) && !in_array($this->container['exactOnSingleWordQuery'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $this->container['exactOnSingleWordQuery'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['distinct']) && ($this->container['distinct'] > 4)) { + $invalidProperties[] = "invalid value for 'distinct', must be smaller than or equal to 4."; + } + + if (!is_null($this->container['distinct']) && ($this->container['distinct'] < 0)) { + $invalidProperties[] = "invalid value for 'distinct', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['minProximity']) && ($this->container['minProximity'] > 7)) { + $invalidProperties[] = "invalid value for 'minProximity', must be smaller than or equal to 7."; + } + + if (!is_null($this->container['minProximity']) && ($this->container['minProximity'] < 1)) { + $invalidProperties[] = "invalid value for 'minProximity', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + 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 similarQuery + * + * @return string|null + */ + public function getSimilarQuery() + { + return $this->container['similarQuery']; + } + + /** + * Sets similarQuery + * + * @param string|null $similarQuery Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. + * + * @return self + */ + public function setSimilarQuery($similarQuery) + { + $this->container['similarQuery'] = $similarQuery; + + return $this; + } + + /** + * Gets filters + * + * @return string|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param string|null $filters Filter the query with numeric, facet and/or tag filters. + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets facetFilters + * + * @return string[]|null + */ + public function getFacetFilters() + { + return $this->container['facetFilters']; + } + + /** + * Sets facetFilters + * + * @param string[]|null $facetFilters Filter hits by facet value. + * + * @return self + */ + public function setFacetFilters($facetFilters) + { + $this->container['facetFilters'] = $facetFilters; + + return $this; + } + + /** + * Gets optionalFilters + * + * @return string[]|null + */ + public function getOptionalFilters() + { + return $this->container['optionalFilters']; + } + + /** + * Sets optionalFilters + * + * @param string[]|null $optionalFilters Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. + * + * @return self + */ + public function setOptionalFilters($optionalFilters) + { + $this->container['optionalFilters'] = $optionalFilters; + + return $this; + } + + /** + * Gets numericFilters + * + * @return string[]|null + */ + public function getNumericFilters() + { + return $this->container['numericFilters']; + } + + /** + * Sets numericFilters + * + * @param string[]|null $numericFilters Filter on numeric attributes. + * + * @return self + */ + public function setNumericFilters($numericFilters) + { + $this->container['numericFilters'] = $numericFilters; + + return $this; + } + + /** + * Gets tagFilters + * + * @return string[]|null + */ + public function getTagFilters() + { + return $this->container['tagFilters']; + } + + /** + * Sets tagFilters + * + * @param string[]|null $tagFilters Filter hits by tags. + * + * @return self + */ + public function setTagFilters($tagFilters) + { + $this->container['tagFilters'] = $tagFilters; + + return $this; + } + + /** + * Gets sumOrFiltersScores + * + * @return bool|null + */ + public function getSumOrFiltersScores() + { + return $this->container['sumOrFiltersScores']; + } + + /** + * Sets sumOrFiltersScores + * + * @param bool|null $sumOrFiltersScores Determines how to calculate the total score for filtering. + * + * @return self + */ + public function setSumOrFiltersScores($sumOrFiltersScores) + { + $this->container['sumOrFiltersScores'] = $sumOrFiltersScores; + + return $this; + } + + /** + * Gets facets + * + * @return string[]|null + */ + public function getFacets() + { + return $this->container['facets']; + } + + /** + * Sets facets + * + * @param string[]|null $facets Retrieve facets and their facet values. + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets maxValuesPerFacet + * + * @return int|null + */ + public function getMaxValuesPerFacet() + { + return $this->container['maxValuesPerFacet']; + } + + /** + * Sets maxValuesPerFacet + * + * @param int|null $maxValuesPerFacet Maximum number of facet values to return for each facet during a regular search. + * + * @return self + */ + public function setMaxValuesPerFacet($maxValuesPerFacet) + { + $this->container['maxValuesPerFacet'] = $maxValuesPerFacet; + + return $this; + } + + /** + * Gets facetingAfterDistinct + * + * @return bool|null + */ + public function getFacetingAfterDistinct() + { + return $this->container['facetingAfterDistinct']; + } + + /** + * Sets facetingAfterDistinct + * + * @param bool|null $facetingAfterDistinct Force faceting to be applied after de-duplication (via the Distinct setting). + * + * @return self + */ + public function setFacetingAfterDistinct($facetingAfterDistinct) + { + $this->container['facetingAfterDistinct'] = $facetingAfterDistinct; + + return $this; + } + + /** + * Gets sortFacetValuesBy + * + * @return string|null + */ + public function getSortFacetValuesBy() + { + return $this->container['sortFacetValuesBy']; + } + + /** + * Sets sortFacetValuesBy + * + * @param string|null $sortFacetValuesBy Controls how facet values are fetched. + * + * @return self + */ + public function setSortFacetValuesBy($sortFacetValuesBy) + { + $this->container['sortFacetValuesBy'] = $sortFacetValuesBy; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page Specify the page to retrieve. + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets offset + * + * @return int|null + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * + * @param int|null $offset Specify the offset of the first hit to return. + * + * @return self + */ + public function setOffset($offset) + { + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets length + * + * @return int|null + */ + public function getLength() + { + return $this->container['length']; + } + + /** + * Sets length + * + * @param int|null $length Set the number of hits to retrieve (used only with offset). + * + * @return self + */ + public function setLength($length) + { + + if (!is_null($length) && ($length > 1000)) { + throw new \InvalidArgumentException('invalid value for $length when calling SearchParamsObject., must be smaller than or equal to 1000.'); + } + if (!is_null($length) && ($length < 1)) { + throw new \InvalidArgumentException('invalid value for $length when calling SearchParamsObject., must be bigger than or equal to 1.'); + } + + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng']; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng Search for entries around a central geolocation, enabling a geo search within a circular area. + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets aroundLatLngViaIP + * + * @return bool|null + */ + public function getAroundLatLngViaIP() + { + return $this->container['aroundLatLngViaIP']; + } + + /** + * Sets aroundLatLngViaIP + * + * @param bool|null $aroundLatLngViaIP Search for entries around a given location automatically computed from the requester's IP address. + * + * @return self + */ + public function setAroundLatLngViaIP($aroundLatLngViaIP) + { + $this->container['aroundLatLngViaIP'] = $aroundLatLngViaIP; + + return $this; + } + + /** + * Gets aroundRadius + * + * @return OneOfIntegerString|null + */ + public function getAroundRadius() + { + return $this->container['aroundRadius']; + } + + /** + * Sets aroundRadius + * + * @param OneOfIntegerString|null $aroundRadius Define the maximum radius for a geo search (in meters). + * + * @return self + */ + public function setAroundRadius($aroundRadius) + { + $this->container['aroundRadius'] = $aroundRadius; + + return $this; + } + + /** + * Gets aroundPrecision + * + * @return int|null + */ + public function getAroundPrecision() + { + return $this->container['aroundPrecision']; + } + + /** + * Sets aroundPrecision + * + * @param int|null $aroundPrecision Precision of geo search (in meters), to add grouping by geo location to the ranking formula. + * + * @return self + */ + public function setAroundPrecision($aroundPrecision) + { + $this->container['aroundPrecision'] = $aroundPrecision; + + return $this; + } + + /** + * Gets minimumAroundRadius + * + * @return int|null + */ + public function getMinimumAroundRadius() + { + return $this->container['minimumAroundRadius']; + } + + /** + * Sets minimumAroundRadius + * + * @param int|null $minimumAroundRadius Minimum radius (in meters) used for a geo search when aroundRadius is not set. + * + * @return self + */ + public function setMinimumAroundRadius($minimumAroundRadius) + { + + if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { + throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling SearchParamsObject., must be bigger than or equal to 1.'); + } + + $this->container['minimumAroundRadius'] = $minimumAroundRadius; + + return $this; + } + + /** + * Gets insideBoundingBox + * + * @return float[]|null + */ + public function getInsideBoundingBox() + { + return $this->container['insideBoundingBox']; + } + + /** + * Sets insideBoundingBox + * + * @param float[]|null $insideBoundingBox Search inside a rectangular area (in geo coordinates). + * + * @return self + */ + public function setInsideBoundingBox($insideBoundingBox) + { + $this->container['insideBoundingBox'] = $insideBoundingBox; + + return $this; + } + + /** + * Gets insidePolygon + * + * @return float[]|null + */ + public function getInsidePolygon() + { + return $this->container['insidePolygon']; + } + + /** + * Sets insidePolygon + * + * @param float[]|null $insidePolygon Search inside a polygon (in geo coordinates). + * + * @return self + */ + public function setInsidePolygon($insidePolygon) + { + $this->container['insidePolygon'] = $insidePolygon; + + return $this; + } + + /** + * Gets naturalLanguages + * + * @return string[]|null + */ + public function getNaturalLanguages() + { + return $this->container['naturalLanguages']; + } + + /** + * Sets naturalLanguages + * + * @param string[]|null $naturalLanguages This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. + * + * @return self + */ + public function setNaturalLanguages($naturalLanguages) + { + $this->container['naturalLanguages'] = $naturalLanguages; + + return $this; + } + + /** + * Gets ruleContexts + * + * @return string[]|null + */ + public function getRuleContexts() + { + return $this->container['ruleContexts']; + } + + /** + * Sets ruleContexts + * + * @param string[]|null $ruleContexts Enables contextual rules. + * + * @return self + */ + public function setRuleContexts($ruleContexts) + { + $this->container['ruleContexts'] = $ruleContexts; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int|null + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact']; + } + + /** + * Sets personalizationImpact + * + * @param int|null $personalizationImpact Define the impact of the Personalization feature. + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + return $this; + } + + /** + * Gets userToken + * + * @return string|null + */ + public function getUserToken() + { + return $this->container['userToken']; + } + + /** + * Sets userToken + * + * @param string|null $userToken Associates a certain user token with the current search. + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets getRankingInfo + * + * @return bool|null + */ + public function getGetRankingInfo() + { + return $this->container['getRankingInfo']; + } + + /** + * Sets getRankingInfo + * + * @param bool|null $getRankingInfo Retrieve detailed ranking information. + * + * @return self + */ + public function setGetRankingInfo($getRankingInfo) + { + $this->container['getRankingInfo'] = $getRankingInfo; + + return $this; + } + + /** + * Gets clickAnalytics + * + * @return bool|null + */ + public function getClickAnalytics() + { + return $this->container['clickAnalytics']; + } + + /** + * Sets clickAnalytics + * + * @param bool|null $clickAnalytics Enable the Click Analytics feature. + * + * @return self + */ + public function setClickAnalytics($clickAnalytics) + { + $this->container['clickAnalytics'] = $clickAnalytics; + + return $this; + } + + /** + * Gets analytics + * + * @return bool|null + */ + public function getAnalytics() + { + return $this->container['analytics']; + } + + /** + * Sets analytics + * + * @param bool|null $analytics Whether the current query will be taken into account in the Analytics. + * + * @return self + */ + public function setAnalytics($analytics) + { + $this->container['analytics'] = $analytics; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[]|null + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags']; + } + + /** + * Sets analyticsTags + * + * @param string[]|null $analyticsTags List of tags to apply to the query for analytics purposes. + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets percentileComputation + * + * @return bool|null + */ + public function getPercentileComputation() + { + return $this->container['percentileComputation']; + } + + /** + * Sets percentileComputation + * + * @param bool|null $percentileComputation Whether to include or exclude a query from the processing-time percentile computation. + * + * @return self + */ + public function setPercentileComputation($percentileComputation) + { + $this->container['percentileComputation'] = $percentileComputation; + + return $this; + } + + /** + * Gets enableABTest + * + * @return bool|null + */ + public function getEnableABTest() + { + return $this->container['enableABTest']; + } + + /** + * Sets enableABTest + * + * @param bool|null $enableABTest Whether this search should participate in running AB tests. + * + * @return self + */ + public function setEnableABTest($enableABTest) + { + $this->container['enableABTest'] = $enableABTest; + + return $this; + } + + /** + * Gets enableReRanking + * + * @return bool|null + */ + public function getEnableReRanking() + { + return $this->container['enableReRanking']; + } + + /** + * Sets enableReRanking + * + * @param bool|null $enableReRanking Whether this search should use AI Re-Ranking. + * + * @return self + */ + public function setEnableReRanking($enableReRanking) + { + $this->container['enableReRanking'] = $enableReRanking; + + return $this; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query The text to search in the index. + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets searchableAttributes + * + * @return string[]|null + */ + public function getSearchableAttributes() + { + return $this->container['searchableAttributes']; + } + + /** + * Sets searchableAttributes + * + * @param string[]|null $searchableAttributes The complete list of attributes used for searching. + * + * @return self + */ + public function setSearchableAttributes($searchableAttributes) + { + $this->container['searchableAttributes'] = $searchableAttributes; + + return $this; + } + + /** + * Gets attributesForFaceting + * + * @return string[]|null + */ + public function getAttributesForFaceting() + { + return $this->container['attributesForFaceting']; + } + + /** + * Sets attributesForFaceting + * + * @param string[]|null $attributesForFaceting The complete list of attributes that will be used for faceting. + * + * @return self + */ + public function setAttributesForFaceting($attributesForFaceting) + { + $this->container['attributesForFaceting'] = $attributesForFaceting; + + return $this; + } + + /** + * Gets unretrievableAttributes + * + * @return string[]|null + */ + public function getUnretrievableAttributes() + { + return $this->container['unretrievableAttributes']; + } + + /** + * Sets unretrievableAttributes + * + * @param string[]|null $unretrievableAttributes List of attributes that can't be retrieved at query time. + * + * @return self + */ + public function setUnretrievableAttributes($unretrievableAttributes) + { + $this->container['unretrievableAttributes'] = $unretrievableAttributes; + + return $this; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve']; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve This parameter controls which attributes to retrieve and which not to retrieve. + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets restrictSearchableAttributes + * + * @return string[]|null + */ + public function getRestrictSearchableAttributes() + { + return $this->container['restrictSearchableAttributes']; + } + + /** + * Sets restrictSearchableAttributes + * + * @param string[]|null $restrictSearchableAttributes Restricts a given query to look in only a subset of your searchable attributes. + * + * @return self + */ + public function setRestrictSearchableAttributes($restrictSearchableAttributes) + { + $this->container['restrictSearchableAttributes'] = $restrictSearchableAttributes; + + return $this; + } + + /** + * Gets ranking + * + * @return string[]|null + */ + public function getRanking() + { + return $this->container['ranking']; + } + + /** + * Sets ranking + * + * @param string[]|null $ranking Controls how Algolia should sort your results. + * + * @return self + */ + public function setRanking($ranking) + { + $this->container['ranking'] = $ranking; + + return $this; + } + + /** + * Gets customRanking + * + * @return string[]|null + */ + public function getCustomRanking() + { + return $this->container['customRanking']; + } + + /** + * Sets customRanking + * + * @param string[]|null $customRanking Specifies the custom ranking criterion. + * + * @return self + */ + public function setCustomRanking($customRanking) + { + $this->container['customRanking'] = $customRanking; + + return $this; + } + + /** + * Gets relevancyStrictness + * + * @return int|null + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness']; + } + + /** + * Sets relevancyStrictness + * + * @param int|null $relevancyStrictness Controls the relevancy threshold below which less relevant results aren't included in the results. + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets attributesToHighlight + * + * @return string[]|null + */ + public function getAttributesToHighlight() + { + return $this->container['attributesToHighlight']; + } + + /** + * Sets attributesToHighlight + * + * @param string[]|null $attributesToHighlight List of attributes to highlight. + * + * @return self + */ + public function setAttributesToHighlight($attributesToHighlight) + { + $this->container['attributesToHighlight'] = $attributesToHighlight; + + return $this; + } + + /** + * Gets attributesToSnippet + * + * @return string[]|null + */ + public function getAttributesToSnippet() + { + return $this->container['attributesToSnippet']; + } + + /** + * Sets attributesToSnippet + * + * @param string[]|null $attributesToSnippet List of attributes to snippet, with an optional maximum number of words to snippet. + * + * @return self + */ + public function setAttributesToSnippet($attributesToSnippet) + { + $this->container['attributesToSnippet'] = $attributesToSnippet; + + return $this; + } + + /** + * Gets highlightPreTag + * + * @return string|null + */ + public function getHighlightPreTag() + { + return $this->container['highlightPreTag']; + } + + /** + * Sets highlightPreTag + * + * @param string|null $highlightPreTag The HTML string to insert before the highlighted parts in all highlight and snippet results. + * + * @return self + */ + public function setHighlightPreTag($highlightPreTag) + { + $this->container['highlightPreTag'] = $highlightPreTag; + + return $this; + } + + /** + * Gets highlightPostTag + * + * @return string|null + */ + public function getHighlightPostTag() + { + return $this->container['highlightPostTag']; + } + + /** + * Sets highlightPostTag + * + * @param string|null $highlightPostTag The HTML string to insert after the highlighted parts in all highlight and snippet results. + * + * @return self + */ + public function setHighlightPostTag($highlightPostTag) + { + $this->container['highlightPostTag'] = $highlightPostTag; + + return $this; + } + + /** + * Gets snippetEllipsisText + * + * @return string|null + */ + public function getSnippetEllipsisText() + { + return $this->container['snippetEllipsisText']; + } + + /** + * Sets snippetEllipsisText + * + * @param string|null $snippetEllipsisText String used as an ellipsis indicator when a snippet is truncated. + * + * @return self + */ + public function setSnippetEllipsisText($snippetEllipsisText) + { + $this->container['snippetEllipsisText'] = $snippetEllipsisText; + + return $this; + } + + /** + * Gets restrictHighlightAndSnippetArrays + * + * @return bool|null + */ + public function getRestrictHighlightAndSnippetArrays() + { + return $this->container['restrictHighlightAndSnippetArrays']; + } + + /** + * Sets restrictHighlightAndSnippetArrays + * + * @param bool|null $restrictHighlightAndSnippetArrays Restrict highlighting and snippeting to items that matched the query. + * + * @return self + */ + public function setRestrictHighlightAndSnippetArrays($restrictHighlightAndSnippetArrays) + { + $this->container['restrictHighlightAndSnippetArrays'] = $restrictHighlightAndSnippetArrays; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage Set the number of hits per page. + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets minWordSizefor1Typo + * + * @return int|null + */ + public function getMinWordSizefor1Typo() + { + return $this->container['minWordSizefor1Typo']; + } + + /** + * Sets minWordSizefor1Typo + * + * @param int|null $minWordSizefor1Typo Minimum number of characters a word in the query string must contain to accept matches with 1 typo. + * + * @return self + */ + public function setMinWordSizefor1Typo($minWordSizefor1Typo) + { + $this->container['minWordSizefor1Typo'] = $minWordSizefor1Typo; + + return $this; + } + + /** + * Gets minWordSizefor2Typos + * + * @return int|null + */ + public function getMinWordSizefor2Typos() + { + return $this->container['minWordSizefor2Typos']; + } + + /** + * Sets minWordSizefor2Typos + * + * @param int|null $minWordSizefor2Typos Minimum number of characters a word in the query string must contain to accept matches with 2 typos. + * + * @return self + */ + public function setMinWordSizefor2Typos($minWordSizefor2Typos) + { + $this->container['minWordSizefor2Typos'] = $minWordSizefor2Typos; + + return $this; + } + + /** + * Gets typoTolerance + * + * @return string|null + */ + public function getTypoTolerance() + { + return $this->container['typoTolerance']; + } + + /** + * Sets typoTolerance + * + * @param string|null $typoTolerance Controls whether typo tolerance is enabled and how it is applied. + * + * @return self + */ + public function setTypoTolerance($typoTolerance) + { + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($typoTolerance) && !in_array($typoTolerance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'typoTolerance', must be one of '%s'", + $typoTolerance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['typoTolerance'] = $typoTolerance; + + return $this; + } + + /** + * Gets allowTyposOnNumericTokens + * + * @return bool|null + */ + public function getAllowTyposOnNumericTokens() + { + return $this->container['allowTyposOnNumericTokens']; + } + + /** + * Sets allowTyposOnNumericTokens + * + * @param bool|null $allowTyposOnNumericTokens Whether to allow typos on numbers (\"numeric tokens\") in the query string. + * + * @return self + */ + public function setAllowTyposOnNumericTokens($allowTyposOnNumericTokens) + { + $this->container['allowTyposOnNumericTokens'] = $allowTyposOnNumericTokens; + + return $this; + } + + /** + * Gets disableTypoToleranceOnAttributes + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnAttributes() + { + return $this->container['disableTypoToleranceOnAttributes']; + } + + /** + * Sets disableTypoToleranceOnAttributes + * + * @param string[]|null $disableTypoToleranceOnAttributes List of attributes on which you want to disable typo tolerance. + * + * @return self + */ + public function setDisableTypoToleranceOnAttributes($disableTypoToleranceOnAttributes) + { + $this->container['disableTypoToleranceOnAttributes'] = $disableTypoToleranceOnAttributes; + + return $this; + } + + /** + * Gets separatorsToIndex + * + * @return string|null + */ + public function getSeparatorsToIndex() + { + return $this->container['separatorsToIndex']; + } + + /** + * Sets separatorsToIndex + * + * @param string|null $separatorsToIndex Control which separators are indexed. + * + * @return self + */ + public function setSeparatorsToIndex($separatorsToIndex) + { + $this->container['separatorsToIndex'] = $separatorsToIndex; + + return $this; + } + + /** + * Gets ignorePlurals + * + * @return string|null + */ + public function getIgnorePlurals() + { + return $this->container['ignorePlurals']; + } + + /** + * Sets ignorePlurals + * + * @param string|null $ignorePlurals Treats singular, plurals, and other forms of declensions as matching terms. + * + * @return self + */ + public function setIgnorePlurals($ignorePlurals) + { + $this->container['ignorePlurals'] = $ignorePlurals; + + return $this; + } + + /** + * Gets removeStopWords + * + * @return string|null + */ + public function getRemoveStopWords() + { + return $this->container['removeStopWords']; + } + + /** + * Sets removeStopWords + * + * @param string|null $removeStopWords Removes stop (common) words from the query before executing it. + * + * @return self + */ + public function setRemoveStopWords($removeStopWords) + { + $this->container['removeStopWords'] = $removeStopWords; + + return $this; + } + + /** + * Gets keepDiacriticsOnCharacters + * + * @return string|null + */ + public function getKeepDiacriticsOnCharacters() + { + return $this->container['keepDiacriticsOnCharacters']; + } + + /** + * Sets keepDiacriticsOnCharacters + * + * @param string|null $keepDiacriticsOnCharacters List of characters that the engine shouldn't automatically normalize. + * + * @return self + */ + public function setKeepDiacriticsOnCharacters($keepDiacriticsOnCharacters) + { + $this->container['keepDiacriticsOnCharacters'] = $keepDiacriticsOnCharacters; + + return $this; + } + + /** + * Gets queryLanguages + * + * @return string[]|null + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages']; + } + + /** + * Sets queryLanguages + * + * @param string[]|null $queryLanguages Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets decompoundQuery + * + * @return bool|null + */ + public function getDecompoundQuery() + { + return $this->container['decompoundQuery']; + } + + /** + * Sets decompoundQuery + * + * @param bool|null $decompoundQuery Splits compound words into their composing atoms in the query. + * + * @return self + */ + public function setDecompoundQuery($decompoundQuery) + { + $this->container['decompoundQuery'] = $decompoundQuery; + + return $this; + } + + /** + * Gets enableRules + * + * @return bool|null + */ + public function getEnableRules() + { + return $this->container['enableRules']; + } + + /** + * Sets enableRules + * + * @param bool|null $enableRules Whether Rules should be globally enabled. + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets enablePersonalization + * + * @return bool|null + */ + public function getEnablePersonalization() + { + return $this->container['enablePersonalization']; + } + + /** + * Sets enablePersonalization + * + * @param bool|null $enablePersonalization Enable the Personalization feature. + * + * @return self + */ + public function setEnablePersonalization($enablePersonalization) + { + $this->container['enablePersonalization'] = $enablePersonalization; + + return $this; + } + + /** + * Gets queryType + * + * @return string|null + */ + public function getQueryType() + { + return $this->container['queryType']; + } + + /** + * Sets queryType + * + * @param string|null $queryType Controls if and how query words are interpreted as prefixes. + * + * @return self + */ + public function setQueryType($queryType) + { + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($queryType) && !in_array($queryType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'queryType', must be one of '%s'", + $queryType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['queryType'] = $queryType; + + return $this; + } + + /** + * Gets removeWordsIfNoResults + * + * @return string|null + */ + public function getRemoveWordsIfNoResults() + { + return $this->container['removeWordsIfNoResults']; + } + + /** + * Sets removeWordsIfNoResults + * + * @param string|null $removeWordsIfNoResults Selects a strategy to remove words from the query when it doesn't match any hits. + * + * @return self + */ + public function setRemoveWordsIfNoResults($removeWordsIfNoResults) + { + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($removeWordsIfNoResults) && !in_array($removeWordsIfNoResults, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $removeWordsIfNoResults, + implode("', '", $allowedValues) + ) + ); + } + $this->container['removeWordsIfNoResults'] = $removeWordsIfNoResults; + + return $this; + } + + /** + * Gets advancedSyntax + * + * @return bool|null + */ + public function getAdvancedSyntax() + { + return $this->container['advancedSyntax']; + } + + /** + * Sets advancedSyntax + * + * @param bool|null $advancedSyntax Enables the advanced query syntax. + * + * @return self + */ + public function setAdvancedSyntax($advancedSyntax) + { + $this->container['advancedSyntax'] = $advancedSyntax; + + return $this; + } + + /** + * Gets optionalWords + * + * @return string[]|null + */ + public function getOptionalWords() + { + return $this->container['optionalWords']; + } + + /** + * Sets optionalWords + * + * @param string[]|null $optionalWords A list of words that should be considered as optional when found in the query. + * + * @return self + */ + public function setOptionalWords($optionalWords) + { + $this->container['optionalWords'] = $optionalWords; + + return $this; + } + + /** + * Gets disableExactOnAttributes + * + * @return string[]|null + */ + public function getDisableExactOnAttributes() + { + return $this->container['disableExactOnAttributes']; + } + + /** + * Sets disableExactOnAttributes + * + * @param string[]|null $disableExactOnAttributes List of attributes on which you want to disable the exact ranking criterion. + * + * @return self + */ + public function setDisableExactOnAttributes($disableExactOnAttributes) + { + $this->container['disableExactOnAttributes'] = $disableExactOnAttributes; + + return $this; + } + + /** + * Gets exactOnSingleWordQuery + * + * @return string|null + */ + public function getExactOnSingleWordQuery() + { + return $this->container['exactOnSingleWordQuery']; + } + + /** + * Sets exactOnSingleWordQuery + * + * @param string|null $exactOnSingleWordQuery Controls how the exact ranking criterion is computed when the query contains only one word. + * + * @return self + */ + public function setExactOnSingleWordQuery($exactOnSingleWordQuery) + { + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($exactOnSingleWordQuery) && !in_array($exactOnSingleWordQuery, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $exactOnSingleWordQuery, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exactOnSingleWordQuery'] = $exactOnSingleWordQuery; + + return $this; + } + + /** + * Gets alternativesAsExact + * + * @return string[]|null + */ + public function getAlternativesAsExact() + { + return $this->container['alternativesAsExact']; + } + + /** + * Sets alternativesAsExact + * + * @param string[]|null $alternativesAsExact List of alternatives that should be considered an exact match by the exact ranking criterion. + * + * @return self + */ + public function setAlternativesAsExact($alternativesAsExact) + { + $allowedValues = $this->getAlternativesAsExactAllowableValues(); + if (!is_null($alternativesAsExact) && array_diff($alternativesAsExact, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'alternativesAsExact', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['alternativesAsExact'] = $alternativesAsExact; + + return $this; + } + + /** + * Gets advancedSyntaxFeatures + * + * @return string[]|null + */ + public function getAdvancedSyntaxFeatures() + { + return $this->container['advancedSyntaxFeatures']; + } + + /** + * Sets advancedSyntaxFeatures + * + * @param string[]|null $advancedSyntaxFeatures Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. + * + * @return self + */ + public function setAdvancedSyntaxFeatures($advancedSyntaxFeatures) + { + $allowedValues = $this->getAdvancedSyntaxFeaturesAllowableValues(); + if (!is_null($advancedSyntaxFeatures) && array_diff($advancedSyntaxFeatures, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'advancedSyntaxFeatures', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['advancedSyntaxFeatures'] = $advancedSyntaxFeatures; + + return $this; + } + + /** + * Gets distinct + * + * @return int|null + */ + public function getDistinct() + { + return $this->container['distinct']; + } + + /** + * Sets distinct + * + * @param int|null $distinct Enables de-duplication or grouping of results. + * + * @return self + */ + public function setDistinct($distinct) + { + + if (!is_null($distinct) && ($distinct > 4)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling SearchParamsObject., must be smaller than or equal to 4.'); + } + if (!is_null($distinct) && ($distinct < 0)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling SearchParamsObject., must be bigger than or equal to 0.'); + } + + $this->container['distinct'] = $distinct; + + return $this; + } + + /** + * Gets synonyms + * + * @return bool|null + */ + public function getSynonyms() + { + return $this->container['synonyms']; + } + + /** + * Sets synonyms + * + * @param bool|null $synonyms Whether to take into account an index's synonyms for a particular search. + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets replaceSynonymsInHighlight + * + * @return bool|null + */ + public function getReplaceSynonymsInHighlight() + { + return $this->container['replaceSynonymsInHighlight']; + } + + /** + * Sets replaceSynonymsInHighlight + * + * @param bool|null $replaceSynonymsInHighlight Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + * + * @return self + */ + public function setReplaceSynonymsInHighlight($replaceSynonymsInHighlight) + { + $this->container['replaceSynonymsInHighlight'] = $replaceSynonymsInHighlight; + + return $this; + } + + /** + * Gets minProximity + * + * @return int|null + */ + public function getMinProximity() + { + return $this->container['minProximity']; + } + + /** + * Sets minProximity + * + * @param int|null $minProximity Precision of the proximity ranking criterion. + * + * @return self + */ + public function setMinProximity($minProximity) + { + + if (!is_null($minProximity) && ($minProximity > 7)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling SearchParamsObject., must be smaller than or equal to 7.'); + } + if (!is_null($minProximity) && ($minProximity < 1)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling SearchParamsObject., must be bigger than or equal to 1.'); + } + + $this->container['minProximity'] = $minProximity; + + return $this; + } + + /** + * Gets responseFields + * + * @return string[]|null + */ + public function getResponseFields() + { + return $this->container['responseFields']; + } + + /** + * Sets responseFields + * + * @param string[]|null $responseFields Choose which fields to return in the API response. This parameters applies to search and browse queries. + * + * @return self + */ + public function setResponseFields($responseFields) + { + $this->container['responseFields'] = $responseFields; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits']; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling SearchParamsObject., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets attributeCriteriaComputedByMinProximity + * + * @return bool|null + */ + public function getAttributeCriteriaComputedByMinProximity() + { + return $this->container['attributeCriteriaComputedByMinProximity']; + } + + /** + * Sets attributeCriteriaComputedByMinProximity + * + * @param bool|null $attributeCriteriaComputedByMinProximity When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. + * + * @return self + */ + public function setAttributeCriteriaComputedByMinProximity($attributeCriteriaComputedByMinProximity) + { + $this->container['attributeCriteriaComputedByMinProximity'] = $attributeCriteriaComputedByMinProximity; + + return $this; + } + + /** + * Gets renderingContent + * + * @return object|null + */ + public function getRenderingContent() + { + return $this->container['renderingContent']; + } + + /** + * Sets renderingContent + * + * @param object|null $renderingContent Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchParamsString.php b/clients/algoliasearch-client-php/lib/Model/SearchParamsString.php new file mode 100644 index 0000000000..75f8d497f1 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchParamsString.php @@ -0,0 +1,320 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchParamsString implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchParamsString'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'params' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'params' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'params' => 'params' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'params' => 'setParams' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'params' => 'getParams' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['params'] = $data['params'] ?? ''; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 params + * + * @return string|null + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param string|null $params Search parameters as URL-encoded query string. + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchResponse.php new file mode 100644 index 0000000000..dcc62da8fa --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchResponse.php @@ -0,0 +1,1079 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'abTestID' => 'int', + 'abTestVariantID' => 'int', + 'aroundLatLng' => 'string', + 'automaticRadius' => 'string', + 'exhaustiveFacetsCount' => 'bool', + 'exhaustiveNbHits' => 'bool', + 'exhaustiveTypo' => 'bool', + 'facets' => 'array>', + 'facetsStats' => 'array', + 'hitsPerPage' => 'int', + 'index' => 'string', + 'indexUsed' => 'string', + 'message' => 'string', + 'nbHits' => 'int', + 'nbPages' => 'int', + 'nbSortedHits' => 'int', + 'page' => 'int', + 'params' => 'string', + 'parsedQuery' => 'string', + 'processingTimeMS' => 'int', + 'query' => 'string', + 'queryAfterRemoval' => 'string', + 'serverUsed' => 'string', + 'userData' => 'array', + 'hits' => '\Algolia\AlgoliaSearch\Model\Record[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'abTestID' => null, + 'abTestVariantID' => null, + 'aroundLatLng' => null, + 'automaticRadius' => null, + 'exhaustiveFacetsCount' => null, + 'exhaustiveNbHits' => null, + 'exhaustiveTypo' => null, + 'facets' => null, + 'facetsStats' => null, + 'hitsPerPage' => null, + 'index' => null, + 'indexUsed' => null, + 'message' => null, + 'nbHits' => null, + 'nbPages' => null, + 'nbSortedHits' => null, + 'page' => null, + 'params' => null, + 'parsedQuery' => null, + 'processingTimeMS' => null, + 'query' => null, + 'queryAfterRemoval' => null, + 'serverUsed' => null, + 'userData' => null, + 'hits' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'abTestID' => 'abTestID', + 'abTestVariantID' => 'abTestVariantID', + 'aroundLatLng' => 'aroundLatLng', + 'automaticRadius' => 'automaticRadius', + 'exhaustiveFacetsCount' => 'exhaustiveFacetsCount', + 'exhaustiveNbHits' => 'exhaustiveNbHits', + 'exhaustiveTypo' => 'exhaustiveTypo', + 'facets' => 'facets', + 'facetsStats' => 'facets_stats', + 'hitsPerPage' => 'hitsPerPage', + 'index' => 'index', + 'indexUsed' => 'indexUsed', + 'message' => 'message', + 'nbHits' => 'nbHits', + 'nbPages' => 'nbPages', + 'nbSortedHits' => 'nbSortedHits', + 'page' => 'page', + 'params' => 'params', + 'parsedQuery' => 'parsedQuery', + 'processingTimeMS' => 'processingTimeMS', + 'query' => 'query', + 'queryAfterRemoval' => 'queryAfterRemoval', + 'serverUsed' => 'serverUsed', + 'userData' => 'userData', + 'hits' => 'hits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abTestID' => 'setAbTestID', + 'abTestVariantID' => 'setAbTestVariantID', + 'aroundLatLng' => 'setAroundLatLng', + 'automaticRadius' => 'setAutomaticRadius', + 'exhaustiveFacetsCount' => 'setExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'setExhaustiveNbHits', + 'exhaustiveTypo' => 'setExhaustiveTypo', + 'facets' => 'setFacets', + 'facetsStats' => 'setFacetsStats', + 'hitsPerPage' => 'setHitsPerPage', + 'index' => 'setIndex', + 'indexUsed' => 'setIndexUsed', + 'message' => 'setMessage', + 'nbHits' => 'setNbHits', + 'nbPages' => 'setNbPages', + 'nbSortedHits' => 'setNbSortedHits', + 'page' => 'setPage', + 'params' => 'setParams', + 'parsedQuery' => 'setParsedQuery', + 'processingTimeMS' => 'setProcessingTimeMS', + 'query' => 'setQuery', + 'queryAfterRemoval' => 'setQueryAfterRemoval', + 'serverUsed' => 'setServerUsed', + 'userData' => 'setUserData', + 'hits' => 'setHits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abTestID' => 'getAbTestID', + 'abTestVariantID' => 'getAbTestVariantID', + 'aroundLatLng' => 'getAroundLatLng', + 'automaticRadius' => 'getAutomaticRadius', + 'exhaustiveFacetsCount' => 'getExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'getExhaustiveNbHits', + 'exhaustiveTypo' => 'getExhaustiveTypo', + 'facets' => 'getFacets', + 'facetsStats' => 'getFacetsStats', + 'hitsPerPage' => 'getHitsPerPage', + 'index' => 'getIndex', + 'indexUsed' => 'getIndexUsed', + 'message' => 'getMessage', + 'nbHits' => 'getNbHits', + 'nbPages' => 'getNbPages', + 'nbSortedHits' => 'getNbSortedHits', + 'page' => 'getPage', + 'params' => 'getParams', + 'parsedQuery' => 'getParsedQuery', + 'processingTimeMS' => 'getProcessingTimeMS', + 'query' => 'getQuery', + 'queryAfterRemoval' => 'getQueryAfterRemoval', + 'serverUsed' => 'getServerUsed', + 'userData' => 'getUserData', + 'hits' => 'getHits' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['abTestID'] = $data['abTestID'] ?? null; + $this->container['abTestVariantID'] = $data['abTestVariantID'] ?? null; + $this->container['aroundLatLng'] = $data['aroundLatLng'] ?? null; + $this->container['automaticRadius'] = $data['automaticRadius'] ?? null; + $this->container['exhaustiveFacetsCount'] = $data['exhaustiveFacetsCount'] ?? null; + $this->container['exhaustiveNbHits'] = $data['exhaustiveNbHits'] ?? null; + $this->container['exhaustiveTypo'] = $data['exhaustiveTypo'] ?? null; + $this->container['facets'] = $data['facets'] ?? null; + $this->container['facetsStats'] = $data['facetsStats'] ?? null; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['index'] = $data['index'] ?? null; + $this->container['indexUsed'] = $data['indexUsed'] ?? null; + $this->container['message'] = $data['message'] ?? null; + $this->container['nbHits'] = $data['nbHits'] ?? null; + $this->container['nbPages'] = $data['nbPages'] ?? null; + $this->container['nbSortedHits'] = $data['nbSortedHits'] ?? null; + $this->container['page'] = $data['page'] ?? 0; + $this->container['params'] = $data['params'] ?? null; + $this->container['parsedQuery'] = $data['parsedQuery'] ?? null; + $this->container['processingTimeMS'] = $data['processingTimeMS'] ?? null; + $this->container['query'] = $data['query'] ?? ''; + $this->container['queryAfterRemoval'] = $data['queryAfterRemoval'] ?? null; + $this->container['serverUsed'] = $data['serverUsed'] ?? null; + $this->container['userData'] = $data['userData'] ?? null; + $this->container['hits'] = $data['hits'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['aroundLatLng']) && !preg_match("/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/", $this->container['aroundLatLng'])) { + $invalidProperties[] = "invalid value for 'aroundLatLng', must be conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."; + } + + if ($this->container['exhaustiveNbHits'] === null) { + $invalidProperties[] = "'exhaustiveNbHits' can't be null"; + } + if ($this->container['exhaustiveTypo'] === null) { + $invalidProperties[] = "'exhaustiveTypo' can't be null"; + } + if ($this->container['hitsPerPage'] === null) { + $invalidProperties[] = "'hitsPerPage' can't be null"; + } + if ($this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if ($this->container['nbPages'] === null) { + $invalidProperties[] = "'nbPages' can't be null"; + } + if ($this->container['page'] === null) { + $invalidProperties[] = "'page' can't be null"; + } + if ($this->container['params'] === null) { + $invalidProperties[] = "'params' can't be null"; + } + if ($this->container['processingTimeMS'] === null) { + $invalidProperties[] = "'processingTimeMS' can't be null"; + } + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + if ($this->container['hits'] === null) { + $invalidProperties[] = "'hits' 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 abTestID + * + * @return int|null + */ + public function getAbTestID() + { + return $this->container['abTestID']; + } + + /** + * Sets abTestID + * + * @param int|null $abTestID If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID. + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets abTestVariantID + * + * @return int|null + */ + public function getAbTestVariantID() + { + return $this->container['abTestVariantID']; + } + + /** + * Sets abTestVariantID + * + * @param int|null $abTestVariantID If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used. + * + * @return self + */ + public function setAbTestVariantID($abTestVariantID) + { + $this->container['abTestVariantID'] = $abTestVariantID; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng']; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng The computed geo location. + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + + if (!is_null($aroundLatLng) && (!preg_match("/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/", $aroundLatLng))) { + throw new \InvalidArgumentException("invalid value for $aroundLatLng when calling SearchResponse., must conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."); + } + + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets automaticRadius + * + * @return string|null + */ + public function getAutomaticRadius() + { + return $this->container['automaticRadius']; + } + + /** + * Sets automaticRadius + * + * @param string|null $automaticRadius The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. + * + * @return self + */ + public function setAutomaticRadius($automaticRadius) + { + $this->container['automaticRadius'] = $automaticRadius; + + return $this; + } + + /** + * Gets exhaustiveFacetsCount + * + * @return bool|null + */ + public function getExhaustiveFacetsCount() + { + return $this->container['exhaustiveFacetsCount']; + } + + /** + * Sets exhaustiveFacetsCount + * + * @param bool|null $exhaustiveFacetsCount Whether the facet count is exhaustive or approximate. + * + * @return self + */ + public function setExhaustiveFacetsCount($exhaustiveFacetsCount) + { + $this->container['exhaustiveFacetsCount'] = $exhaustiveFacetsCount; + + return $this; + } + + /** + * Gets exhaustiveNbHits + * + * @return bool + */ + public function getExhaustiveNbHits() + { + return $this->container['exhaustiveNbHits']; + } + + /** + * Sets exhaustiveNbHits + * + * @param bool $exhaustiveNbHits Indicate if the nbHits count was exhaustive or approximate + * + * @return self + */ + public function setExhaustiveNbHits($exhaustiveNbHits) + { + $this->container['exhaustiveNbHits'] = $exhaustiveNbHits; + + return $this; + } + + /** + * Gets exhaustiveTypo + * + * @return bool + */ + public function getExhaustiveTypo() + { + return $this->container['exhaustiveTypo']; + } + + /** + * Sets exhaustiveTypo + * + * @param bool $exhaustiveTypo Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * + * @return self + */ + public function setExhaustiveTypo($exhaustiveTypo) + { + $this->container['exhaustiveTypo'] = $exhaustiveTypo; + + return $this; + } + + /** + * Gets facets + * + * @return array>|null + */ + public function getFacets() + { + return $this->container['facets']; + } + + /** + * Sets facets + * + * @param array>|null $facets A mapping of each facet name to the corresponding facet counts. + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets facetsStats + * + * @return array|null + */ + public function getFacetsStats() + { + return $this->container['facetsStats']; + } + + /** + * Sets facetsStats + * + * @param array|null $facetsStats Statistics for numerical facets. + * + * @return self + */ + public function setFacetsStats($facetsStats) + { + $this->container['facetsStats'] = $facetsStats; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int $hitsPerPage Set the number of hits per page. + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets index + * + * @return string|null + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param string|null $index Index name used for the query. + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets indexUsed + * + * @return string|null + */ + public function getIndexUsed() + { + return $this->container['indexUsed']; + } + + /** + * Sets indexUsed + * + * @param string|null $indexUsed Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. + * + * @return self + */ + public function setIndexUsed($indexUsed) + { + $this->container['indexUsed'] = $indexUsed; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message Used to return warnings about the query. + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits']; + } + + /** + * Sets nbHits + * + * @param int $nbHits Number of hits that the search query matched. + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets nbPages + * + * @return int + */ + public function getNbPages() + { + return $this->container['nbPages']; + } + + /** + * Sets nbPages + * + * @param int $nbPages Number of pages available for the current query + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + + /** + * Gets nbSortedHits + * + * @return int|null + */ + public function getNbSortedHits() + { + return $this->container['nbSortedHits']; + } + + /** + * Sets nbSortedHits + * + * @param int|null $nbSortedHits The number of hits selected and sorted by the relevant sort algorithm + * + * @return self + */ + public function setNbSortedHits($nbSortedHits) + { + $this->container['nbSortedHits'] = $nbSortedHits; + + return $this; + } + + /** + * Gets page + * + * @return int + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int $page Specify the page to retrieve. + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets params + * + * @return string + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param string $params A url-encoded string of all search parameters. + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets parsedQuery + * + * @return string|null + */ + public function getParsedQuery() + { + return $this->container['parsedQuery']; + } + + /** + * Sets parsedQuery + * + * @param string|null $parsedQuery The query string that will be searched, after normalization. + * + * @return self + */ + public function setParsedQuery($parsedQuery) + { + $this->container['parsedQuery'] = $parsedQuery; + + return $this; + } + + /** + * Gets processingTimeMS + * + * @return int + */ + public function getProcessingTimeMS() + { + return $this->container['processingTimeMS']; + } + + /** + * Sets processingTimeMS + * + * @param int $processingTimeMS Time the server took to process the request, in milliseconds. + * + * @return self + */ + public function setProcessingTimeMS($processingTimeMS) + { + $this->container['processingTimeMS'] = $processingTimeMS; + + return $this; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query The text to search in the index. + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets queryAfterRemoval + * + * @return string|null + */ + public function getQueryAfterRemoval() + { + return $this->container['queryAfterRemoval']; + } + + /** + * Sets queryAfterRemoval + * + * @param string|null $queryAfterRemoval A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. + * + * @return self + */ + public function setQueryAfterRemoval($queryAfterRemoval) + { + $this->container['queryAfterRemoval'] = $queryAfterRemoval; + + return $this; + } + + /** + * Gets serverUsed + * + * @return string|null + */ + public function getServerUsed() + { + return $this->container['serverUsed']; + } + + /** + * Sets serverUsed + * + * @param string|null $serverUsed Actual host name of the server that processed the request. + * + * @return self + */ + public function setServerUsed($serverUsed) + { + $this->container['serverUsed'] = $serverUsed; + + return $this; + } + + /** + * Gets userData + * + * @return array|null + */ + public function getUserData() + { + return $this->container['userData']; + } + + /** + * Sets userData + * + * @param array|null $userData Lets you store custom data in your indices. + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + + /** + * Gets hits + * + * @return \Algolia\AlgoliaSearch\Model\Record[] + */ + public function getHits() + { + return $this->container['hits']; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Record[] $hits hits + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php b/clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php new file mode 100644 index 0000000000..46ffd28a58 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php @@ -0,0 +1,501 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchRulesParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchRulesParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'query' => 'string', + 'anchoring' => '\Algolia\AlgoliaSearch\Model\Anchoring', + 'context' => 'string', + 'page' => 'int', + 'hitsPerPage' => 'int', + 'enabled' => 'bool', + 'requestOptions' => 'array[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'query' => null, + 'anchoring' => null, + 'context' => null, + 'page' => null, + 'hitsPerPage' => null, + 'enabled' => null, + 'requestOptions' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'query' => 'query', + 'anchoring' => 'anchoring', + 'context' => 'context', + 'page' => 'page', + 'hitsPerPage' => 'hitsPerPage', + 'enabled' => 'enabled', + 'requestOptions' => 'requestOptions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'anchoring' => 'setAnchoring', + 'context' => 'setContext', + 'page' => 'setPage', + 'hitsPerPage' => 'setHitsPerPage', + 'enabled' => 'setEnabled', + 'requestOptions' => 'setRequestOptions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'anchoring' => 'getAnchoring', + 'context' => 'getContext', + 'page' => 'getPage', + 'hitsPerPage' => 'getHitsPerPage', + 'enabled' => 'getEnabled', + 'requestOptions' => 'getRequestOptions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['query'] = $data['query'] ?? ''; + $this->container['anchoring'] = $data['anchoring'] ?? null; + $this->container['context'] = $data['context'] ?? null; + $this->container['page'] = $data['page'] ?? 0; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['enabled'] = $data['enabled'] ?? null; + $this->container['requestOptions'] = $data['requestOptions'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 query + * + * @return string|null + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string|null $query Full text query. + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets anchoring + * + * @return \Algolia\AlgoliaSearch\Model\Anchoring|null + */ + public function getAnchoring() + { + return $this->container['anchoring']; + } + + /** + * Sets anchoring + * + * @param \Algolia\AlgoliaSearch\Model\Anchoring|null $anchoring anchoring + * + * @return self + */ + public function setAnchoring($anchoring) + { + $this->container['anchoring'] = $anchoring; + + return $this; + } + + /** + * Gets context + * + * @return string|null + */ + public function getContext() + { + return $this->container['context']; + } + + /** + * Sets context + * + * @param string|null $context Restricts matches to contextual rules with a specific context (exact match). + * + * @return self + */ + public function setContext($context) + { + $this->container['context'] = $context; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page Requested page (zero-based). + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage Maximum number of hits in a page. Minimum is 1, maximum is 1000. + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled When specified, restricts matches to rules with a specific enabled status. When absent (default), all rules are retrieved, regardless of their enabled status. + * + * @return self + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets requestOptions + * + * @return array[]|null + */ + public function getRequestOptions() + { + return $this->container['requestOptions']; + } + + /** + * Sets requestOptions + * + * @param array[]|null $requestOptions A mapping of requestOptions to send along with the request. + * + * @return self + */ + public function setRequestOptions($requestOptions) + { + $this->container['requestOptions'] = $requestOptions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php new file mode 100644 index 0000000000..4bc7436af7 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php @@ -0,0 +1,422 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchRulesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchRulesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'hits' => '\Algolia\AlgoliaSearch\Model\Rule[]', + 'nbHits' => 'int', + 'page' => 'int', + 'nbPages' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'hits' => null, + 'nbHits' => null, + 'page' => null, + 'nbPages' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'hits' => 'hits', + 'nbHits' => 'nbHits', + 'page' => 'page', + 'nbPages' => 'nbPages' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits', + 'nbHits' => 'setNbHits', + 'page' => 'setPage', + 'nbPages' => 'setNbPages' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits', + 'nbHits' => 'getNbHits', + 'page' => 'getPage', + 'nbPages' => 'getNbPages' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['hits'] = $data['hits'] ?? null; + $this->container['nbHits'] = $data['nbHits'] ?? null; + $this->container['page'] = $data['page'] ?? null; + $this->container['nbPages'] = $data['nbPages'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['hits'] === null) { + $invalidProperties[] = "'hits' can't be null"; + } + if ($this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if ($this->container['page'] === null) { + $invalidProperties[] = "'page' can't be null"; + } + if ($this->container['nbPages'] === null) { + $invalidProperties[] = "'nbPages' 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 hits + * + * @return \Algolia\AlgoliaSearch\Model\Rule[] + */ + public function getHits() + { + return $this->container['hits']; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Rule[] $hits Fetched rules. + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits']; + } + + /** + * Sets nbHits + * + * @param int $nbHits Number of fetched rules. + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets page + * + * @return int + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int $page Current page. + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets nbPages + * + * @return int + */ + public function getNbPages() + { + return $this->container['nbPages']; + } + + /** + * Sets nbPages + * + * @param int $nbPages Number of pages. + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php new file mode 100644 index 0000000000..c0826af49e --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php @@ -0,0 +1,356 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchSynonymsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchSynonymsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'hits' => '\Algolia\AlgoliaSearch\Model\SynonymHit[]', + 'nbHits' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'hits' => null, + 'nbHits' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'hits' => 'hits', + 'nbHits' => 'nbHits' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits', + 'nbHits' => 'setNbHits' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits', + 'nbHits' => 'getNbHits' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['hits'] = $data['hits'] ?? null; + $this->container['nbHits'] = $data['nbHits'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['hits'] === null) { + $invalidProperties[] = "'hits' can't be null"; + } + if ($this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' 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 hits + * + * @return \Algolia\AlgoliaSearch\Model\SynonymHit[] + */ + public function getHits() + { + return $this->container['hits']; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\SynonymHit[] $hits Array of synonym objects. + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits']; + } + + /** + * Sets nbHits + * + * @param int $nbHits Number of hits that the search query matched. + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php new file mode 100644 index 0000000000..2996cbd0a9 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php @@ -0,0 +1,414 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchUserIdsObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchUserIdsObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'query' => 'string', + 'clusterName' => 'string', + 'page' => 'int', + 'hitsPerPage' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'query' => null, + 'clusterName' => null, + 'page' => null, + 'hitsPerPage' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'query' => 'query', + 'clusterName' => 'clusterName', + 'page' => 'page', + 'hitsPerPage' => 'hitsPerPage' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'clusterName' => 'setClusterName', + 'page' => 'setPage', + 'hitsPerPage' => 'setHitsPerPage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'clusterName' => 'getClusterName', + 'page' => 'getPage', + 'hitsPerPage' => 'getHitsPerPage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['query'] = $data['query'] ?? null; + $this->container['clusterName'] = $data['clusterName'] ?? null; + $this->container['page'] = $data['page'] ?? 0; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' 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 query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query Query to search. The search is a prefix search with typoTolerance. Use empty query to retrieve all users. + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets clusterName + * + * @return string|null + */ + public function getClusterName() + { + return $this->container['clusterName']; + } + + /** + * Sets clusterName + * + * @param string|null $clusterName Name of the cluster. + * + * @return self + */ + public function setClusterName($clusterName) + { + $this->container['clusterName'] = $clusterName; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page Specify the page to retrieve. + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage Set the number of hits per page. + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php new file mode 100644 index 0000000000..7a3c0f192a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php @@ -0,0 +1,456 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchUserIdsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchUserIdsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'hits' => '\Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHits[]', + 'nbHits' => 'int', + 'page' => 'int', + 'hitsPerPage' => 'int', + 'updatedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'hits' => null, + 'nbHits' => null, + 'page' => null, + 'hitsPerPage' => null, + 'updatedAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'hits' => 'hits', + 'nbHits' => 'nbHits', + 'page' => 'page', + 'hitsPerPage' => 'hitsPerPage', + 'updatedAt' => 'updatedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits', + 'nbHits' => 'setNbHits', + 'page' => 'setPage', + 'hitsPerPage' => 'setHitsPerPage', + 'updatedAt' => 'setUpdatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits', + 'nbHits' => 'getNbHits', + 'page' => 'getPage', + 'hitsPerPage' => 'getHitsPerPage', + 'updatedAt' => 'getUpdatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['hits'] = $data['hits'] ?? null; + $this->container['nbHits'] = $data['nbHits'] ?? null; + $this->container['page'] = $data['page'] ?? 0; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['updatedAt'] = $data['updatedAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['hits'] === null) { + $invalidProperties[] = "'hits' can't be null"; + } + if ($this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if ($this->container['page'] === null) { + $invalidProperties[] = "'page' can't be null"; + } + if ($this->container['hitsPerPage'] === null) { + $invalidProperties[] = "'hitsPerPage' can't be null"; + } + if ($this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' 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 hits + * + * @return \Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHits[] + */ + public function getHits() + { + return $this->container['hits']; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHits[] $hits List of user object matching the query. + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits']; + } + + /** + * Sets nbHits + * + * @param int $nbHits Number of hits that the search query matched. + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets page + * + * @return int + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int $page Specify the page to retrieve. + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int $hitsPerPage Maximum number of hits in a page. Minimum is 1, maximum is 1000. + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets updatedAt + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime $updatedAt Date of last update (ISO-8601 format). + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php new file mode 100644 index 0000000000..8a715a3f28 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php @@ -0,0 +1,356 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchUserIdsResponseHighlightResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchUserIdsResponse__highlightResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'userID' => '\Algolia\AlgoliaSearch\Model\HighlightResult', + 'clusterName' => '\Algolia\AlgoliaSearch\Model\HighlightResult' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'userID' => null, + 'clusterName' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'userID' => 'userID', + 'clusterName' => 'clusterName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userID' => 'setUserID', + 'clusterName' => 'setClusterName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userID' => 'getUserID', + 'clusterName' => 'getClusterName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['userID'] = $data['userID'] ?? null; + $this->container['clusterName'] = $data['clusterName'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['userID'] === null) { + $invalidProperties[] = "'userID' can't be null"; + } + if ($this->container['clusterName'] === null) { + $invalidProperties[] = "'clusterName' 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 userID + * + * @return \Algolia\AlgoliaSearch\Model\HighlightResult + */ + public function getUserID() + { + return $this->container['userID']; + } + + /** + * Sets userID + * + * @param \Algolia\AlgoliaSearch\Model\HighlightResult $userID userID + * + * @return self + */ + public function setUserID($userID) + { + $this->container['userID'] = $userID; + + return $this; + } + + /** + * Gets clusterName + * + * @return \Algolia\AlgoliaSearch\Model\HighlightResult + */ + public function getClusterName() + { + return $this->container['clusterName']; + } + + /** + * Sets clusterName + * + * @param \Algolia\AlgoliaSearch\Model\HighlightResult $clusterName clusterName + * + * @return self + */ + public function setClusterName($clusterName) + { + $this->container['clusterName'] = $clusterName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php new file mode 100644 index 0000000000..a57b79c5e7 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php @@ -0,0 +1,488 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchUserIdsResponseHits implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchUserIdsResponse_hits'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'userID' => '\Algolia\AlgoliaSearch\Model\UserId', + 'clusterName' => 'string', + 'nbRecords' => 'int', + 'dataSize' => 'int', + 'objectID' => 'string', + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHighlightResult' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'userID' => null, + 'clusterName' => null, + 'nbRecords' => null, + 'dataSize' => null, + 'objectID' => null, + 'highlightResult' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'userID' => 'userID', + 'clusterName' => 'clusterName', + 'nbRecords' => 'nbRecords', + 'dataSize' => 'dataSize', + 'objectID' => 'objectID', + 'highlightResult' => '_highlightResult' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userID' => 'setUserID', + 'clusterName' => 'setClusterName', + 'nbRecords' => 'setNbRecords', + 'dataSize' => 'setDataSize', + 'objectID' => 'setObjectID', + 'highlightResult' => 'setHighlightResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userID' => 'getUserID', + 'clusterName' => 'getClusterName', + 'nbRecords' => 'getNbRecords', + 'dataSize' => 'getDataSize', + 'objectID' => 'getObjectID', + 'highlightResult' => 'getHighlightResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['userID'] = $data['userID'] ?? null; + $this->container['clusterName'] = $data['clusterName'] ?? null; + $this->container['nbRecords'] = $data['nbRecords'] ?? null; + $this->container['dataSize'] = $data['dataSize'] ?? null; + $this->container['objectID'] = $data['objectID'] ?? null; + $this->container['highlightResult'] = $data['highlightResult'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['userID'] === null) { + $invalidProperties[] = "'userID' can't be null"; + } + if ($this->container['clusterName'] === null) { + $invalidProperties[] = "'clusterName' can't be null"; + } + if ($this->container['nbRecords'] === null) { + $invalidProperties[] = "'nbRecords' can't be null"; + } + if ($this->container['dataSize'] === null) { + $invalidProperties[] = "'dataSize' can't be null"; + } + if ($this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if ($this->container['highlightResult'] === null) { + $invalidProperties[] = "'highlightResult' 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 userID + * + * @return \Algolia\AlgoliaSearch\Model\UserId + */ + public function getUserID() + { + return $this->container['userID']; + } + + /** + * Sets userID + * + * @param \Algolia\AlgoliaSearch\Model\UserId $userID userID + * + * @return self + */ + public function setUserID($userID) + { + $this->container['userID'] = $userID; + + return $this; + } + + /** + * Gets clusterName + * + * @return string + */ + public function getClusterName() + { + return $this->container['clusterName']; + } + + /** + * Sets clusterName + * + * @param string $clusterName Name of the cluster. + * + * @return self + */ + public function setClusterName($clusterName) + { + $this->container['clusterName'] = $clusterName; + + return $this; + } + + /** + * Gets nbRecords + * + * @return int + */ + public function getNbRecords() + { + return $this->container['nbRecords']; + } + + /** + * Sets nbRecords + * + * @param int $nbRecords Number of records in the cluster. + * + * @return self + */ + public function setNbRecords($nbRecords) + { + $this->container['nbRecords'] = $nbRecords; + + return $this; + } + + /** + * Gets dataSize + * + * @return int + */ + public function getDataSize() + { + return $this->container['dataSize']; + } + + /** + * Sets dataSize + * + * @param int $dataSize Data size taken by all the users assigned to the cluster. + * + * @return self + */ + public function setDataSize($dataSize) + { + $this->container['dataSize'] = $dataSize; + + return $this; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string $objectID userID of the requested user. Same as userID. + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets highlightResult + * + * @return \Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHighlightResult + */ + public function getHighlightResult() + { + return $this->container['highlightResult']; + } + + /** + * Sets highlightResult + * + * @param \Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHighlightResult $highlightResult highlightResult + * + * @return self + */ + public function setHighlightResult($highlightResult) + { + $this->container['highlightResult'] = $highlightResult; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SnippetResult.php b/clients/algoliasearch-client-php/lib/Model/SnippetResult.php new file mode 100644 index 0000000000..458bdf5bda --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SnippetResult.php @@ -0,0 +1,386 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SnippetResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'snippetResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'value' => 'string', + 'matchLevel' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'matchLevel' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'matchLevel' => 'matchLevel' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'matchLevel' => 'setMatchLevel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'matchLevel' => 'getMatchLevel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const MATCH_LEVEL_NONE = 'none'; + const MATCH_LEVEL_PARTIAL = 'partial'; + const MATCH_LEVEL_FULL = 'full'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMatchLevelAllowableValues() + { + return [ + self::MATCH_LEVEL_NONE, + self::MATCH_LEVEL_PARTIAL, + self::MATCH_LEVEL_FULL, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + $this->container['matchLevel'] = $data['matchLevel'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMatchLevelAllowableValues(); + if (!is_null($this->container['matchLevel']) && !in_array($this->container['matchLevel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'matchLevel', must be one of '%s'", + $this->container['matchLevel'], + implode("', '", $allowedValues) + ); + } + + 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 value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value Markup text with occurrences highlighted. + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matchLevel + * + * @return string|null + */ + public function getMatchLevel() + { + return $this->container['matchLevel']; + } + + /** + * Sets matchLevel + * + * @param string|null $matchLevel Indicates how well the attribute matched the search query. + * + * @return self + */ + public function setMatchLevel($matchLevel) + { + $allowedValues = $this->getMatchLevelAllowableValues(); + if (!is_null($matchLevel) && !in_array($matchLevel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'matchLevel', must be one of '%s'", + $matchLevel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['matchLevel'] = $matchLevel; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/Source.php b/clients/algoliasearch-client-php/lib/Model/Source.php new file mode 100644 index 0000000000..09cdc934d6 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Source.php @@ -0,0 +1,354 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Source implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'source'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'source' => 'string', + 'description' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'source' => null, + 'description' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'source' => 'source', + 'description' => 'description' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'source' => 'setSource', + 'description' => 'setDescription' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'source' => 'getSource', + 'description' => 'getDescription' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['source'] = $data['source'] ?? null; + $this->container['description'] = $data['description'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['source'] === null) { + $invalidProperties[] = "'source' 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 source + * + * @return string + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param string $source The IP range of the source. + * + * @return self + */ + public function setSource($source) + { + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description of the source. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/StandardEntries.php b/clients/algoliasearch-client-php/lib/Model/StandardEntries.php new file mode 100644 index 0000000000..6901a48bff --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/StandardEntries.php @@ -0,0 +1,381 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class StandardEntries implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'standardEntries'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'plurals' => 'array', + 'stopwords' => 'array', + 'compounds' => 'array' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'plurals' => null, + 'stopwords' => null, + 'compounds' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'plurals' => 'plurals', + 'stopwords' => 'stopwords', + 'compounds' => 'compounds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'plurals' => 'setPlurals', + 'stopwords' => 'setStopwords', + 'compounds' => 'setCompounds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'plurals' => 'getPlurals', + 'stopwords' => 'getStopwords', + 'compounds' => 'getCompounds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['plurals'] = $data['plurals'] ?? null; + $this->container['stopwords'] = $data['stopwords'] ?? null; + $this->container['compounds'] = $data['compounds'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 plurals + * + * @return array|null + */ + public function getPlurals() + { + return $this->container['plurals']; + } + + /** + * Sets plurals + * + * @param array|null $plurals Language ISO code. + * + * @return self + */ + public function setPlurals($plurals) + { + $this->container['plurals'] = $plurals; + + return $this; + } + + /** + * Gets stopwords + * + * @return array|null + */ + public function getStopwords() + { + return $this->container['stopwords']; + } + + /** + * Sets stopwords + * + * @param array|null $stopwords Language ISO code. + * + * @return self + */ + public function setStopwords($stopwords) + { + $this->container['stopwords'] = $stopwords; + + return $this; + } + + /** + * Gets compounds + * + * @return array|null + */ + public function getCompounds() + { + return $this->container['compounds']; + } + + /** + * Sets compounds + * + * @param array|null $compounds Language ISO code. + * + * @return self + */ + public function setCompounds($compounds) + { + $this->container['compounds'] = $compounds; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SynonymHit.php b/clients/algoliasearch-client-php/lib/Model/SynonymHit.php new file mode 100644 index 0000000000..31f9c859a1 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SynonymHit.php @@ -0,0 +1,607 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SynonymHit implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'synonymHit'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'objectID' => 'string', + 'type' => 'string', + 'synonyms' => 'string[]', + 'input' => 'string', + 'word' => 'string', + 'corrections' => 'string[]', + 'placeholder' => 'string', + 'replacements' => 'string[]', + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\SynonymHitHighlightResult' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'objectID' => null, + 'type' => null, + 'synonyms' => null, + 'input' => null, + 'word' => null, + 'corrections' => null, + 'placeholder' => null, + 'replacements' => null, + 'highlightResult' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'objectID' => 'objectID', + 'type' => 'type', + 'synonyms' => 'synonyms', + 'input' => 'input', + 'word' => 'word', + 'corrections' => 'corrections', + 'placeholder' => 'placeholder', + 'replacements' => 'replacements', + 'highlightResult' => '_highlightResult' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'type' => 'setType', + 'synonyms' => 'setSynonyms', + 'input' => 'setInput', + 'word' => 'setWord', + 'corrections' => 'setCorrections', + 'placeholder' => 'setPlaceholder', + 'replacements' => 'setReplacements', + 'highlightResult' => 'setHighlightResult' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'type' => 'getType', + 'synonyms' => 'getSynonyms', + 'input' => 'getInput', + 'word' => 'getWord', + 'corrections' => 'getCorrections', + 'placeholder' => 'getPlaceholder', + 'replacements' => 'getReplacements', + 'highlightResult' => 'getHighlightResult' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const TYPE_SYNONYM = 'synonym'; + const TYPE_ONEWAYSYNONYM = 'onewaysynonym'; + const TYPE_ALTCORRECTION1 = 'altcorrection1'; + const TYPE_ALTCORRECTION2 = 'altcorrection2'; + const TYPE_PLACEHOLDER = 'placeholder'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_SYNONYM, + self::TYPE_ONEWAYSYNONYM, + self::TYPE_ALTCORRECTION1, + self::TYPE_ALTCORRECTION2, + self::TYPE_PLACEHOLDER, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['objectID'] = $data['objectID'] ?? null; + $this->container['type'] = $data['type'] ?? null; + $this->container['synonyms'] = $data['synonyms'] ?? null; + $this->container['input'] = $data['input'] ?? null; + $this->container['word'] = $data['word'] ?? null; + $this->container['corrections'] = $data['corrections'] ?? null; + $this->container['placeholder'] = $data['placeholder'] ?? null; + $this->container['replacements'] = $data['replacements'] ?? null; + $this->container['highlightResult'] = $data['highlightResult'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string $objectID Unique identifier of the synonym object to be created or updated. + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Type of the synonym object. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets synonyms + * + * @return string[]|null + */ + public function getSynonyms() + { + return $this->container['synonyms']; + } + + /** + * Sets synonyms + * + * @param string[]|null $synonyms Words or phrases to be considered equivalent. + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets input + * + * @return string|null + */ + public function getInput() + { + return $this->container['input']; + } + + /** + * Sets input + * + * @param string|null $input Word or phrase to appear in query strings (for onewaysynonym). + * + * @return self + */ + public function setInput($input) + { + $this->container['input'] = $input; + + return $this; + } + + /** + * Gets word + * + * @return string|null + */ + public function getWord() + { + return $this->container['word']; + } + + /** + * Sets word + * + * @param string|null $word Word or phrase to appear in query strings (for altcorrection1 and altcorrection2). + * + * @return self + */ + public function setWord($word) + { + $this->container['word'] = $word; + + return $this; + } + + /** + * Gets corrections + * + * @return string[]|null + */ + public function getCorrections() + { + return $this->container['corrections']; + } + + /** + * Sets corrections + * + * @param string[]|null $corrections Words to be matched in records. + * + * @return self + */ + public function setCorrections($corrections) + { + $this->container['corrections'] = $corrections; + + return $this; + } + + /** + * Gets placeholder + * + * @return string|null + */ + public function getPlaceholder() + { + return $this->container['placeholder']; + } + + /** + * Sets placeholder + * + * @param string|null $placeholder Token to be put inside records. + * + * @return self + */ + public function setPlaceholder($placeholder) + { + $this->container['placeholder'] = $placeholder; + + return $this; + } + + /** + * Gets replacements + * + * @return string[]|null + */ + public function getReplacements() + { + return $this->container['replacements']; + } + + /** + * Sets replacements + * + * @param string[]|null $replacements List of query words that will match the token. + * + * @return self + */ + public function setReplacements($replacements) + { + $this->container['replacements'] = $replacements; + + return $this; + } + + /** + * Gets highlightResult + * + * @return \Algolia\AlgoliaSearch\Model\SynonymHitHighlightResult|null + */ + public function getHighlightResult() + { + return $this->container['highlightResult']; + } + + /** + * Sets highlightResult + * + * @param \Algolia\AlgoliaSearch\Model\SynonymHitHighlightResult|null $highlightResult highlightResult + * + * @return self + */ + public function setHighlightResult($highlightResult) + { + $this->container['highlightResult'] = $highlightResult; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php b/clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php new file mode 100644 index 0000000000..ada56d25e7 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php @@ -0,0 +1,351 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SynonymHitHighlightResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'synonymHit__highlightResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\Algolia\AlgoliaSearch\Model\HighlightResult', + 'synonyms' => '\Algolia\AlgoliaSearch\Model\HighlightResult[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null, + 'synonyms' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', + 'synonyms' => 'synonyms' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'synonyms' => 'setSynonyms' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'synonyms' => 'getSynonyms' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['type'] = $data['type'] ?? null; + $this->container['synonyms'] = $data['synonyms'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 type + * + * @return \Algolia\AlgoliaSearch\Model\HighlightResult|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Algolia\AlgoliaSearch\Model\HighlightResult|null $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets synonyms + * + * @return \Algolia\AlgoliaSearch\Model\HighlightResult[]|null + */ + public function getSynonyms() + { + return $this->container['synonyms']; + } + + /** + * Sets synonyms + * + * @param \Algolia\AlgoliaSearch\Model\HighlightResult[]|null $synonyms synonyms + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/TimeRange.php b/clients/algoliasearch-client-php/lib/Model/TimeRange.php new file mode 100644 index 0000000000..5235fe9265 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/TimeRange.php @@ -0,0 +1,356 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class TimeRange implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'timeRange'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'from' => 'int', + 'until' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'from' => null, + 'until' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'from' => 'from', + 'until' => 'until' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'from' => 'setFrom', + 'until' => 'setUntil' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'from' => 'getFrom', + 'until' => 'getUntil' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['from'] = $data['from'] ?? null; + $this->container['until'] = $data['until'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['from'] === null) { + $invalidProperties[] = "'from' can't be null"; + } + if ($this->container['until'] === null) { + $invalidProperties[] = "'until' 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 from + * + * @return int + */ + public function getFrom() + { + return $this->container['from']; + } + + /** + * Sets from + * + * @param int $from Lower bound of the time range (Unix timestamp). + * + * @return self + */ + public function setFrom($from) + { + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets until + * + * @return int + */ + public function getUntil() + { + return $this->container['until']; + } + + /** + * Sets until + * + * @param int $until Upper bound of the time range (Unix timestamp). + * + * @return self + */ + public function setUntil($until) + { + $this->container['until'] = $until; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php new file mode 100644 index 0000000000..3d2d221580 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php @@ -0,0 +1,356 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'updateApiKeyResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'key' => 'string', + 'updatedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'key' => null, + 'updatedAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'key' => 'key', + 'updatedAt' => 'updatedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'key' => 'setKey', + 'updatedAt' => 'setUpdatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'key' => 'getKey', + 'updatedAt' => 'getUpdatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['key'] = $data['key'] ?? null; + $this->container['updatedAt'] = $data['updatedAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['key'] === null) { + $invalidProperties[] = "'key' can't be null"; + } + if ($this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' 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 key + * + * @return string + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string $key Key string. + * + * @return self + */ + public function setKey($key) + { + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets updatedAt + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime $updatedAt Date of last update (ISO-8601 format). + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php new file mode 100644 index 0000000000..bee6877cc6 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php @@ -0,0 +1,357 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdatedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'updatedAtResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'taskID' => 'int', + 'updatedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'taskID' => null, + 'updatedAt' => 'date-time' + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'taskID' => 'taskID', + 'updatedAt' => 'updatedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'taskID' => 'setTaskID', + 'updatedAt' => 'setUpdatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'taskID' => 'getTaskID', + 'updatedAt' => 'getUpdatedAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['taskID'] = $data['taskID'] ?? null; + $this->container['updatedAt'] = $data['updatedAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['taskID'] === null) { + $invalidProperties[] = "'taskID' can't be null"; + } + if ($this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' 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 taskID + * + * @return int + */ + public function getTaskID() + { + return $this->container['taskID']; + } + + /** + * Sets taskID + * + * @param int $taskID taskID of the indexing task to wait for. + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + + /** + * Gets updatedAt + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime $updatedAt Date of last update (ISO-8601 format). + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php new file mode 100644 index 0000000000..4c12643092 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php @@ -0,0 +1,381 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdatedAtWithObjectIdResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'updatedAtWithObjectIdResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'taskID' => 'int', + 'updatedAt' => '\DateTime', + 'objectID' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'taskID' => null, + 'updatedAt' => 'date-time', + 'objectID' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'taskID' => 'taskID', + 'updatedAt' => 'updatedAt', + 'objectID' => 'objectID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'taskID' => 'setTaskID', + 'updatedAt' => 'setUpdatedAt', + 'objectID' => 'setObjectID' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'taskID' => 'getTaskID', + 'updatedAt' => 'getUpdatedAt', + 'objectID' => 'getObjectID' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['taskID'] = $data['taskID'] ?? null; + $this->container['updatedAt'] = $data['updatedAt'] ?? null; + $this->container['objectID'] = $data['objectID'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 taskID + * + * @return int|null + */ + public function getTaskID() + { + return $this->container['taskID']; + } + + /** + * Sets taskID + * + * @param int|null $taskID taskID of the indexing task to wait for. + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + + /** + * Gets updatedAt + * + * @return \DateTime|null + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime|null $updatedAt Date of last update (ISO-8601 format). + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + + /** + * Gets objectID + * + * @return string|null + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string|null $objectID Unique identifier of the object. + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php new file mode 100644 index 0000000000..b78f7f711a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php @@ -0,0 +1,389 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdatedRuleResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'updatedRuleResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'objectID' => 'string', + 'updatedAt' => '\DateTime', + 'taskID' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'objectID' => null, + 'updatedAt' => 'date-time', + 'taskID' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'objectID' => 'objectID', + 'updatedAt' => 'updatedAt', + 'taskID' => 'taskID' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'updatedAt' => 'setUpdatedAt', + 'taskID' => 'setTaskID' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'updatedAt' => 'getUpdatedAt', + 'taskID' => 'getTaskID' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['objectID'] = $data['objectID'] ?? null; + $this->container['updatedAt'] = $data['updatedAt'] ?? null; + $this->container['taskID'] = $data['taskID'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if ($this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' can't be null"; + } + if ($this->container['taskID'] === null) { + $invalidProperties[] = "'taskID' 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 objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string $objectID Unique identifier of the object. + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets updatedAt + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime $updatedAt Date of last update (ISO-8601 format). + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + + /** + * Gets taskID + * + * @return int + */ + public function getTaskID() + { + return $this->container['taskID']; + } + + /** + * Sets taskID + * + * @param int $taskID taskID of the indexing task to wait for. + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/Model/UserId.php b/clients/algoliasearch-client-php/lib/Model/UserId.php new file mode 100644 index 0000000000..c501110e69 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/UserId.php @@ -0,0 +1,423 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UserId implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'userId'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'userID' => 'string', + 'clusterName' => 'string', + 'nbRecords' => 'int', + 'dataSize' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'userID' => null, + 'clusterName' => null, + 'nbRecords' => null, + 'dataSize' => null + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'userID' => 'userID', + 'clusterName' => 'clusterName', + 'nbRecords' => 'nbRecords', + 'dataSize' => 'dataSize' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userID' => 'setUserID', + 'clusterName' => 'setClusterName', + 'nbRecords' => 'setNbRecords', + 'dataSize' => 'setDataSize' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userID' => 'getUserID', + 'clusterName' => 'getClusterName', + 'nbRecords' => 'getNbRecords', + 'dataSize' => 'getDataSize' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['userID'] = $data['userID'] ?? null; + $this->container['clusterName'] = $data['clusterName'] ?? null; + $this->container['nbRecords'] = $data['nbRecords'] ?? null; + $this->container['dataSize'] = $data['dataSize'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['userID'] === null) { + $invalidProperties[] = "'userID' can't be null"; + } + if ($this->container['clusterName'] === null) { + $invalidProperties[] = "'clusterName' can't be null"; + } + if ($this->container['nbRecords'] === null) { + $invalidProperties[] = "'nbRecords' can't be null"; + } + if ($this->container['dataSize'] === null) { + $invalidProperties[] = "'dataSize' 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 userID + * + * @return string + */ + public function getUserID() + { + return $this->container['userID']; + } + + /** + * Sets userID + * + * @param string $userID userID of the user. + * + * @return self + */ + public function setUserID($userID) + { + $this->container['userID'] = $userID; + + return $this; + } + + /** + * Gets clusterName + * + * @return string + */ + public function getClusterName() + { + return $this->container['clusterName']; + } + + /** + * Sets clusterName + * + * @param string $clusterName Cluster on which the user is assigned. + * + * @return self + */ + public function setClusterName($clusterName) + { + $this->container['clusterName'] = $clusterName; + + return $this; + } + + /** + * Gets nbRecords + * + * @return int + */ + public function getNbRecords() + { + return $this->container['nbRecords']; + } + + /** + * Sets nbRecords + * + * @param int $nbRecords Number of records belonging to the user. + * + * @return self + */ + public function setNbRecords($nbRecords) + { + $this->container['nbRecords'] = $nbRecords; + + return $this; + } + + /** + * Gets dataSize + * + * @return int + */ + public function getDataSize() + { + return $this->container['dataSize']; + } + + /** + * Sets dataSize + * + * @param int $dataSize Data size used by the user. + * + * @return self + */ + public function setDataSize($dataSize) + { + $this->container['dataSize'] = $dataSize; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $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 integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/clients/algoliasearch-client-php/lib/ObjectSerializer.php b/clients/algoliasearch-client-php/lib/ObjectSerializer.php new file mode 100644 index 0000000000..f22e39a458 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/ObjectSerializer.php @@ -0,0 +1,393 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue($value) + { + return rawurlencode(self::toString($value)); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the query, by imploding comma-separated if it's an object. + * If it's a string, pass through unchanged. It will be url-encoded + * later. + * + * @param string[]|string|\DateTime $object an object to be serialized to a string + * + * @return string the serialized object + */ + public static function toQueryValue($object) + { + if (is_array($object)) { + return implode(',', $object); + } else { + return self::toString($object); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue($value) + { + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); + } + + return self::toString($value); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string|\SplFileObject $value the value of the form parameter + * + * @return string the form string + */ + public static function toFormValue($value) + { + if ($value instanceof \SplFileObject) { + return $value->getRealPath(); + } else { + return self::toString($value); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * If it's a boolean, convert it to "true" or "false". + * + * @param string|bool|\DateTime $value the value of the parameter + * + * @return string the header string + */ + public static function toString($value) + { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(self::$dateTimeFormat); + } elseif (is_bool($value)) { + return $value ? 'true' : 'false'; + } else { + return $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } else if ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some API's return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some API's return a date-time with too high nanosecond + // precision for php's DateTime to handle. This conversion + // (string -> unix timestamp -> DateTime) is a workaround + // for the problem. + return (new \DateTime())->setTimestamp(strtotime($data)); + } + } else { + return null; + } + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + if ($class === '\SplFileObject') { + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (array_key_exists('Content-Disposition', $httpHeaders) && + preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } elseif (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Algolia\AlgoliaSearch\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/clients/algoliasearch-client-php/phpunit.xml.dist b/clients/algoliasearch-client-php/phpunit.xml.dist new file mode 100644 index 0000000000..485899aaf2 --- /dev/null +++ b/clients/algoliasearch-client-php/phpunit.xml.dist @@ -0,0 +1,18 @@ + + + + + ./lib/Api + ./lib/Model + + + + + ./test/Api + ./test/Model + + + + + + diff --git a/clients/algoliasearch-client-php/test/Api/SearchApiTest.php b/clients/algoliasearch-client-php/test/Api/SearchApiTest.php new file mode 100644 index 0000000000..be62bc69f4 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Api/SearchApiTest.php @@ -0,0 +1,757 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test case for addOrUpdateObject + * + * Add or replace an object with a given object ID.. + * + */ + public function testAddOrUpdateObject() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for appendSource + * + * . + * + */ + public function testAppendSource() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for assignUserId + * + * Assign or Move userID. + * + */ + public function testAssignUserId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for batch + * + * . + * + */ + public function testBatch() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for batchAssignUserIds + * + * Batch assign userIDs. + * + */ + public function testBatchAssignUserIds() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for batchDictionaryEntries + * + * Send a batch of dictionary entries.. + * + */ + public function testBatchDictionaryEntries() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for batchRules + * + * Batch Rules.. + * + */ + public function testBatchRules() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for browse + * + * Retrieve all index content.. + * + */ + public function testBrowse() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for clearAllSynonyms + * + * Clear all synonyms.. + * + */ + public function testClearAllSynonyms() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for clearObjects + * + * clear all objects from an index.. + * + */ + public function testClearObjects() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for clearRules + * + * Clear Rules.. + * + */ + public function testClearRules() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteApiKey + * + * Delete an API key.. + * + */ + public function testDeleteApiKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteBy + * + * Delete all records matching the query.. + * + */ + public function testDeleteBy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteIndex + * + * Delete index.. + * + */ + public function testDeleteIndex() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteObject + * + * Delete object.. + * + */ + public function testDeleteObject() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteRule + * + * Delete a rule.. + * + */ + public function testDeleteRule() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteSource + * + * . + * + */ + public function testDeleteSource() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for deleteSynonym + * + * Delete synonym.. + * + */ + public function testDeleteSynonym() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getApiKey + * + * Get an API key.. + * + */ + public function testGetApiKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getDictionaryLanguages + * + * List dictionaries supported per language.. + * + */ + public function testGetDictionaryLanguages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getDictionarySettings + * + * Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values.. + * + */ + public function testGetDictionarySettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getLogs + * + * . + * + */ + public function testGetLogs() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getObject + * + * Retrieve one object from the index.. + * + */ + public function testGetObject() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getObjects + * + * Retrieve one or more objects.. + * + */ + public function testGetObjects() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getRule + * + * Get a rule.. + * + */ + public function testGetRule() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getSettings + * + * . + * + */ + public function testGetSettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getSources + * + * . + * + */ + public function testGetSources() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getSynonym + * + * Get synonym.. + * + */ + public function testGetSynonym() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getTask + * + * . + * + */ + public function testGetTask() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getTopUserIds + * + * Get top userID. + * + */ + public function testGetTopUserIds() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for getUserId + * + * Get userID. + * + */ + public function testGetUserId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for hasPendingMappings + * + * Has pending mappings. + * + */ + public function testHasPendingMappings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listApiKeys + * + * Get the full list of API Keys.. + * + */ + public function testListApiKeys() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listClusters + * + * List clusters. + * + */ + public function testListClusters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listIndices + * + * List existing indexes.. + * + */ + public function testListIndices() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for listUserIds + * + * List userIDs. + * + */ + public function testListUserIds() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for multipleBatch + * + * . + * + */ + public function testMultipleBatch() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for multipleQueries + * + * . + * + */ + public function testMultipleQueries() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for operationIndex + * + * Copy/move index.. + * + */ + public function testOperationIndex() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for partialUpdateObject + * + * Partially update an object.. + * + */ + public function testPartialUpdateObject() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for removeUserId + * + * Remove userID. + * + */ + public function testRemoveUserId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for replaceSources + * + * . + * + */ + public function testReplaceSources() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for restoreApiKey + * + * Restore an API key.. + * + */ + public function testRestoreApiKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for saveObject + * + * . + * + */ + public function testSaveObject() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for saveRule + * + * Save/Update a rule.. + * + */ + public function testSaveRule() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for saveSynonym + * + * Save synonym.. + * + */ + public function testSaveSynonym() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for saveSynonyms + * + * Save a batch of synonyms.. + * + */ + public function testSaveSynonyms() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for search + * + * . + * + */ + public function testSearch() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for searchDictionaryEntries + * + * Search the dictionary entries.. + * + */ + public function testSearchDictionaryEntries() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for searchForFacetValues + * + * Search for values of a given facet. + * + */ + public function testSearchForFacetValues() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for searchRules + * + * Search for rules.. + * + */ + public function testSearchRules() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for searchSynonyms + * + * Get all synonyms that match a query.. + * + */ + public function testSearchSynonyms() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for searchUserIds + * + * Search userID. + * + */ + public function testSearchUserIds() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for setDictionarySettings + * + * Set dictionary settings.. + * + */ + public function testSetDictionarySettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for setSettings + * + * . + * + */ + public function testSetSettings() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test case for updateApiKey + * + * Update an API key.. + * + */ + public function testUpdateApiKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/ActionTest.php b/clients/algoliasearch-client-php/test/Model/ActionTest.php new file mode 100644 index 0000000000..aa148ac48f --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/ActionTest.php @@ -0,0 +1,81 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/AddApiKeyResponseTest.php b/clients/algoliasearch-client-php/test/Model/AddApiKeyResponseTest.php new file mode 100644 index 0000000000..bb09051f19 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/AddApiKeyResponseTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "key" + */ + public function testPropertyKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "createdAt" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/AnchoringTest.php b/clients/algoliasearch-client-php/test/Model/AnchoringTest.php new file mode 100644 index 0000000000..d057c62a46 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/AnchoringTest.php @@ -0,0 +1,81 @@ +markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/ApiKeyTest.php b/clients/algoliasearch-client-php/test/Model/ApiKeyTest.php new file mode 100644 index 0000000000..da62429c08 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/ApiKeyTest.php @@ -0,0 +1,153 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "acl" + */ + public function testPropertyAcl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "indexes" + */ + public function testPropertyIndexes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "maxHitsPerQuery" + */ + public function testPropertyMaxHitsPerQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "maxQueriesPerIPPerHour" + */ + public function testPropertyMaxQueriesPerIPPerHour() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryParameters" + */ + public function testPropertyQueryParameters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "referers" + */ + public function testPropertyReferers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "validity" + */ + public function testPropertyValidity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/AssignUserIdObjectTest.php b/clients/algoliasearch-client-php/test/Model/AssignUserIdObjectTest.php new file mode 100644 index 0000000000..dbd6e25121 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/AssignUserIdObjectTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cluster" + */ + public function testPropertyCluster() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/AutomaticFacetFilterTest.php b/clients/algoliasearch-client-php/test/Model/AutomaticFacetFilterTest.php new file mode 100644 index 0000000000..80a511b55a --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/AutomaticFacetFilterTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facet" + */ + public function testPropertyFacet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "score" + */ + public function testPropertyScore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disjunctive" + */ + public function testPropertyDisjunctive() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/BaseBrowseResponseTest.php b/clients/algoliasearch-client-php/test/Model/BaseBrowseResponseTest.php new file mode 100644 index 0000000000..83a50609f6 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/BaseBrowseResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cursor" + */ + public function testPropertyCursor() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/BaseIndexSettingsTest.php b/clients/algoliasearch-client-php/test/Model/BaseIndexSettingsTest.php new file mode 100644 index 0000000000..c54a4e720f --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/BaseIndexSettingsTest.php @@ -0,0 +1,189 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "replicas" + */ + public function testPropertyReplicas() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "paginationLimitedTo" + */ + public function testPropertyPaginationLimitedTo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disableTypoToleranceOnWords" + */ + public function testPropertyDisableTypoToleranceOnWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToTransliterate" + */ + public function testPropertyAttributesToTransliterate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "camelCaseAttributes" + */ + public function testPropertyCamelCaseAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "decompoundedAttributes" + */ + public function testPropertyDecompoundedAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "indexLanguages" + */ + public function testPropertyIndexLanguages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filterPromotes" + */ + public function testPropertyFilterPromotes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disablePrefixOnAttributes" + */ + public function testPropertyDisablePrefixOnAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "allowCompressionOfIntegerArray" + */ + public function testPropertyAllowCompressionOfIntegerArray() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "numericAttributesForFiltering" + */ + public function testPropertyNumericAttributesForFiltering() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userData" + */ + public function testPropertyUserData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/BaseSearchParamsTest.php b/clients/algoliasearch-client-php/test/Model/BaseSearchParamsTest.php new file mode 100644 index 0000000000..2e79f8360a --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/BaseSearchParamsTest.php @@ -0,0 +1,369 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "similarQuery" + */ + public function testPropertySimilarQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filters" + */ + public function testPropertyFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facetFilters" + */ + public function testPropertyFacetFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "optionalFilters" + */ + public function testPropertyOptionalFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "numericFilters" + */ + public function testPropertyNumericFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tagFilters" + */ + public function testPropertyTagFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sumOrFiltersScores" + */ + public function testPropertySumOrFiltersScores() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facets" + */ + public function testPropertyFacets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "maxValuesPerFacet" + */ + public function testPropertyMaxValuesPerFacet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facetingAfterDistinct" + */ + public function testPropertyFacetingAfterDistinct() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sortFacetValuesBy" + */ + public function testPropertySortFacetValuesBy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page" + */ + public function testPropertyPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "offset" + */ + public function testPropertyOffset() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "length" + */ + public function testPropertyLength() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundLatLng" + */ + public function testPropertyAroundLatLng() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundLatLngViaIP" + */ + public function testPropertyAroundLatLngViaIP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundRadius" + */ + public function testPropertyAroundRadius() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundPrecision" + */ + public function testPropertyAroundPrecision() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minimumAroundRadius" + */ + public function testPropertyMinimumAroundRadius() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "insideBoundingBox" + */ + public function testPropertyInsideBoundingBox() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "insidePolygon" + */ + public function testPropertyInsidePolygon() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "naturalLanguages" + */ + public function testPropertyNaturalLanguages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ruleContexts" + */ + public function testPropertyRuleContexts() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "personalizationImpact" + */ + public function testPropertyPersonalizationImpact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userToken" + */ + public function testPropertyUserToken() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "getRankingInfo" + */ + public function testPropertyGetRankingInfo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "clickAnalytics" + */ + public function testPropertyClickAnalytics() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "analytics" + */ + public function testPropertyAnalytics() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "analyticsTags" + */ + public function testPropertyAnalyticsTags() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "percentileComputation" + */ + public function testPropertyPercentileComputation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enableABTest" + */ + public function testPropertyEnableABTest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enableReRanking" + */ + public function testPropertyEnableReRanking() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/BaseSearchResponseFacetsStatsTest.php b/clients/algoliasearch-client-php/test/Model/BaseSearchResponseFacetsStatsTest.php new file mode 100644 index 0000000000..a56e93f68c --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/BaseSearchResponseFacetsStatsTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "min" + */ + public function testPropertyMin() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "max" + */ + public function testPropertyMax() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "avg" + */ + public function testPropertyAvg() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sum" + */ + public function testPropertySum() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/BaseSearchResponseTest.php b/clients/algoliasearch-client-php/test/Model/BaseSearchResponseTest.php new file mode 100644 index 0000000000..f9cc9768cc --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/BaseSearchResponseTest.php @@ -0,0 +1,297 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "abTestID" + */ + public function testPropertyAbTestID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "abTestVariantID" + */ + public function testPropertyAbTestVariantID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundLatLng" + */ + public function testPropertyAroundLatLng() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "automaticRadius" + */ + public function testPropertyAutomaticRadius() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exhaustiveFacetsCount" + */ + public function testPropertyExhaustiveFacetsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exhaustiveNbHits" + */ + public function testPropertyExhaustiveNbHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exhaustiveTypo" + */ + public function testPropertyExhaustiveTypo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facets" + */ + public function testPropertyFacets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facetsStats" + */ + public function testPropertyFacetsStats() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hitsPerPage" + */ + public function testPropertyHitsPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "index" + */ + public function testPropertyIndex() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "indexUsed" + */ + public function testPropertyIndexUsed() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbHits" + */ + public function testPropertyNbHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbPages" + */ + public function testPropertyNbPages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbSortedHits" + */ + public function testPropertyNbSortedHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page" + */ + public function testPropertyPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "params" + */ + public function testPropertyParams() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "parsedQuery" + */ + public function testPropertyParsedQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "processingTimeMS" + */ + public function testPropertyProcessingTimeMS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query" + */ + public function testPropertyQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryAfterRemoval" + */ + public function testPropertyQueryAfterRemoval() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "serverUsed" + */ + public function testPropertyServerUsed() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userData" + */ + public function testPropertyUserData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/BatchAssignUserIdsObjectTest.php b/clients/algoliasearch-client-php/test/Model/BatchAssignUserIdsObjectTest.php new file mode 100644 index 0000000000..26a44b9729 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/BatchAssignUserIdsObjectTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cluster" + */ + public function testPropertyCluster() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "users" + */ + public function testPropertyUsers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesRequestTest.php b/clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesRequestTest.php new file mode 100644 index 0000000000..983cde69d8 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesRequestTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "action" + */ + public function testPropertyAction() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "body" + */ + public function testPropertyBody() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesTest.php b/clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesTest.php new file mode 100644 index 0000000000..942666188c --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "clearExistingDictionaryEntries" + */ + public function testPropertyClearExistingDictionaryEntries() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "requests" + */ + public function testPropertyRequests() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/BatchObjectTest.php b/clients/algoliasearch-client-php/test/Model/BatchObjectTest.php new file mode 100644 index 0000000000..a4330dcb73 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/BatchObjectTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "requests" + */ + public function testPropertyRequests() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/BatchResponseTest.php b/clients/algoliasearch-client-php/test/Model/BatchResponseTest.php new file mode 100644 index 0000000000..95be8ed79d --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/BatchResponseTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "taskID" + */ + public function testPropertyTaskID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "objectIDs" + */ + public function testPropertyObjectIDs() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/BatchWriteObjectTest.php b/clients/algoliasearch-client-php/test/Model/BatchWriteObjectTest.php new file mode 100644 index 0000000000..706560b1e8 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/BatchWriteObjectTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "requests" + */ + public function testPropertyRequests() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/BrowseRequestTest.php b/clients/algoliasearch-client-php/test/Model/BrowseRequestTest.php new file mode 100644 index 0000000000..f1d362b1c3 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/BrowseRequestTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "params" + */ + public function testPropertyParams() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cursor" + */ + public function testPropertyCursor() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/BrowseResponseTest.php b/clients/algoliasearch-client-php/test/Model/BrowseResponseTest.php new file mode 100644 index 0000000000..e5c611f65c --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/BrowseResponseTest.php @@ -0,0 +1,315 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "abTestID" + */ + public function testPropertyAbTestID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "abTestVariantID" + */ + public function testPropertyAbTestVariantID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundLatLng" + */ + public function testPropertyAroundLatLng() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "automaticRadius" + */ + public function testPropertyAutomaticRadius() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exhaustiveFacetsCount" + */ + public function testPropertyExhaustiveFacetsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exhaustiveNbHits" + */ + public function testPropertyExhaustiveNbHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exhaustiveTypo" + */ + public function testPropertyExhaustiveTypo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facets" + */ + public function testPropertyFacets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facetsStats" + */ + public function testPropertyFacetsStats() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hitsPerPage" + */ + public function testPropertyHitsPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "index" + */ + public function testPropertyIndex() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "indexUsed" + */ + public function testPropertyIndexUsed() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbHits" + */ + public function testPropertyNbHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbPages" + */ + public function testPropertyNbPages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbSortedHits" + */ + public function testPropertyNbSortedHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page" + */ + public function testPropertyPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "params" + */ + public function testPropertyParams() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "parsedQuery" + */ + public function testPropertyParsedQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "processingTimeMS" + */ + public function testPropertyProcessingTimeMS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query" + */ + public function testPropertyQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryAfterRemoval" + */ + public function testPropertyQueryAfterRemoval() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "serverUsed" + */ + public function testPropertyServerUsed() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userData" + */ + public function testPropertyUserData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hits" + */ + public function testPropertyHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "cursor" + */ + public function testPropertyCursor() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/BuildInOperationTest.php b/clients/algoliasearch-client-php/test/Model/BuildInOperationTest.php new file mode 100644 index 0000000000..e8e304ff58 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/BuildInOperationTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "operation" + */ + public function testPropertyOperation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/ConditionTest.php b/clients/algoliasearch-client-php/test/Model/ConditionTest.php new file mode 100644 index 0000000000..4a883e5b76 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/ConditionTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "pattern" + */ + public function testPropertyPattern() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "anchoring" + */ + public function testPropertyAnchoring() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "alternatives" + */ + public function testPropertyAlternatives() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "context" + */ + public function testPropertyContext() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/ConsequenceHideTest.php b/clients/algoliasearch-client-php/test/Model/ConsequenceHideTest.php new file mode 100644 index 0000000000..f117ad829e --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/ConsequenceHideTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "objectID" + */ + public function testPropertyObjectID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/ConsequenceParamsTest.php b/clients/algoliasearch-client-php/test/Model/ConsequenceParamsTest.php new file mode 100644 index 0000000000..bfd011dd40 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/ConsequenceParamsTest.php @@ -0,0 +1,792 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query" + */ + public function testPropertyQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "automaticFacetFilters" + */ + public function testPropertyAutomaticFacetFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "automaticOptionalFacetFilters" + */ + public function testPropertyAutomaticOptionalFacetFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "similarQuery" + */ + public function testPropertySimilarQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filters" + */ + public function testPropertyFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facetFilters" + */ + public function testPropertyFacetFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "optionalFilters" + */ + public function testPropertyOptionalFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "numericFilters" + */ + public function testPropertyNumericFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tagFilters" + */ + public function testPropertyTagFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sumOrFiltersScores" + */ + public function testPropertySumOrFiltersScores() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facets" + */ + public function testPropertyFacets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "maxValuesPerFacet" + */ + public function testPropertyMaxValuesPerFacet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facetingAfterDistinct" + */ + public function testPropertyFacetingAfterDistinct() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sortFacetValuesBy" + */ + public function testPropertySortFacetValuesBy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page" + */ + public function testPropertyPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "offset" + */ + public function testPropertyOffset() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "length" + */ + public function testPropertyLength() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundLatLng" + */ + public function testPropertyAroundLatLng() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundLatLngViaIP" + */ + public function testPropertyAroundLatLngViaIP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundRadius" + */ + public function testPropertyAroundRadius() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundPrecision" + */ + public function testPropertyAroundPrecision() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minimumAroundRadius" + */ + public function testPropertyMinimumAroundRadius() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "insideBoundingBox" + */ + public function testPropertyInsideBoundingBox() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "insidePolygon" + */ + public function testPropertyInsidePolygon() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "naturalLanguages" + */ + public function testPropertyNaturalLanguages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ruleContexts" + */ + public function testPropertyRuleContexts() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "personalizationImpact" + */ + public function testPropertyPersonalizationImpact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userToken" + */ + public function testPropertyUserToken() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "getRankingInfo" + */ + public function testPropertyGetRankingInfo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "clickAnalytics" + */ + public function testPropertyClickAnalytics() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "analytics" + */ + public function testPropertyAnalytics() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "analyticsTags" + */ + public function testPropertyAnalyticsTags() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "percentileComputation" + */ + public function testPropertyPercentileComputation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enableABTest" + */ + public function testPropertyEnableABTest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enableReRanking" + */ + public function testPropertyEnableReRanking() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "searchableAttributes" + */ + public function testPropertySearchableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesForFaceting" + */ + public function testPropertyAttributesForFaceting() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unretrievableAttributes" + */ + public function testPropertyUnretrievableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToRetrieve" + */ + public function testPropertyAttributesToRetrieve() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "restrictSearchableAttributes" + */ + public function testPropertyRestrictSearchableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ranking" + */ + public function testPropertyRanking() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customRanking" + */ + public function testPropertyCustomRanking() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "relevancyStrictness" + */ + public function testPropertyRelevancyStrictness() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToHighlight" + */ + public function testPropertyAttributesToHighlight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToSnippet" + */ + public function testPropertyAttributesToSnippet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "highlightPreTag" + */ + public function testPropertyHighlightPreTag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "highlightPostTag" + */ + public function testPropertyHighlightPostTag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "snippetEllipsisText" + */ + public function testPropertySnippetEllipsisText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "restrictHighlightAndSnippetArrays" + */ + public function testPropertyRestrictHighlightAndSnippetArrays() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hitsPerPage" + */ + public function testPropertyHitsPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minWordSizefor1Typo" + */ + public function testPropertyMinWordSizefor1Typo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minWordSizefor2Typos" + */ + public function testPropertyMinWordSizefor2Typos() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "typoTolerance" + */ + public function testPropertyTypoTolerance() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "allowTyposOnNumericTokens" + */ + public function testPropertyAllowTyposOnNumericTokens() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disableTypoToleranceOnAttributes" + */ + public function testPropertyDisableTypoToleranceOnAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "separatorsToIndex" + */ + public function testPropertySeparatorsToIndex() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ignorePlurals" + */ + public function testPropertyIgnorePlurals() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "removeStopWords" + */ + public function testPropertyRemoveStopWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "keepDiacriticsOnCharacters" + */ + public function testPropertyKeepDiacriticsOnCharacters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryLanguages" + */ + public function testPropertyQueryLanguages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "decompoundQuery" + */ + public function testPropertyDecompoundQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enableRules" + */ + public function testPropertyEnableRules() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enablePersonalization" + */ + public function testPropertyEnablePersonalization() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryType" + */ + public function testPropertyQueryType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "removeWordsIfNoResults" + */ + public function testPropertyRemoveWordsIfNoResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "advancedSyntax" + */ + public function testPropertyAdvancedSyntax() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "optionalWords" + */ + public function testPropertyOptionalWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disableExactOnAttributes" + */ + public function testPropertyDisableExactOnAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exactOnSingleWordQuery" + */ + public function testPropertyExactOnSingleWordQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "alternativesAsExact" + */ + public function testPropertyAlternativesAsExact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "advancedSyntaxFeatures" + */ + public function testPropertyAdvancedSyntaxFeatures() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "distinct" + */ + public function testPropertyDistinct() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "synonyms" + */ + public function testPropertySynonyms() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "replaceSynonymsInHighlight" + */ + public function testPropertyReplaceSynonymsInHighlight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minProximity" + */ + public function testPropertyMinProximity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "responseFields" + */ + public function testPropertyResponseFields() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "maxFacetHits" + */ + public function testPropertyMaxFacetHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributeCriteriaComputedByMinProximity" + */ + public function testPropertyAttributeCriteriaComputedByMinProximity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "renderingContent" + */ + public function testPropertyRenderingContent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/ConsequenceTest.php b/clients/algoliasearch-client-php/test/Model/ConsequenceTest.php new file mode 100644 index 0000000000..1658657d6a --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/ConsequenceTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "params" + */ + public function testPropertyParams() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "promote" + */ + public function testPropertyPromote() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filterPromotes" + */ + public function testPropertyFilterPromotes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hide" + */ + public function testPropertyHide() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userData" + */ + public function testPropertyUserData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/CreatedAtObjectTest.php b/clients/algoliasearch-client-php/test/Model/CreatedAtObjectTest.php new file mode 100644 index 0000000000..7eab966280 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/CreatedAtObjectTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "createdAt" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/CreatedAtResponseTest.php b/clients/algoliasearch-client-php/test/Model/CreatedAtResponseTest.php new file mode 100644 index 0000000000..0610f83020 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/CreatedAtResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "createdAt" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/DeleteApiKeyResponseTest.php b/clients/algoliasearch-client-php/test/Model/DeleteApiKeyResponseTest.php new file mode 100644 index 0000000000..011b0bb637 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/DeleteApiKeyResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "deletedAt" + */ + public function testPropertyDeletedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/DeleteSourceResponseTest.php b/clients/algoliasearch-client-php/test/Model/DeleteSourceResponseTest.php new file mode 100644 index 0000000000..930ae06c6f --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/DeleteSourceResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "deletedAt" + */ + public function testPropertyDeletedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/DeletedAtResponseTest.php b/clients/algoliasearch-client-php/test/Model/DeletedAtResponseTest.php new file mode 100644 index 0000000000..13e6e8c3a3 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/DeletedAtResponseTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "taskID" + */ + public function testPropertyTaskID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "deletedAt" + */ + public function testPropertyDeletedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/DictionaryEntryTest.php b/clients/algoliasearch-client-php/test/Model/DictionaryEntryTest.php new file mode 100644 index 0000000000..ff8610ee29 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/DictionaryEntryTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "objectID" + */ + public function testPropertyObjectID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "language" + */ + public function testPropertyLanguage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "word" + */ + public function testPropertyWord() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "words" + */ + public function testPropertyWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "decomposition" + */ + public function testPropertyDecomposition() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "state" + */ + public function testPropertyState() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/DictionaryLanguageTest.php b/clients/algoliasearch-client-php/test/Model/DictionaryLanguageTest.php new file mode 100644 index 0000000000..751c3e7281 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/DictionaryLanguageTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbCustomEntires" + */ + public function testPropertyNbCustomEntires() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/DictionarySettingsRequestTest.php b/clients/algoliasearch-client-php/test/Model/DictionarySettingsRequestTest.php new file mode 100644 index 0000000000..1575fceab7 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/DictionarySettingsRequestTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disableStandardEntries" + */ + public function testPropertyDisableStandardEntries() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/ErrorBaseTest.php b/clients/algoliasearch-client-php/test/Model/ErrorBaseTest.php new file mode 100644 index 0000000000..b7eb46d7d2 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/ErrorBaseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/GetDictionarySettingsResponseTest.php b/clients/algoliasearch-client-php/test/Model/GetDictionarySettingsResponseTest.php new file mode 100644 index 0000000000..4058bd2603 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/GetDictionarySettingsResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disableStandardEntries" + */ + public function testPropertyDisableStandardEntries() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/GetLogsResponseInnerQueriesTest.php b/clients/algoliasearch-client-php/test/Model/GetLogsResponseInnerQueriesTest.php new file mode 100644 index 0000000000..1c4605d08d --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/GetLogsResponseInnerQueriesTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "indexName" + */ + public function testPropertyIndexName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userToken" + */ + public function testPropertyUserToken() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryId" + */ + public function testPropertyQueryId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/GetLogsResponseLogsTest.php b/clients/algoliasearch-client-php/test/Model/GetLogsResponseLogsTest.php new file mode 100644 index 0000000000..3a216d1b9a --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/GetLogsResponseLogsTest.php @@ -0,0 +1,216 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "timestamp" + */ + public function testPropertyTimestamp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "method" + */ + public function testPropertyMethod() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "answerCode" + */ + public function testPropertyAnswerCode() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryBody" + */ + public function testPropertyQueryBody() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "answer" + */ + public function testPropertyAnswer() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "url" + */ + public function testPropertyUrl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ip" + */ + public function testPropertyIp() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryHeaders" + */ + public function testPropertyQueryHeaders() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sha1" + */ + public function testPropertySha1() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbApiCalls" + */ + public function testPropertyNbApiCalls() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "processingTimeMs" + */ + public function testPropertyProcessingTimeMs() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "index" + */ + public function testPropertyIndex() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryParams" + */ + public function testPropertyQueryParams() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryNbHits" + */ + public function testPropertyQueryNbHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "innerQueries" + */ + public function testPropertyInnerQueries() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/GetLogsResponseTest.php b/clients/algoliasearch-client-php/test/Model/GetLogsResponseTest.php new file mode 100644 index 0000000000..27ce12a519 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/GetLogsResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "logs" + */ + public function testPropertyLogs() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/GetObjectsObjectTest.php b/clients/algoliasearch-client-php/test/Model/GetObjectsObjectTest.php new file mode 100644 index 0000000000..9a8e9d0db1 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/GetObjectsObjectTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "requests" + */ + public function testPropertyRequests() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/GetObjectsResponseTest.php b/clients/algoliasearch-client-php/test/Model/GetObjectsResponseTest.php new file mode 100644 index 0000000000..6f54c31b12 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/GetObjectsResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/GetTaskResponseTest.php b/clients/algoliasearch-client-php/test/Model/GetTaskResponseTest.php new file mode 100644 index 0000000000..5442a862da --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/GetTaskResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "status" + */ + public function testPropertyStatus() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/GetTopUserIdsResponseTest.php b/clients/algoliasearch-client-php/test/Model/GetTopUserIdsResponseTest.php new file mode 100644 index 0000000000..ae31970b27 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/GetTopUserIdsResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "topUsers" + */ + public function testPropertyTopUsers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/HighlightResultTest.php b/clients/algoliasearch-client-php/test/Model/HighlightResultTest.php new file mode 100644 index 0000000000..260a26a6c1 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/HighlightResultTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "matchLevel" + */ + public function testPropertyMatchLevel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "matchedWords" + */ + public function testPropertyMatchedWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fullyHighlighted" + */ + public function testPropertyFullyHighlighted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/IndexSettingsAsSearchParamsTest.php b/clients/algoliasearch-client-php/test/Model/IndexSettingsAsSearchParamsTest.php new file mode 100644 index 0000000000..6ddfc8cd11 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/IndexSettingsAsSearchParamsTest.php @@ -0,0 +1,477 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "searchableAttributes" + */ + public function testPropertySearchableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesForFaceting" + */ + public function testPropertyAttributesForFaceting() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unretrievableAttributes" + */ + public function testPropertyUnretrievableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToRetrieve" + */ + public function testPropertyAttributesToRetrieve() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "restrictSearchableAttributes" + */ + public function testPropertyRestrictSearchableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ranking" + */ + public function testPropertyRanking() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customRanking" + */ + public function testPropertyCustomRanking() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "relevancyStrictness" + */ + public function testPropertyRelevancyStrictness() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToHighlight" + */ + public function testPropertyAttributesToHighlight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToSnippet" + */ + public function testPropertyAttributesToSnippet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "highlightPreTag" + */ + public function testPropertyHighlightPreTag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "highlightPostTag" + */ + public function testPropertyHighlightPostTag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "snippetEllipsisText" + */ + public function testPropertySnippetEllipsisText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "restrictHighlightAndSnippetArrays" + */ + public function testPropertyRestrictHighlightAndSnippetArrays() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hitsPerPage" + */ + public function testPropertyHitsPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minWordSizefor1Typo" + */ + public function testPropertyMinWordSizefor1Typo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minWordSizefor2Typos" + */ + public function testPropertyMinWordSizefor2Typos() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "typoTolerance" + */ + public function testPropertyTypoTolerance() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "allowTyposOnNumericTokens" + */ + public function testPropertyAllowTyposOnNumericTokens() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disableTypoToleranceOnAttributes" + */ + public function testPropertyDisableTypoToleranceOnAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "separatorsToIndex" + */ + public function testPropertySeparatorsToIndex() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ignorePlurals" + */ + public function testPropertyIgnorePlurals() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "removeStopWords" + */ + public function testPropertyRemoveStopWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "keepDiacriticsOnCharacters" + */ + public function testPropertyKeepDiacriticsOnCharacters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryLanguages" + */ + public function testPropertyQueryLanguages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "decompoundQuery" + */ + public function testPropertyDecompoundQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enableRules" + */ + public function testPropertyEnableRules() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enablePersonalization" + */ + public function testPropertyEnablePersonalization() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryType" + */ + public function testPropertyQueryType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "removeWordsIfNoResults" + */ + public function testPropertyRemoveWordsIfNoResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "advancedSyntax" + */ + public function testPropertyAdvancedSyntax() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "optionalWords" + */ + public function testPropertyOptionalWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disableExactOnAttributes" + */ + public function testPropertyDisableExactOnAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exactOnSingleWordQuery" + */ + public function testPropertyExactOnSingleWordQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "alternativesAsExact" + */ + public function testPropertyAlternativesAsExact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "advancedSyntaxFeatures" + */ + public function testPropertyAdvancedSyntaxFeatures() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "distinct" + */ + public function testPropertyDistinct() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "synonyms" + */ + public function testPropertySynonyms() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "replaceSynonymsInHighlight" + */ + public function testPropertyReplaceSynonymsInHighlight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minProximity" + */ + public function testPropertyMinProximity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "responseFields" + */ + public function testPropertyResponseFields() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "maxFacetHits" + */ + public function testPropertyMaxFacetHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributeCriteriaComputedByMinProximity" + */ + public function testPropertyAttributeCriteriaComputedByMinProximity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "renderingContent" + */ + public function testPropertyRenderingContent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/IndexSettingsTest.php b/clients/algoliasearch-client-php/test/Model/IndexSettingsTest.php new file mode 100644 index 0000000000..212b07549e --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/IndexSettingsTest.php @@ -0,0 +1,585 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "replicas" + */ + public function testPropertyReplicas() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "paginationLimitedTo" + */ + public function testPropertyPaginationLimitedTo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disableTypoToleranceOnWords" + */ + public function testPropertyDisableTypoToleranceOnWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToTransliterate" + */ + public function testPropertyAttributesToTransliterate() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "camelCaseAttributes" + */ + public function testPropertyCamelCaseAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "decompoundedAttributes" + */ + public function testPropertyDecompoundedAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "indexLanguages" + */ + public function testPropertyIndexLanguages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filterPromotes" + */ + public function testPropertyFilterPromotes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disablePrefixOnAttributes" + */ + public function testPropertyDisablePrefixOnAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "allowCompressionOfIntegerArray" + */ + public function testPropertyAllowCompressionOfIntegerArray() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "numericAttributesForFiltering" + */ + public function testPropertyNumericAttributesForFiltering() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userData" + */ + public function testPropertyUserData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "searchableAttributes" + */ + public function testPropertySearchableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesForFaceting" + */ + public function testPropertyAttributesForFaceting() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unretrievableAttributes" + */ + public function testPropertyUnretrievableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToRetrieve" + */ + public function testPropertyAttributesToRetrieve() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "restrictSearchableAttributes" + */ + public function testPropertyRestrictSearchableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ranking" + */ + public function testPropertyRanking() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customRanking" + */ + public function testPropertyCustomRanking() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "relevancyStrictness" + */ + public function testPropertyRelevancyStrictness() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToHighlight" + */ + public function testPropertyAttributesToHighlight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToSnippet" + */ + public function testPropertyAttributesToSnippet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "highlightPreTag" + */ + public function testPropertyHighlightPreTag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "highlightPostTag" + */ + public function testPropertyHighlightPostTag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "snippetEllipsisText" + */ + public function testPropertySnippetEllipsisText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "restrictHighlightAndSnippetArrays" + */ + public function testPropertyRestrictHighlightAndSnippetArrays() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hitsPerPage" + */ + public function testPropertyHitsPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minWordSizefor1Typo" + */ + public function testPropertyMinWordSizefor1Typo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minWordSizefor2Typos" + */ + public function testPropertyMinWordSizefor2Typos() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "typoTolerance" + */ + public function testPropertyTypoTolerance() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "allowTyposOnNumericTokens" + */ + public function testPropertyAllowTyposOnNumericTokens() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disableTypoToleranceOnAttributes" + */ + public function testPropertyDisableTypoToleranceOnAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "separatorsToIndex" + */ + public function testPropertySeparatorsToIndex() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ignorePlurals" + */ + public function testPropertyIgnorePlurals() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "removeStopWords" + */ + public function testPropertyRemoveStopWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "keepDiacriticsOnCharacters" + */ + public function testPropertyKeepDiacriticsOnCharacters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryLanguages" + */ + public function testPropertyQueryLanguages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "decompoundQuery" + */ + public function testPropertyDecompoundQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enableRules" + */ + public function testPropertyEnableRules() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enablePersonalization" + */ + public function testPropertyEnablePersonalization() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryType" + */ + public function testPropertyQueryType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "removeWordsIfNoResults" + */ + public function testPropertyRemoveWordsIfNoResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "advancedSyntax" + */ + public function testPropertyAdvancedSyntax() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "optionalWords" + */ + public function testPropertyOptionalWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disableExactOnAttributes" + */ + public function testPropertyDisableExactOnAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exactOnSingleWordQuery" + */ + public function testPropertyExactOnSingleWordQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "alternativesAsExact" + */ + public function testPropertyAlternativesAsExact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "advancedSyntaxFeatures" + */ + public function testPropertyAdvancedSyntaxFeatures() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "distinct" + */ + public function testPropertyDistinct() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "synonyms" + */ + public function testPropertySynonyms() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "replaceSynonymsInHighlight" + */ + public function testPropertyReplaceSynonymsInHighlight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minProximity" + */ + public function testPropertyMinProximity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "responseFields" + */ + public function testPropertyResponseFields() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "maxFacetHits" + */ + public function testPropertyMaxFacetHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributeCriteriaComputedByMinProximity" + */ + public function testPropertyAttributeCriteriaComputedByMinProximity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "renderingContent" + */ + public function testPropertyRenderingContent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/IndexTest.php b/clients/algoliasearch-client-php/test/Model/IndexTest.php new file mode 100644 index 0000000000..8cf50ca632 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/IndexTest.php @@ -0,0 +1,180 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "name" + */ + public function testPropertyName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "createdAt" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updatedAt" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "entries" + */ + public function testPropertyEntries() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "dataSize" + */ + public function testPropertyDataSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "fileSize" + */ + public function testPropertyFileSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "lastBuildTimeS" + */ + public function testPropertyLastBuildTimeS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "numberOfPendingTask" + */ + public function testPropertyNumberOfPendingTask() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "pendingTask" + */ + public function testPropertyPendingTask() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "primary" + */ + public function testPropertyPrimary() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "replicas" + */ + public function testPropertyReplicas() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/KeyObjectTest.php b/clients/algoliasearch-client-php/test/Model/KeyObjectTest.php new file mode 100644 index 0000000000..3682eb0654 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/KeyObjectTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "acl" + */ + public function testPropertyAcl() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "indexes" + */ + public function testPropertyIndexes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "maxHitsPerQuery" + */ + public function testPropertyMaxHitsPerQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "maxQueriesPerIPPerHour" + */ + public function testPropertyMaxQueriesPerIPPerHour() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryParameters" + */ + public function testPropertyQueryParameters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "referers" + */ + public function testPropertyReferers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "validity" + */ + public function testPropertyValidity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "createdAt" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/LanguagesTest.php b/clients/algoliasearch-client-php/test/Model/LanguagesTest.php new file mode 100644 index 0000000000..645649797f --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/LanguagesTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plurals" + */ + public function testPropertyPlurals() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "stopwords" + */ + public function testPropertyStopwords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "compounds" + */ + public function testPropertyCompounds() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/ListApiKeysResponseTest.php b/clients/algoliasearch-client-php/test/Model/ListApiKeysResponseTest.php new file mode 100644 index 0000000000..db3cba6d6e --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/ListApiKeysResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "keys" + */ + public function testPropertyKeys() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/ListClustersResponseTest.php b/clients/algoliasearch-client-php/test/Model/ListClustersResponseTest.php new file mode 100644 index 0000000000..6ee4822861 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/ListClustersResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "topUsers" + */ + public function testPropertyTopUsers() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/ListIndicesResponseTest.php b/clients/algoliasearch-client-php/test/Model/ListIndicesResponseTest.php new file mode 100644 index 0000000000..2ab209f5a5 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/ListIndicesResponseTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "items" + */ + public function testPropertyItems() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbPages" + */ + public function testPropertyNbPages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/ListUserIdsResponseTest.php b/clients/algoliasearch-client-php/test/Model/ListUserIdsResponseTest.php new file mode 100644 index 0000000000..418e0f6e86 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/ListUserIdsResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userIDs" + */ + public function testPropertyUserIDs() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/MultipleBatchResponseTest.php b/clients/algoliasearch-client-php/test/Model/MultipleBatchResponseTest.php new file mode 100644 index 0000000000..9efc6f5b6f --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/MultipleBatchResponseTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "taskID" + */ + public function testPropertyTaskID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "objectIDs" + */ + public function testPropertyObjectIDs() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/MultipleGetObjectsObjectTest.php b/clients/algoliasearch-client-php/test/Model/MultipleGetObjectsObjectTest.php new file mode 100644 index 0000000000..c0933a5acb --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/MultipleGetObjectsObjectTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToRetrieve" + */ + public function testPropertyAttributesToRetrieve() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "objectID" + */ + public function testPropertyObjectID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "indexName" + */ + public function testPropertyIndexName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/MultipleQueriesObjectTest.php b/clients/algoliasearch-client-php/test/Model/MultipleQueriesObjectTest.php new file mode 100644 index 0000000000..132faa342b --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/MultipleQueriesObjectTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "requests" + */ + public function testPropertyRequests() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "strategy" + */ + public function testPropertyStrategy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/MultipleQueriesResponseTest.php b/clients/algoliasearch-client-php/test/Model/MultipleQueriesResponseTest.php new file mode 100644 index 0000000000..c0b3f550fd --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/MultipleQueriesResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "results" + */ + public function testPropertyResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/MultipleQueriesTest.php b/clients/algoliasearch-client-php/test/Model/MultipleQueriesTest.php new file mode 100644 index 0000000000..1f9d54f31d --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/MultipleQueriesTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "indexName" + */ + public function testPropertyIndexName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query" + */ + public function testPropertyQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facet" + */ + public function testPropertyFacet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "params" + */ + public function testPropertyParams() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/OperationIndexObjectTest.php b/clients/algoliasearch-client-php/test/Model/OperationIndexObjectTest.php new file mode 100644 index 0000000000..ff0da8f1ff --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/OperationIndexObjectTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "operation" + */ + public function testPropertyOperation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "destination" + */ + public function testPropertyDestination() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "scope" + */ + public function testPropertyScope() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/OperationTest.php b/clients/algoliasearch-client-php/test/Model/OperationTest.php new file mode 100644 index 0000000000..a452652b6f --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/OperationTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "action" + */ + public function testPropertyAction() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "body" + */ + public function testPropertyBody() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "indexName" + */ + public function testPropertyIndexName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/ParamsTest.php b/clients/algoliasearch-client-php/test/Model/ParamsTest.php new file mode 100644 index 0000000000..5f8524f2de --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/ParamsTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query" + */ + public function testPropertyQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "automaticFacetFilters" + */ + public function testPropertyAutomaticFacetFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "automaticOptionalFacetFilters" + */ + public function testPropertyAutomaticOptionalFacetFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/PromoteTest.php b/clients/algoliasearch-client-php/test/Model/PromoteTest.php new file mode 100644 index 0000000000..3020e84ef5 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/PromoteTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "objectID" + */ + public function testPropertyObjectID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "objectIDs" + */ + public function testPropertyObjectIDs() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "position" + */ + public function testPropertyPosition() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/RankingInfoMatchedGeoLocationTest.php b/clients/algoliasearch-client-php/test/Model/RankingInfoMatchedGeoLocationTest.php new file mode 100644 index 0000000000..af57c0fbb5 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/RankingInfoMatchedGeoLocationTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "lat" + */ + public function testPropertyLat() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "lng" + */ + public function testPropertyLng() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "distance" + */ + public function testPropertyDistance() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/RankingInfoTest.php b/clients/algoliasearch-client-php/test/Model/RankingInfoTest.php new file mode 100644 index 0000000000..78ee973784 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/RankingInfoTest.php @@ -0,0 +1,180 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filters" + */ + public function testPropertyFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "firstMatchedWord" + */ + public function testPropertyFirstMatchedWord() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "geoDistance" + */ + public function testPropertyGeoDistance() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "geoPrecision" + */ + public function testPropertyGeoPrecision() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "matchedGeoLocation" + */ + public function testPropertyMatchedGeoLocation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbExactWords" + */ + public function testPropertyNbExactWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbTypos" + */ + public function testPropertyNbTypos() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "promoted" + */ + public function testPropertyPromoted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "proximityDistance" + */ + public function testPropertyProximityDistance() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userScore" + */ + public function testPropertyUserScore() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "word" + */ + public function testPropertyWord() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/RecordTest.php b/clients/algoliasearch-client-php/test/Model/RecordTest.php new file mode 100644 index 0000000000..7175eed98c --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/RecordTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "objectID" + */ + public function testPropertyObjectID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "highlightResult" + */ + public function testPropertyHighlightResult() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "snippetResult" + */ + public function testPropertySnippetResult() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "rankingInfo" + */ + public function testPropertyRankingInfo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "distinctSeqID" + */ + public function testPropertyDistinctSeqID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/RemoveUserIdResponseTest.php b/clients/algoliasearch-client-php/test/Model/RemoveUserIdResponseTest.php new file mode 100644 index 0000000000..57d1ab1f91 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/RemoveUserIdResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "deletedAt" + */ + public function testPropertyDeletedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/ReplaceSourceResponseTest.php b/clients/algoliasearch-client-php/test/Model/ReplaceSourceResponseTest.php new file mode 100644 index 0000000000..6fa3f74acf --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/ReplaceSourceResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updatedAt" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/RequiredSearchParamsTest.php b/clients/algoliasearch-client-php/test/Model/RequiredSearchParamsTest.php new file mode 100644 index 0000000000..a49251c12a --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/RequiredSearchParamsTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query" + */ + public function testPropertyQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/RuleTest.php b/clients/algoliasearch-client-php/test/Model/RuleTest.php new file mode 100644 index 0000000000..8454bc4904 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/RuleTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "objectID" + */ + public function testPropertyObjectID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "conditions" + */ + public function testPropertyConditions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "consequence" + */ + public function testPropertyConsequence() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enabled" + */ + public function testPropertyEnabled() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "validity" + */ + public function testPropertyValidity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SaveObjectResponseTest.php b/clients/algoliasearch-client-php/test/Model/SaveObjectResponseTest.php new file mode 100644 index 0000000000..eda9d14481 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SaveObjectResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "createdAt" + */ + public function testPropertyCreatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "taskID" + */ + public function testPropertyTaskID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "objectID" + */ + public function testPropertyObjectID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SaveSynonymResponseTest.php b/clients/algoliasearch-client-php/test/Model/SaveSynonymResponseTest.php new file mode 100644 index 0000000000..ab1f8b0fa6 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SaveSynonymResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "taskID" + */ + public function testPropertyTaskID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updatedAt" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "id" + */ + public function testPropertyId() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchDictionaryEntriesTest.php b/clients/algoliasearch-client-php/test/Model/SearchDictionaryEntriesTest.php new file mode 100644 index 0000000000..f5b151f538 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchDictionaryEntriesTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query" + */ + public function testPropertyQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page" + */ + public function testPropertyPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hitsPerPage" + */ + public function testPropertyHitsPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "language" + */ + public function testPropertyLanguage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesRequestTest.php b/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesRequestTest.php new file mode 100644 index 0000000000..0295f90041 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesRequestTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "params" + */ + public function testPropertyParams() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facetQuery" + */ + public function testPropertyFacetQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "maxFacetHits" + */ + public function testPropertyMaxFacetHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseFacetHitsTest.php b/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseFacetHitsTest.php new file mode 100644 index 0000000000..058c95de01 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseFacetHitsTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "highlighted" + */ + public function testPropertyHighlighted() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "count" + */ + public function testPropertyCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseTest.php b/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseTest.php new file mode 100644 index 0000000000..faffdce40b --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facetHits" + */ + public function testPropertyFacetHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchHitsTest.php b/clients/algoliasearch-client-php/test/Model/SearchHitsTest.php new file mode 100644 index 0000000000..011351229a --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchHitsTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hits" + */ + public function testPropertyHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchParamsObjectTest.php b/clients/algoliasearch-client-php/test/Model/SearchParamsObjectTest.php new file mode 100644 index 0000000000..dd0b23f8eb --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchParamsObjectTest.php @@ -0,0 +1,774 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "similarQuery" + */ + public function testPropertySimilarQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filters" + */ + public function testPropertyFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facetFilters" + */ + public function testPropertyFacetFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "optionalFilters" + */ + public function testPropertyOptionalFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "numericFilters" + */ + public function testPropertyNumericFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tagFilters" + */ + public function testPropertyTagFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sumOrFiltersScores" + */ + public function testPropertySumOrFiltersScores() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facets" + */ + public function testPropertyFacets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "maxValuesPerFacet" + */ + public function testPropertyMaxValuesPerFacet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facetingAfterDistinct" + */ + public function testPropertyFacetingAfterDistinct() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sortFacetValuesBy" + */ + public function testPropertySortFacetValuesBy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page" + */ + public function testPropertyPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "offset" + */ + public function testPropertyOffset() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "length" + */ + public function testPropertyLength() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundLatLng" + */ + public function testPropertyAroundLatLng() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundLatLngViaIP" + */ + public function testPropertyAroundLatLngViaIP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundRadius" + */ + public function testPropertyAroundRadius() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundPrecision" + */ + public function testPropertyAroundPrecision() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minimumAroundRadius" + */ + public function testPropertyMinimumAroundRadius() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "insideBoundingBox" + */ + public function testPropertyInsideBoundingBox() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "insidePolygon" + */ + public function testPropertyInsidePolygon() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "naturalLanguages" + */ + public function testPropertyNaturalLanguages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ruleContexts" + */ + public function testPropertyRuleContexts() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "personalizationImpact" + */ + public function testPropertyPersonalizationImpact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userToken" + */ + public function testPropertyUserToken() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "getRankingInfo" + */ + public function testPropertyGetRankingInfo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "clickAnalytics" + */ + public function testPropertyClickAnalytics() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "analytics" + */ + public function testPropertyAnalytics() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "analyticsTags" + */ + public function testPropertyAnalyticsTags() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "percentileComputation" + */ + public function testPropertyPercentileComputation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enableABTest" + */ + public function testPropertyEnableABTest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enableReRanking" + */ + public function testPropertyEnableReRanking() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query" + */ + public function testPropertyQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "searchableAttributes" + */ + public function testPropertySearchableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesForFaceting" + */ + public function testPropertyAttributesForFaceting() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unretrievableAttributes" + */ + public function testPropertyUnretrievableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToRetrieve" + */ + public function testPropertyAttributesToRetrieve() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "restrictSearchableAttributes" + */ + public function testPropertyRestrictSearchableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ranking" + */ + public function testPropertyRanking() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customRanking" + */ + public function testPropertyCustomRanking() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "relevancyStrictness" + */ + public function testPropertyRelevancyStrictness() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToHighlight" + */ + public function testPropertyAttributesToHighlight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToSnippet" + */ + public function testPropertyAttributesToSnippet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "highlightPreTag" + */ + public function testPropertyHighlightPreTag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "highlightPostTag" + */ + public function testPropertyHighlightPostTag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "snippetEllipsisText" + */ + public function testPropertySnippetEllipsisText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "restrictHighlightAndSnippetArrays" + */ + public function testPropertyRestrictHighlightAndSnippetArrays() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hitsPerPage" + */ + public function testPropertyHitsPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minWordSizefor1Typo" + */ + public function testPropertyMinWordSizefor1Typo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minWordSizefor2Typos" + */ + public function testPropertyMinWordSizefor2Typos() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "typoTolerance" + */ + public function testPropertyTypoTolerance() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "allowTyposOnNumericTokens" + */ + public function testPropertyAllowTyposOnNumericTokens() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disableTypoToleranceOnAttributes" + */ + public function testPropertyDisableTypoToleranceOnAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "separatorsToIndex" + */ + public function testPropertySeparatorsToIndex() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ignorePlurals" + */ + public function testPropertyIgnorePlurals() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "removeStopWords" + */ + public function testPropertyRemoveStopWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "keepDiacriticsOnCharacters" + */ + public function testPropertyKeepDiacriticsOnCharacters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryLanguages" + */ + public function testPropertyQueryLanguages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "decompoundQuery" + */ + public function testPropertyDecompoundQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enableRules" + */ + public function testPropertyEnableRules() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enablePersonalization" + */ + public function testPropertyEnablePersonalization() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryType" + */ + public function testPropertyQueryType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "removeWordsIfNoResults" + */ + public function testPropertyRemoveWordsIfNoResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "advancedSyntax" + */ + public function testPropertyAdvancedSyntax() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "optionalWords" + */ + public function testPropertyOptionalWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disableExactOnAttributes" + */ + public function testPropertyDisableExactOnAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exactOnSingleWordQuery" + */ + public function testPropertyExactOnSingleWordQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "alternativesAsExact" + */ + public function testPropertyAlternativesAsExact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "advancedSyntaxFeatures" + */ + public function testPropertyAdvancedSyntaxFeatures() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "distinct" + */ + public function testPropertyDistinct() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "synonyms" + */ + public function testPropertySynonyms() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "replaceSynonymsInHighlight" + */ + public function testPropertyReplaceSynonymsInHighlight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minProximity" + */ + public function testPropertyMinProximity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "responseFields" + */ + public function testPropertyResponseFields() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "maxFacetHits" + */ + public function testPropertyMaxFacetHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributeCriteriaComputedByMinProximity" + */ + public function testPropertyAttributeCriteriaComputedByMinProximity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "renderingContent" + */ + public function testPropertyRenderingContent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchParamsStringTest.php b/clients/algoliasearch-client-php/test/Model/SearchParamsStringTest.php new file mode 100644 index 0000000000..64eff88fe2 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchParamsStringTest.php @@ -0,0 +1,90 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "params" + */ + public function testPropertyParams() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchParamsTest.php b/clients/algoliasearch-client-php/test/Model/SearchParamsTest.php new file mode 100644 index 0000000000..d91122fc85 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchParamsTest.php @@ -0,0 +1,783 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "params" + */ + public function testPropertyParams() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "similarQuery" + */ + public function testPropertySimilarQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "filters" + */ + public function testPropertyFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facetFilters" + */ + public function testPropertyFacetFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "optionalFilters" + */ + public function testPropertyOptionalFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "numericFilters" + */ + public function testPropertyNumericFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "tagFilters" + */ + public function testPropertyTagFilters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sumOrFiltersScores" + */ + public function testPropertySumOrFiltersScores() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facets" + */ + public function testPropertyFacets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "maxValuesPerFacet" + */ + public function testPropertyMaxValuesPerFacet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facetingAfterDistinct" + */ + public function testPropertyFacetingAfterDistinct() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "sortFacetValuesBy" + */ + public function testPropertySortFacetValuesBy() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page" + */ + public function testPropertyPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "offset" + */ + public function testPropertyOffset() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "length" + */ + public function testPropertyLength() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundLatLng" + */ + public function testPropertyAroundLatLng() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundLatLngViaIP" + */ + public function testPropertyAroundLatLngViaIP() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundRadius" + */ + public function testPropertyAroundRadius() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundPrecision" + */ + public function testPropertyAroundPrecision() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minimumAroundRadius" + */ + public function testPropertyMinimumAroundRadius() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "insideBoundingBox" + */ + public function testPropertyInsideBoundingBox() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "insidePolygon" + */ + public function testPropertyInsidePolygon() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "naturalLanguages" + */ + public function testPropertyNaturalLanguages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ruleContexts" + */ + public function testPropertyRuleContexts() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "personalizationImpact" + */ + public function testPropertyPersonalizationImpact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userToken" + */ + public function testPropertyUserToken() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "getRankingInfo" + */ + public function testPropertyGetRankingInfo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "clickAnalytics" + */ + public function testPropertyClickAnalytics() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "analytics" + */ + public function testPropertyAnalytics() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "analyticsTags" + */ + public function testPropertyAnalyticsTags() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "percentileComputation" + */ + public function testPropertyPercentileComputation() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enableABTest" + */ + public function testPropertyEnableABTest() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enableReRanking" + */ + public function testPropertyEnableReRanking() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query" + */ + public function testPropertyQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "searchableAttributes" + */ + public function testPropertySearchableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesForFaceting" + */ + public function testPropertyAttributesForFaceting() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "unretrievableAttributes" + */ + public function testPropertyUnretrievableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToRetrieve" + */ + public function testPropertyAttributesToRetrieve() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "restrictSearchableAttributes" + */ + public function testPropertyRestrictSearchableAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ranking" + */ + public function testPropertyRanking() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "customRanking" + */ + public function testPropertyCustomRanking() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "relevancyStrictness" + */ + public function testPropertyRelevancyStrictness() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToHighlight" + */ + public function testPropertyAttributesToHighlight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributesToSnippet" + */ + public function testPropertyAttributesToSnippet() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "highlightPreTag" + */ + public function testPropertyHighlightPreTag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "highlightPostTag" + */ + public function testPropertyHighlightPostTag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "snippetEllipsisText" + */ + public function testPropertySnippetEllipsisText() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "restrictHighlightAndSnippetArrays" + */ + public function testPropertyRestrictHighlightAndSnippetArrays() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hitsPerPage" + */ + public function testPropertyHitsPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minWordSizefor1Typo" + */ + public function testPropertyMinWordSizefor1Typo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minWordSizefor2Typos" + */ + public function testPropertyMinWordSizefor2Typos() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "typoTolerance" + */ + public function testPropertyTypoTolerance() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "allowTyposOnNumericTokens" + */ + public function testPropertyAllowTyposOnNumericTokens() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disableTypoToleranceOnAttributes" + */ + public function testPropertyDisableTypoToleranceOnAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "separatorsToIndex" + */ + public function testPropertySeparatorsToIndex() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "ignorePlurals" + */ + public function testPropertyIgnorePlurals() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "removeStopWords" + */ + public function testPropertyRemoveStopWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "keepDiacriticsOnCharacters" + */ + public function testPropertyKeepDiacriticsOnCharacters() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryLanguages" + */ + public function testPropertyQueryLanguages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "decompoundQuery" + */ + public function testPropertyDecompoundQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enableRules" + */ + public function testPropertyEnableRules() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enablePersonalization" + */ + public function testPropertyEnablePersonalization() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryType" + */ + public function testPropertyQueryType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "removeWordsIfNoResults" + */ + public function testPropertyRemoveWordsIfNoResults() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "advancedSyntax" + */ + public function testPropertyAdvancedSyntax() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "optionalWords" + */ + public function testPropertyOptionalWords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "disableExactOnAttributes" + */ + public function testPropertyDisableExactOnAttributes() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exactOnSingleWordQuery" + */ + public function testPropertyExactOnSingleWordQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "alternativesAsExact" + */ + public function testPropertyAlternativesAsExact() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "advancedSyntaxFeatures" + */ + public function testPropertyAdvancedSyntaxFeatures() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "distinct" + */ + public function testPropertyDistinct() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "synonyms" + */ + public function testPropertySynonyms() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "replaceSynonymsInHighlight" + */ + public function testPropertyReplaceSynonymsInHighlight() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "minProximity" + */ + public function testPropertyMinProximity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "responseFields" + */ + public function testPropertyResponseFields() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "maxFacetHits" + */ + public function testPropertyMaxFacetHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "attributeCriteriaComputedByMinProximity" + */ + public function testPropertyAttributeCriteriaComputedByMinProximity() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "renderingContent" + */ + public function testPropertyRenderingContent() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchResponseTest.php b/clients/algoliasearch-client-php/test/Model/SearchResponseTest.php new file mode 100644 index 0000000000..0a321de06a --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchResponseTest.php @@ -0,0 +1,306 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "abTestID" + */ + public function testPropertyAbTestID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "abTestVariantID" + */ + public function testPropertyAbTestVariantID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "aroundLatLng" + */ + public function testPropertyAroundLatLng() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "automaticRadius" + */ + public function testPropertyAutomaticRadius() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exhaustiveFacetsCount" + */ + public function testPropertyExhaustiveFacetsCount() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exhaustiveNbHits" + */ + public function testPropertyExhaustiveNbHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "exhaustiveTypo" + */ + public function testPropertyExhaustiveTypo() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facets" + */ + public function testPropertyFacets() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "facetsStats" + */ + public function testPropertyFacetsStats() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hitsPerPage" + */ + public function testPropertyHitsPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "index" + */ + public function testPropertyIndex() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "indexUsed" + */ + public function testPropertyIndexUsed() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "message" + */ + public function testPropertyMessage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbHits" + */ + public function testPropertyNbHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbPages" + */ + public function testPropertyNbPages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbSortedHits" + */ + public function testPropertyNbSortedHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page" + */ + public function testPropertyPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "params" + */ + public function testPropertyParams() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "parsedQuery" + */ + public function testPropertyParsedQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "processingTimeMS" + */ + public function testPropertyProcessingTimeMS() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query" + */ + public function testPropertyQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "queryAfterRemoval" + */ + public function testPropertyQueryAfterRemoval() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "serverUsed" + */ + public function testPropertyServerUsed() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userData" + */ + public function testPropertyUserData() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hits" + */ + public function testPropertyHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchRulesParamsTest.php b/clients/algoliasearch-client-php/test/Model/SearchRulesParamsTest.php new file mode 100644 index 0000000000..2f520848ec --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchRulesParamsTest.php @@ -0,0 +1,144 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query" + */ + public function testPropertyQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "anchoring" + */ + public function testPropertyAnchoring() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "context" + */ + public function testPropertyContext() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page" + */ + public function testPropertyPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hitsPerPage" + */ + public function testPropertyHitsPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "enabled" + */ + public function testPropertyEnabled() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "requestOptions" + */ + public function testPropertyRequestOptions() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchRulesResponseTest.php b/clients/algoliasearch-client-php/test/Model/SearchRulesResponseTest.php new file mode 100644 index 0000000000..0502222350 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchRulesResponseTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hits" + */ + public function testPropertyHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbHits" + */ + public function testPropertyNbHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page" + */ + public function testPropertyPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbPages" + */ + public function testPropertyNbPages() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchSynonymsResponseTest.php b/clients/algoliasearch-client-php/test/Model/SearchSynonymsResponseTest.php new file mode 100644 index 0000000000..7455339a91 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchSynonymsResponseTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hits" + */ + public function testPropertyHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbHits" + */ + public function testPropertyNbHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchUserIdsObjectTest.php b/clients/algoliasearch-client-php/test/Model/SearchUserIdsObjectTest.php new file mode 100644 index 0000000000..94dfb9251b --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchUserIdsObjectTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "query" + */ + public function testPropertyQuery() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "clusterName" + */ + public function testPropertyClusterName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page" + */ + public function testPropertyPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hitsPerPage" + */ + public function testPropertyHitsPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHighlightResultTest.php b/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHighlightResultTest.php new file mode 100644 index 0000000000..f87d6c0030 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHighlightResultTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userID" + */ + public function testPropertyUserID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "clusterName" + */ + public function testPropertyClusterName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHitsTest.php b/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHitsTest.php new file mode 100644 index 0000000000..342971dfd0 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHitsTest.php @@ -0,0 +1,135 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userID" + */ + public function testPropertyUserID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "clusterName" + */ + public function testPropertyClusterName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbRecords" + */ + public function testPropertyNbRecords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "dataSize" + */ + public function testPropertyDataSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "objectID" + */ + public function testPropertyObjectID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "highlightResult" + */ + public function testPropertyHighlightResult() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseTest.php b/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseTest.php new file mode 100644 index 0000000000..41d3af7425 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseTest.php @@ -0,0 +1,126 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hits" + */ + public function testPropertyHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbHits" + */ + public function testPropertyNbHits() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "page" + */ + public function testPropertyPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "hitsPerPage" + */ + public function testPropertyHitsPerPage() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updatedAt" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SnippetResultTest.php b/clients/algoliasearch-client-php/test/Model/SnippetResultTest.php new file mode 100644 index 0000000000..d3d7def9d5 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SnippetResultTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "value" + */ + public function testPropertyValue() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "matchLevel" + */ + public function testPropertyMatchLevel() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SourceTest.php b/clients/algoliasearch-client-php/test/Model/SourceTest.php new file mode 100644 index 0000000000..54d065f546 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SourceTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "source" + */ + public function testPropertySource() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "description" + */ + public function testPropertyDescription() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/StandardEntriesTest.php b/clients/algoliasearch-client-php/test/Model/StandardEntriesTest.php new file mode 100644 index 0000000000..c5ec51b0e4 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/StandardEntriesTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "plurals" + */ + public function testPropertyPlurals() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "stopwords" + */ + public function testPropertyStopwords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "compounds" + */ + public function testPropertyCompounds() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SynonymHitHighlightResultTest.php b/clients/algoliasearch-client-php/test/Model/SynonymHitHighlightResultTest.php new file mode 100644 index 0000000000..1807f5643c --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SynonymHitHighlightResultTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "synonyms" + */ + public function testPropertySynonyms() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/SynonymHitTest.php b/clients/algoliasearch-client-php/test/Model/SynonymHitTest.php new file mode 100644 index 0000000000..c7cee5df9b --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/SynonymHitTest.php @@ -0,0 +1,162 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "objectID" + */ + public function testPropertyObjectID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "type" + */ + public function testPropertyType() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "synonyms" + */ + public function testPropertySynonyms() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "input" + */ + public function testPropertyInput() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "word" + */ + public function testPropertyWord() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "corrections" + */ + public function testPropertyCorrections() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "placeholder" + */ + public function testPropertyPlaceholder() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "replacements" + */ + public function testPropertyReplacements() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "highlightResult" + */ + public function testPropertyHighlightResult() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/TimeRangeTest.php b/clients/algoliasearch-client-php/test/Model/TimeRangeTest.php new file mode 100644 index 0000000000..fc0a3b8006 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/TimeRangeTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "from" + */ + public function testPropertyFrom() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "until" + */ + public function testPropertyUntil() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/UpdateApiKeyResponseTest.php b/clients/algoliasearch-client-php/test/Model/UpdateApiKeyResponseTest.php new file mode 100644 index 0000000000..8e6f3fd056 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/UpdateApiKeyResponseTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "key" + */ + public function testPropertyKey() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updatedAt" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/UpdatedAtResponseTest.php b/clients/algoliasearch-client-php/test/Model/UpdatedAtResponseTest.php new file mode 100644 index 0000000000..8ffc6387c4 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/UpdatedAtResponseTest.php @@ -0,0 +1,99 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "taskID" + */ + public function testPropertyTaskID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updatedAt" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/UpdatedAtWithObjectIdResponseTest.php b/clients/algoliasearch-client-php/test/Model/UpdatedAtWithObjectIdResponseTest.php new file mode 100644 index 0000000000..e7278f7dff --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/UpdatedAtWithObjectIdResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "taskID" + */ + public function testPropertyTaskID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updatedAt" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "objectID" + */ + public function testPropertyObjectID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/UpdatedRuleResponseTest.php b/clients/algoliasearch-client-php/test/Model/UpdatedRuleResponseTest.php new file mode 100644 index 0000000000..2229eff588 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/UpdatedRuleResponseTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "objectID" + */ + public function testPropertyObjectID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "updatedAt" + */ + public function testPropertyUpdatedAt() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "taskID" + */ + public function testPropertyTaskID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/clients/algoliasearch-client-php/test/Model/UserIdTest.php b/clients/algoliasearch-client-php/test/Model/UserIdTest.php new file mode 100644 index 0000000000..8178cd3a16 --- /dev/null +++ b/clients/algoliasearch-client-php/test/Model/UserIdTest.php @@ -0,0 +1,117 @@ +markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "userID" + */ + public function testPropertyUserID() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "clusterName" + */ + public function testPropertyClusterName() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "nbRecords" + */ + public function testPropertyNbRecords() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } + + /** + * Test attribute "dataSize" + */ + public function testPropertyDataSize() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} diff --git a/openapitools.json b/openapitools.json index bcc5c59068..66bc5d33cd 100644 --- a/openapitools.json +++ b/openapitools.json @@ -142,6 +142,7 @@ "gitRepoId": "algoliasearch-client-php", "invokerPackage": "Algolia\\AlgoliaSearch", "additionalProperties": { + "variableNamingConvention": "camelCase" } } } diff --git a/playground/php/composer.json b/playground/php/composer.json new file mode 100644 index 0000000000..de27d2ecc1 --- /dev/null +++ b/playground/php/composer.json @@ -0,0 +1,21 @@ +{ + "name": "playground/php", + "require": { + "php": "^7.3 || ^8.0", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^7.3", + "guzzlehttp/psr7": "^2.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0 || ^9.0", + "friendsofphp/php-cs-fixer": "^2.12" + }, + "autoload": { + "psr-4": { + "Playground\\Php\\": "src/", + "Algolia\\AlgoliaSearch\\": "../../clients/algoliasearch-client-php/lib/" + } + } +} diff --git a/playground/php/composer.lock b/playground/php/composer.lock new file mode 100644 index 0000000000..0ecf4d8069 --- /dev/null +++ b/playground/php/composer.lock @@ -0,0 +1,4755 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "489ac62d82277d983b600fc514962e8f", + "packages": [ + { + "name": "guzzlehttp/guzzle", + "version": "7.4.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79", + "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-curl": "*", + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.4.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2021-12-06T18:43:05+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:56:57+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.1.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2021-10-06T17:43:30+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, + "time": "2020-06-29T06:28:15+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, + "time": "2019-04-30T12:38:16+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-01T23:48:49+00:00" + } + ], + "packages-dev": [ + { + "name": "composer/pcre", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/3d322d715c43a1ac36c7fe215fa59336265500f2", + "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/1.0.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-12-06T15:17:27+00:00" + }, + { + "name": "composer/semver", + "version": "3.2.7", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "deac27056b57e46faf136fae7b449eeaa71661ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/deac27056b57e46faf136fae7b449eeaa71661ee", + "reference": "deac27056b57e46faf136fae7b449eeaa71661ee", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.54", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.2.7" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-01-04T09:57:54+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", + "shasum": "" + }, + "require": { + "composer/pcre": "^1", + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/2.0.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-01-04T17:06:45+00:00" + }, + { + "name": "doctrine/annotations", + "version": "1.13.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "5b668aef16090008790395c02c893b1ba13f7e08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", + "reference": "5b668aef16090008790395c02c893b1ba13f7e08", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "ext-tokenizer": "*", + "php": "^7.1 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" + }, + "require-dev": { + "doctrine/cache": "^1.11 || ^2.0", + "doctrine/coding-standard": "^6.0 || ^8.1", + "phpstan/phpstan": "^0.12.20", + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", + "symfony/cache": "^4.4 || ^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/1.13.2" + }, + "time": "2021-08-05T19:00:23+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-11-10T18:47:58+00:00" + }, + { + "name": "doctrine/lexer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", + "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2020-05-25T17:44:05+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v2.19.3", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", + "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/75ac86f33fab4714ea5a39a396784d83ae3b5ed8", + "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8", + "shasum": "" + }, + "require": { + "composer/semver": "^1.4 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^1.2 || ^2.0", + "doctrine/annotations": "^1.2", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^5.6 || ^7.0 || ^8.0", + "php-cs-fixer/diff": "^1.3", + "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", + "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", + "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", + "symfony/finder": "^3.0 || ^4.0 || ^5.0", + "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", + "symfony/polyfill-php70": "^1.0", + "symfony/polyfill-php72": "^1.4", + "symfony/process": "^3.0 || ^4.0 || ^5.0", + "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" + }, + "require-dev": { + "justinrainbow/json-schema": "^5.0", + "keradus/cli-executor": "^1.4", + "mikey179/vfsstream": "^1.6", + "php-coveralls/php-coveralls": "^2.4.2", + "php-cs-fixer/accessible-object": "^1.0", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", + "phpspec/prophecy-phpunit": "^1.1 || ^2.0", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", + "phpunitgoodpractices/polyfill": "^1.5", + "phpunitgoodpractices/traits": "^1.9.1", + "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", + "symfony/phpunit-bridge": "^5.2.1", + "symfony/yaml": "^3.0 || ^4.0 || ^5.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters.", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", + "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "2.19-dev" + } + }, + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "classmap": [ + "tests/Test/AbstractFixerTestCase.php", + "tests/Test/AbstractIntegrationCaseFactory.php", + "tests/Test/AbstractIntegrationTestCase.php", + "tests/Test/Assert/AssertTokensTrait.php", + "tests/Test/IntegrationCase.php", + "tests/Test/IntegrationCaseFactory.php", + "tests/Test/IntegrationCaseFactoryInterface.php", + "tests/Test/InternalIntegrationCaseFactory.php", + "tests/Test/IsIdenticalConstraint.php", + "tests/Test/TokensWithObservedTransformers.php", + "tests/TestCase.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "support": { + "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.3" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2021-11-15T17:17:55+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.13.2", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + }, + "time": "2021-11-30T19:35:32+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "php-cs-fixer/diff", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", + "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", + "symfony/process": "^3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "SpacePossum" + } + ], + "description": "sebastian/diff v2 backport support for PHP5.6", + "homepage": "https://github.com/PHP-CS-Fixer", + "keywords": [ + "diff" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/diff/issues", + "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" + }, + "time": "2020-10-14T08:39:05+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" + }, + "time": "2022-01-04T19:58:01+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + }, + "time": "2021-12-08T12:19:24+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.13.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-05T09:12:13+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.11", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "2406855036db1102126125537adb1406f7242fdd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2406855036db1102126125537adb1406f7242fdd", + "reference": "2406855036db1102126125537adb1406f7242fdd", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.7", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3.4", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.11" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-25T07:07:57+00:00" + }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", + "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/2.0.0" + }, + "time": "2021-07-14T16:41:46+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-11T14:18:36+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-11T13:31:12+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-15T12:49:02+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "symfony/console", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/a2c6b7ced2eb7799a35375fb9022519282b5405e", + "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-20T16:11:12+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/27d39ae126352b9fa3be5e196ccf4617897be3eb", + "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/event-dispatcher-contracts": "^2|^3", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "symfony/dependency-injection": "<4.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-foundation": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/stopwatch": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T10:19:22+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "aa5422287b75594b90ee9cd807caf8f0df491385" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/aa5422287b75594b90ee9cd807caf8f0df491385", + "reference": "aa5422287b75594b90ee9cd807caf8f0df491385", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-15T12:33:35+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/731f917dc31edcffec2c6a777f3698c33bea8f01", + "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-10-28T13:39:27+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "e77046c252be48c48a40816187ed527703c8f76c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/e77046c252be48c48a40816187ed527703c8f76c", + "reference": "e77046c252be48c48a40816187ed527703c8f76c", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-15T11:06:13+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "b0fb78576487af19c500aaddb269fd36701d4847" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/b0fb78576487af19c500aaddb269fd36701d4847", + "reference": "b0fb78576487af19c500aaddb269fd36701d4847", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php73": "~1.0", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T10:19:22+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "30885182c981ab175d4d034db0f6f469898070ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-10-20T20:35:02+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T21:10:46+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-30T18:21:41+00:00" + }, + { + "name": "symfony/polyfill-php70", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", + "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "metapackage", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", + "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T09:17:38+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-06-05T21:20:04+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-09-13T13:58:33+00:00" + }, + { + "name": "symfony/process", + "version": "v5.4.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "2b3ba8722c4aaf3e88011be5e7f48710088fb5e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/2b3ba8722c4aaf3e88011be5e7f48710088fb5e4", + "reference": "2b3ba8722c4aaf3e88011be5e7f48710088fb5e4", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.4.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-27T21:01:00+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/36715ebf9fb9db73db0cb24263c79077c6fe8603", + "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "psr/container": "^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.0.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-04T17:53:12+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/208ef96122bfed82a8f3a61458a07113a08bdcfe", + "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/service-contracts": "^1|^2|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-23T10:19:22+00:00" + }, + { + "name": "symfony/string", + "version": "v6.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "bae261d0c3ac38a1f802b4dfed42094296100631" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/bae261d0c3ac38a1f802b4dfed42094296100631", + "reference": "bae261d0c3ac38a1f802b4dfed42094296100631", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.0" + }, + "require-dev": { + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.0.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-12-16T22:13:01+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^7.3 || ^8.0", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*" + }, + "platform-dev": [], + "plugin-api-version": "2.1.0" +} diff --git a/playground/php/src/search.php b/playground/php/src/search.php new file mode 100644 index 0000000000..4c99da9049 --- /dev/null +++ b/playground/php/src/search.php @@ -0,0 +1,11 @@ +listIndices()); diff --git a/templates/php/Configuration.mustache b/templates/php/Configuration.mustache index fd316ffee0..563ac5f9b4 100644 --- a/templates/php/Configuration.mustache +++ b/templates/php/Configuration.mustache @@ -107,7 +107,7 @@ class Configuration /** * Constructor */ - public function __construct(string $appId = null, string $algoliaApiKe = null) + public function __construct(string $appId, string $algoliaApiKey = null) { $this->tempFolderPath = sys_get_temp_dir(); @@ -116,6 +116,8 @@ class Configuration $this->setAppId($appId); $this->setApiKey('X-Algolia-Application-Id', $appId); + + $this->setHost("https://{$appId}-1.algolianet.com"); } /** diff --git a/templates/php/api.mustache b/templates/php/api.mustache index 7f966da40a..a611881659 100644 --- a/templates/php/api.mustache +++ b/templates/php/api.mustache @@ -61,21 +61,15 @@ use {{invokerPackage}}\ObjectSerializer; protected $hostIndex; /** - * @param ClientInterface $client - * @param Configuration $config - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + * @param Configuration $config */ - public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 - ) { - $this->client = $client ?: new Client(); + public function __construct(Configuration $config = null) + { $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; + + $this->client = new Client(); + $this->headerSelector = new HeaderSelector(); + $this->hostIndex = 0; } /** @@ -399,14 +393,14 @@ use {{invokerPackage}}\ObjectSerializer; switch($statusCode) { case 200: - if (expectedResponse === '\SplFileObject') { + if ($expectedResponse === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); } return [ - ObjectSerializer::deserialize($content, expectedResponse, []), + ObjectSerializer::deserialize($content, $expectedResponse, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -479,7 +473,7 @@ use {{invokerPackage}}\ObjectSerializer; case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - expectedResponse, + $expectedResponse, $e->getResponseHeaders() ); $e->setResponseObject($data); From 4aea106c895fe6c687b75314d9f68b005aec1734 Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Tue, 11 Jan 2022 16:31:46 +0100 Subject: [PATCH 05/26] feat(php): Remove unwanted files on the php client branch (#79) --- .../.openapi-generator-ignore | 25 +- .../.openapi-generator/FILES | 102 - clients/algoliasearch-client-php/.php_cs | 23 - clients/algoliasearch-client-php/.travis.yml | 9 - clients/algoliasearch-client-php/README.md | 278 -- .../docs/Api/SearchApi.md | 3971 ----------------- .../docs/Model/Action.md | 8 - .../docs/Model/AddApiKeyResponse.md | 10 - .../docs/Model/Anchoring.md | 8 - .../docs/Model/ApiKey.md | 16 - .../docs/Model/AssignUserIdObject.md | 9 - .../docs/Model/AutomaticFacetFilter.md | 11 - .../docs/Model/BaseBrowseResponse.md | 9 - .../docs/Model/BaseIndexSettings.md | 20 - .../docs/Model/BaseSearchParams.md | 40 - .../docs/Model/BaseSearchResponse.md | 32 - .../Model/BaseSearchResponseFacetsStats.md | 12 - .../docs/Model/BatchAssignUserIdsObject.md | 10 - .../docs/Model/BatchDictionaryEntries.md | 10 - .../Model/BatchDictionaryEntriesRequest.md | 10 - .../docs/Model/BatchObject.md | 9 - .../docs/Model/BatchResponse.md | 10 - .../docs/Model/BatchWriteObject.md | 9 - .../docs/Model/BrowseRequest.md | 10 - .../docs/Model/BrowseResponse.md | 34 - .../docs/Model/BuildInOperation.md | 10 - .../docs/Model/Condition.md | 12 - .../docs/Model/Consequence.md | 13 - .../docs/Model/ConsequenceHide.md | 9 - .../docs/Model/ConsequenceParams.md | 87 - .../docs/Model/CreatedAtObject.md | 9 - .../docs/Model/CreatedAtResponse.md | 9 - .../docs/Model/DeleteApiKeyResponse.md | 9 - .../docs/Model/DeleteSourceResponse.md | 9 - .../docs/Model/DeletedAtResponse.md | 10 - .../docs/Model/DictionaryEntry.md | 14 - .../docs/Model/DictionaryLanguage.md | 9 - .../docs/Model/DictionarySettingsRequest.md | 9 - .../docs/Model/ErrorBase.md | 9 - .../Model/GetDictionarySettingsResponse.md | 9 - .../docs/Model/GetLogsResponse.md | 9 - .../docs/Model/GetLogsResponseInnerQueries.md | 11 - .../docs/Model/GetLogsResponseLogs.md | 23 - .../docs/Model/GetObjectsObject.md | 9 - .../docs/Model/GetObjectsResponse.md | 9 - .../docs/Model/GetTaskResponse.md | 9 - .../docs/Model/GetTopUserIdsResponse.md | 9 - .../docs/Model/HighlightResult.md | 12 - .../docs/Model/Index.md | 19 - .../docs/Model/IndexSettings.md | 64 - .../docs/Model/IndexSettingsAsSearchParams.md | 52 - .../docs/Model/KeyObject.md | 17 - .../docs/Model/Languages.md | 11 - .../docs/Model/ListApiKeysResponse.md | 9 - .../docs/Model/ListClustersResponse.md | 9 - .../docs/Model/ListIndicesResponse.md | 10 - .../docs/Model/ListUserIdsResponse.md | 9 - .../docs/Model/MultipleBatchResponse.md | 10 - .../docs/Model/MultipleGetObjectsObject.md | 11 - .../docs/Model/MultipleQueries.md | 13 - .../docs/Model/MultipleQueriesObject.md | 10 - .../docs/Model/MultipleQueriesResponse.md | 9 - .../docs/Model/Operation.md | 11 - .../docs/Model/OperationIndexObject.md | 11 - .../docs/Model/Params.md | 11 - .../docs/Model/Promote.md | 11 - .../docs/Model/RankingInfo.md | 19 - .../Model/RankingInfoMatchedGeoLocation.md | 11 - .../docs/Model/Record.md | 13 - .../docs/Model/RemoveUserIdResponse.md | 9 - .../docs/Model/ReplaceSourceResponse.md | 9 - .../docs/Model/RequiredSearchParams.md | 9 - .../docs/Model/Rule.md | 14 - .../docs/Model/SaveObjectResponse.md | 11 - .../docs/Model/SaveSynonymResponse.md | 11 - .../docs/Model/SearchDictionaryEntries.md | 12 - .../docs/Model/SearchForFacetValuesRequest.md | 11 - .../Model/SearchForFacetValuesResponse.md | 9 - .../SearchForFacetValuesResponseFacetHits.md | 11 - .../docs/Model/SearchHits.md | 9 - .../docs/Model/SearchParams.md | 86 - .../docs/Model/SearchParamsObject.md | 85 - .../docs/Model/SearchParamsString.md | 9 - .../docs/Model/SearchResponse.md | 33 - .../docs/Model/SearchRulesParams.md | 15 - .../docs/Model/SearchRulesResponse.md | 12 - .../docs/Model/SearchSynonymsResponse.md | 10 - .../docs/Model/SearchUserIdsObject.md | 12 - .../docs/Model/SearchUserIdsResponse.md | 13 - .../SearchUserIdsResponseHighlightResult.md | 10 - .../docs/Model/SearchUserIdsResponseHits.md | 14 - .../docs/Model/SnippetResult.md | 10 - .../docs/Model/Source.md | 10 - .../docs/Model/StandardEntries.md | 11 - .../docs/Model/SynonymHit.md | 17 - .../docs/Model/SynonymHitHighlightResult.md | 10 - .../docs/Model/TimeRange.md | 10 - .../docs/Model/UpdateApiKeyResponse.md | 10 - .../docs/Model/UpdatedAtResponse.md | 10 - .../Model/UpdatedAtWithObjectIdResponse.md | 11 - .../docs/Model/UpdatedRuleResponse.md | 11 - .../docs/Model/UserId.md | 12 - clients/algoliasearch-client-php/git_push.sh | 57 - .../lib/Api/SearchApi.php | 85 +- .../lib/ApiException.php | 27 - .../lib/Configuration.php | 27 - .../lib/HeaderSelector.php | 27 - .../lib/Model/Action.php | 28 - .../lib/Model/AddApiKeyResponse.php | 28 - .../lib/Model/Anchoring.php | 28 - .../lib/Model/ApiKey.php | 28 - .../lib/Model/AssignUserIdObject.php | 28 - .../lib/Model/AutomaticFacetFilter.php | 28 - .../lib/Model/BaseBrowseResponse.php | 28 - .../lib/Model/BaseIndexSettings.php | 40 +- .../lib/Model/BaseSearchParams.php | 28 - .../lib/Model/BaseSearchResponse.php | 34 +- .../Model/BaseSearchResponseFacetsStats.php | 28 - .../lib/Model/BatchAssignUserIdsObject.php | 28 - .../lib/Model/BatchDictionaryEntries.php | 28 - .../Model/BatchDictionaryEntriesRequest.php | 28 - .../lib/Model/BatchObject.php | 28 - .../lib/Model/BatchResponse.php | 28 - .../lib/Model/BatchWriteObject.php | 28 - .../lib/Model/BrowseRequest.php | 28 - .../lib/Model/BrowseResponse.php | 34 +- .../lib/Model/BuildInOperation.php | 28 - .../lib/Model/Condition.php | 28 - .../lib/Model/Consequence.php | 34 +- .../lib/Model/ConsequenceHide.php | 28 - .../lib/Model/ConsequenceParams.php | 28 - .../lib/Model/CreatedAtObject.php | 28 - .../lib/Model/CreatedAtResponse.php | 28 - .../lib/Model/DeleteApiKeyResponse.php | 28 - .../lib/Model/DeleteSourceResponse.php | 28 - .../lib/Model/DeletedAtResponse.php | 28 - .../lib/Model/DictionaryEntry.php | 28 - .../lib/Model/DictionaryLanguage.php | 28 - .../lib/Model/DictionarySettingsRequest.php | 28 - .../lib/Model/ErrorBase.php | 28 - .../Model/GetDictionarySettingsResponse.php | 28 - .../lib/Model/GetLogsResponse.php | 28 - .../lib/Model/GetLogsResponseInnerQueries.php | 28 - .../lib/Model/GetLogsResponseLogs.php | 28 - .../lib/Model/GetObjectsObject.php | 28 - .../lib/Model/GetObjectsResponse.php | 34 +- .../lib/Model/GetTaskResponse.php | 28 - .../lib/Model/GetTopUserIdsResponse.php | 28 - .../lib/Model/HighlightResult.php | 28 - .../lib/Model/Index.php | 28 - .../lib/Model/IndexSettings.php | 40 +- .../lib/Model/IndexSettingsAsSearchParams.php | 28 - .../lib/Model/KeyObject.php | 28 - .../lib/Model/Languages.php | 28 - .../lib/Model/ListApiKeysResponse.php | 28 - .../lib/Model/ListClustersResponse.php | 28 - .../lib/Model/ListIndicesResponse.php | 28 - .../lib/Model/ListUserIdsResponse.php | 28 - .../lib/Model/ModelInterface.php | 27 - .../lib/Model/MultipleBatchResponse.php | 34 +- .../lib/Model/MultipleGetObjectsObject.php | 28 - .../lib/Model/MultipleQueries.php | 28 - .../lib/Model/MultipleQueriesObject.php | 28 - .../lib/Model/MultipleQueriesResponse.php | 28 - .../lib/Model/Operation.php | 34 +- .../lib/Model/OperationIndexObject.php | 28 - .../lib/Model/Params.php | 28 - .../lib/Model/Promote.php | 28 - .../lib/Model/RankingInfo.php | 28 - .../Model/RankingInfoMatchedGeoLocation.php | 28 - .../lib/Model/Record.php | 28 - .../lib/Model/RemoveUserIdResponse.php | 28 - .../lib/Model/ReplaceSourceResponse.php | 28 - .../lib/Model/RequiredSearchParams.php | 28 - .../lib/Model/Rule.php | 28 - .../lib/Model/SaveObjectResponse.php | 28 - .../lib/Model/SaveSynonymResponse.php | 28 - .../lib/Model/SearchDictionaryEntries.php | 28 - .../lib/Model/SearchForFacetValuesRequest.php | 28 - .../Model/SearchForFacetValuesResponse.php | 28 - .../SearchForFacetValuesResponseFacetHits.php | 28 - .../lib/Model/SearchHits.php | 28 - .../lib/Model/SearchParams.php | 28 - .../lib/Model/SearchParamsObject.php | 28 - .../lib/Model/SearchParamsString.php | 28 - .../lib/Model/SearchResponse.php | 34 +- .../lib/Model/SearchRulesParams.php | 34 +- .../lib/Model/SearchRulesResponse.php | 28 - .../lib/Model/SearchSynonymsResponse.php | 28 - .../lib/Model/SearchUserIdsObject.php | 28 - .../lib/Model/SearchUserIdsResponse.php | 28 - .../SearchUserIdsResponseHighlightResult.php | 28 - .../lib/Model/SearchUserIdsResponseHits.php | 28 - .../lib/Model/SnippetResult.php | 28 - .../lib/Model/Source.php | 28 - .../lib/Model/StandardEntries.php | 28 - .../lib/Model/SynonymHit.php | 28 - .../lib/Model/SynonymHitHighlightResult.php | 28 - .../lib/Model/TimeRange.php | 28 - .../lib/Model/UpdateApiKeyResponse.php | 28 - .../lib/Model/UpdatedAtResponse.php | 28 - .../Model/UpdatedAtWithObjectIdResponse.php | 28 - .../lib/Model/UpdatedRuleResponse.php | 28 - .../lib/Model/UserId.php | 28 - .../lib/ObjectSerializer.php | 28 - .../algoliasearch-client-php/phpunit.xml.dist | 18 - .../test/Api/SearchApiTest.php | 757 ---- .../test/Model/ActionTest.php | 81 - .../test/Model/AddApiKeyResponseTest.php | 99 - .../test/Model/AnchoringTest.php | 81 - .../test/Model/ApiKeyTest.php | 153 - .../test/Model/AssignUserIdObjectTest.php | 90 - .../test/Model/AutomaticFacetFilterTest.php | 108 - .../test/Model/BaseBrowseResponseTest.php | 90 - .../test/Model/BaseIndexSettingsTest.php | 189 - .../test/Model/BaseSearchParamsTest.php | 369 -- .../BaseSearchResponseFacetsStatsTest.php | 117 - .../test/Model/BaseSearchResponseTest.php | 297 -- .../Model/BatchAssignUserIdsObjectTest.php | 99 - .../BatchDictionaryEntriesRequestTest.php | 99 - .../test/Model/BatchDictionaryEntriesTest.php | 99 - .../test/Model/BatchObjectTest.php | 90 - .../test/Model/BatchResponseTest.php | 99 - .../test/Model/BatchWriteObjectTest.php | 90 - .../test/Model/BrowseRequestTest.php | 99 - .../test/Model/BrowseResponseTest.php | 315 -- .../test/Model/BuildInOperationTest.php | 99 - .../test/Model/ConditionTest.php | 117 - .../test/Model/ConsequenceHideTest.php | 90 - .../test/Model/ConsequenceParamsTest.php | 792 ---- .../test/Model/ConsequenceTest.php | 126 - .../test/Model/CreatedAtObjectTest.php | 90 - .../test/Model/CreatedAtResponseTest.php | 90 - .../test/Model/DeleteApiKeyResponseTest.php | 90 - .../test/Model/DeleteSourceResponseTest.php | 90 - .../test/Model/DeletedAtResponseTest.php | 99 - .../test/Model/DictionaryEntryTest.php | 135 - .../test/Model/DictionaryLanguageTest.php | 90 - .../Model/DictionarySettingsRequestTest.php | 90 - .../test/Model/ErrorBaseTest.php | 90 - .../GetDictionarySettingsResponseTest.php | 90 - .../Model/GetLogsResponseInnerQueriesTest.php | 108 - .../test/Model/GetLogsResponseLogsTest.php | 216 - .../test/Model/GetLogsResponseTest.php | 90 - .../test/Model/GetObjectsObjectTest.php | 90 - .../test/Model/GetObjectsResponseTest.php | 90 - .../test/Model/GetTaskResponseTest.php | 90 - .../test/Model/GetTopUserIdsResponseTest.php | 90 - .../test/Model/HighlightResultTest.php | 117 - .../Model/IndexSettingsAsSearchParamsTest.php | 477 -- .../test/Model/IndexSettingsTest.php | 585 --- .../test/Model/IndexTest.php | 180 - .../test/Model/KeyObjectTest.php | 162 - .../test/Model/LanguagesTest.php | 108 - .../test/Model/ListApiKeysResponseTest.php | 90 - .../test/Model/ListClustersResponseTest.php | 90 - .../test/Model/ListIndicesResponseTest.php | 99 - .../test/Model/ListUserIdsResponseTest.php | 90 - .../test/Model/MultipleBatchResponseTest.php | 99 - .../Model/MultipleGetObjectsObjectTest.php | 108 - .../test/Model/MultipleQueriesObjectTest.php | 99 - .../Model/MultipleQueriesResponseTest.php | 90 - .../test/Model/MultipleQueriesTest.php | 126 - .../test/Model/OperationIndexObjectTest.php | 108 - .../test/Model/OperationTest.php | 108 - .../test/Model/ParamsTest.php | 108 - .../test/Model/PromoteTest.php | 108 - .../RankingInfoMatchedGeoLocationTest.php | 108 - .../test/Model/RankingInfoTest.php | 180 - .../test/Model/RecordTest.php | 126 - .../test/Model/RemoveUserIdResponseTest.php | 90 - .../test/Model/ReplaceSourceResponseTest.php | 90 - .../test/Model/RequiredSearchParamsTest.php | 90 - .../test/Model/RuleTest.php | 135 - .../test/Model/SaveObjectResponseTest.php | 108 - .../test/Model/SaveSynonymResponseTest.php | 108 - .../Model/SearchDictionaryEntriesTest.php | 117 - .../Model/SearchForFacetValuesRequestTest.php | 108 - ...rchForFacetValuesResponseFacetHitsTest.php | 108 - .../SearchForFacetValuesResponseTest.php | 90 - .../test/Model/SearchHitsTest.php | 90 - .../test/Model/SearchParamsObjectTest.php | 774 ---- .../test/Model/SearchParamsStringTest.php | 90 - .../test/Model/SearchParamsTest.php | 783 ---- .../test/Model/SearchResponseTest.php | 306 -- .../test/Model/SearchRulesParamsTest.php | 144 - .../test/Model/SearchRulesResponseTest.php | 117 - .../test/Model/SearchSynonymsResponseTest.php | 99 - .../test/Model/SearchUserIdsObjectTest.php | 117 - ...archUserIdsResponseHighlightResultTest.php | 99 - .../Model/SearchUserIdsResponseHitsTest.php | 135 - .../test/Model/SearchUserIdsResponseTest.php | 126 - .../test/Model/SnippetResultTest.php | 99 - .../test/Model/SourceTest.php | 99 - .../test/Model/StandardEntriesTest.php | 108 - .../Model/SynonymHitHighlightResultTest.php | 99 - .../test/Model/SynonymHitTest.php | 162 - .../test/Model/TimeRangeTest.php | 99 - .../test/Model/UpdateApiKeyResponseTest.php | 99 - .../test/Model/UpdatedAtResponseTest.php | 99 - .../UpdatedAtWithObjectIdResponseTest.php | 108 - .../test/Model/UpdatedRuleResponseTest.php | 108 - .../test/Model/UserIdTest.php | 117 - templates/php/ApiException.mustache | 18 - templates/php/Configuration.mustache | 18 - templates/php/HeaderSelector.mustache | 18 - templates/php/ModelInterface.mustache | 18 - templates/php/ObjectSerializer.mustache | 19 - templates/php/api.mustache | 18 - templates/php/api_test.mustache | 18 - templates/php/model.mustache | 19 - templates/php/model_test.mustache | 19 - 312 files changed, 81 insertions(+), 23879 deletions(-) delete mode 100644 clients/algoliasearch-client-php/.php_cs delete mode 100644 clients/algoliasearch-client-php/.travis.yml delete mode 100644 clients/algoliasearch-client-php/README.md delete mode 100644 clients/algoliasearch-client-php/docs/Api/SearchApi.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/Action.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/AddApiKeyResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/Anchoring.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/ApiKey.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/AssignUserIdObject.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/AutomaticFacetFilter.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/BaseBrowseResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/BaseIndexSettings.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/BaseSearchParams.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/BaseSearchResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/BaseSearchResponseFacetsStats.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/BatchAssignUserIdsObject.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntries.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntriesRequest.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/BatchObject.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/BatchResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/BatchWriteObject.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/BrowseRequest.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/BrowseResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/BuildInOperation.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/Condition.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/Consequence.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/ConsequenceHide.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/ConsequenceParams.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/CreatedAtObject.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/CreatedAtResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/DeleteApiKeyResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/DeleteSourceResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/DeletedAtResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/DictionaryEntry.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/DictionaryLanguage.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/DictionarySettingsRequest.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/ErrorBase.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/GetDictionarySettingsResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/GetLogsResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/GetLogsResponseInnerQueries.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/GetLogsResponseLogs.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/GetObjectsObject.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/GetObjectsResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/GetTaskResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/GetTopUserIdsResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/HighlightResult.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/Index.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/IndexSettings.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/IndexSettingsAsSearchParams.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/KeyObject.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/Languages.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/ListApiKeysResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/ListClustersResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/ListIndicesResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/ListUserIdsResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/MultipleBatchResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/MultipleGetObjectsObject.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/MultipleQueries.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/MultipleQueriesObject.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/MultipleQueriesResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/Operation.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/OperationIndexObject.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/Params.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/Promote.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/RankingInfo.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/RankingInfoMatchedGeoLocation.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/Record.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/RemoveUserIdResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/ReplaceSourceResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/RequiredSearchParams.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/Rule.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SaveObjectResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SaveSynonymResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchDictionaryEntries.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesRequest.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponseFacetHits.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchHits.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchParams.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchParamsObject.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchParamsString.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchRulesParams.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchRulesResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchSynonymsResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchUserIdsObject.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHighlightResult.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHits.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SnippetResult.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/Source.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/StandardEntries.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SynonymHit.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/SynonymHitHighlightResult.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/TimeRange.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/UpdateApiKeyResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/UpdatedAtResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/UpdatedAtWithObjectIdResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/UpdatedRuleResponse.md delete mode 100644 clients/algoliasearch-client-php/docs/Model/UserId.md delete mode 100644 clients/algoliasearch-client-php/git_push.sh delete mode 100644 clients/algoliasearch-client-php/phpunit.xml.dist delete mode 100644 clients/algoliasearch-client-php/test/Api/SearchApiTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/ActionTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/AddApiKeyResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/AnchoringTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/ApiKeyTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/AssignUserIdObjectTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/AutomaticFacetFilterTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/BaseBrowseResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/BaseIndexSettingsTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/BaseSearchParamsTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/BaseSearchResponseFacetsStatsTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/BaseSearchResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/BatchAssignUserIdsObjectTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesRequestTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/BatchObjectTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/BatchResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/BatchWriteObjectTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/BrowseRequestTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/BrowseResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/BuildInOperationTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/ConditionTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/ConsequenceHideTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/ConsequenceParamsTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/ConsequenceTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/CreatedAtObjectTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/CreatedAtResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/DeleteApiKeyResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/DeleteSourceResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/DeletedAtResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/DictionaryEntryTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/DictionaryLanguageTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/DictionarySettingsRequestTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/ErrorBaseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/GetDictionarySettingsResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/GetLogsResponseInnerQueriesTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/GetLogsResponseLogsTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/GetLogsResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/GetObjectsObjectTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/GetObjectsResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/GetTaskResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/GetTopUserIdsResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/HighlightResultTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/IndexSettingsAsSearchParamsTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/IndexSettingsTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/IndexTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/KeyObjectTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/LanguagesTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/ListApiKeysResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/ListClustersResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/ListIndicesResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/ListUserIdsResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/MultipleBatchResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/MultipleGetObjectsObjectTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/MultipleQueriesObjectTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/MultipleQueriesResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/MultipleQueriesTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/OperationIndexObjectTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/OperationTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/ParamsTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/PromoteTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/RankingInfoMatchedGeoLocationTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/RankingInfoTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/RecordTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/RemoveUserIdResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/ReplaceSourceResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/RequiredSearchParamsTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/RuleTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SaveObjectResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SaveSynonymResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchDictionaryEntriesTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchForFacetValuesRequestTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseFacetHitsTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchHitsTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchParamsObjectTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchParamsStringTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchParamsTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchRulesParamsTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchRulesResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchSynonymsResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchUserIdsObjectTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHighlightResultTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHitsTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SnippetResultTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SourceTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/StandardEntriesTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SynonymHitHighlightResultTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/SynonymHitTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/TimeRangeTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/UpdateApiKeyResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/UpdatedAtResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/UpdatedAtWithObjectIdResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/UpdatedRuleResponseTest.php delete mode 100644 clients/algoliasearch-client-php/test/Model/UserIdTest.php diff --git a/clients/algoliasearch-client-php/.openapi-generator-ignore b/clients/algoliasearch-client-php/.openapi-generator-ignore index 7484ee590a..d8c3ddaef1 100644 --- a/clients/algoliasearch-client-php/.openapi-generator-ignore +++ b/clients/algoliasearch-client-php/.openapi-generator-ignore @@ -4,20 +4,11 @@ # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md +docs/** +test/** + +.travis.yml +.php_cs +phpunit.xml.dist +README.md +git_push.sh diff --git a/clients/algoliasearch-client-php/.openapi-generator/FILES b/clients/algoliasearch-client-php/.openapi-generator/FILES index 197db5a5c2..83e22b9826 100644 --- a/clients/algoliasearch-client-php/.openapi-generator/FILES +++ b/clients/algoliasearch-client-php/.openapi-generator/FILES @@ -1,106 +1,5 @@ .gitignore -.php_cs -.travis.yml -README.md composer.json -docs/Api/SearchApi.md -docs/Model/Action.md -docs/Model/AddApiKeyResponse.md -docs/Model/Anchoring.md -docs/Model/ApiKey.md -docs/Model/AssignUserIdObject.md -docs/Model/AutomaticFacetFilter.md -docs/Model/BaseBrowseResponse.md -docs/Model/BaseIndexSettings.md -docs/Model/BaseSearchParams.md -docs/Model/BaseSearchResponse.md -docs/Model/BaseSearchResponseFacetsStats.md -docs/Model/BatchAssignUserIdsObject.md -docs/Model/BatchDictionaryEntries.md -docs/Model/BatchDictionaryEntriesRequest.md -docs/Model/BatchObject.md -docs/Model/BatchResponse.md -docs/Model/BatchWriteObject.md -docs/Model/BrowseRequest.md -docs/Model/BrowseResponse.md -docs/Model/BuildInOperation.md -docs/Model/Condition.md -docs/Model/Consequence.md -docs/Model/ConsequenceHide.md -docs/Model/ConsequenceParams.md -docs/Model/CreatedAtObject.md -docs/Model/CreatedAtResponse.md -docs/Model/DeleteApiKeyResponse.md -docs/Model/DeleteSourceResponse.md -docs/Model/DeletedAtResponse.md -docs/Model/DictionaryEntry.md -docs/Model/DictionaryLanguage.md -docs/Model/DictionarySettingsRequest.md -docs/Model/ErrorBase.md -docs/Model/GetDictionarySettingsResponse.md -docs/Model/GetLogsResponse.md -docs/Model/GetLogsResponseInnerQueries.md -docs/Model/GetLogsResponseLogs.md -docs/Model/GetObjectsObject.md -docs/Model/GetObjectsResponse.md -docs/Model/GetTaskResponse.md -docs/Model/GetTopUserIdsResponse.md -docs/Model/HighlightResult.md -docs/Model/Index.md -docs/Model/IndexSettings.md -docs/Model/IndexSettingsAsSearchParams.md -docs/Model/KeyObject.md -docs/Model/Languages.md -docs/Model/ListApiKeysResponse.md -docs/Model/ListClustersResponse.md -docs/Model/ListIndicesResponse.md -docs/Model/ListUserIdsResponse.md -docs/Model/MultipleBatchResponse.md -docs/Model/MultipleGetObjectsObject.md -docs/Model/MultipleQueries.md -docs/Model/MultipleQueriesObject.md -docs/Model/MultipleQueriesResponse.md -docs/Model/Operation.md -docs/Model/OperationIndexObject.md -docs/Model/Params.md -docs/Model/Promote.md -docs/Model/RankingInfo.md -docs/Model/RankingInfoMatchedGeoLocation.md -docs/Model/Record.md -docs/Model/RemoveUserIdResponse.md -docs/Model/ReplaceSourceResponse.md -docs/Model/RequiredSearchParams.md -docs/Model/Rule.md -docs/Model/SaveObjectResponse.md -docs/Model/SaveSynonymResponse.md -docs/Model/SearchDictionaryEntries.md -docs/Model/SearchForFacetValuesRequest.md -docs/Model/SearchForFacetValuesResponse.md -docs/Model/SearchForFacetValuesResponseFacetHits.md -docs/Model/SearchHits.md -docs/Model/SearchParams.md -docs/Model/SearchParamsObject.md -docs/Model/SearchParamsString.md -docs/Model/SearchResponse.md -docs/Model/SearchRulesParams.md -docs/Model/SearchRulesResponse.md -docs/Model/SearchSynonymsResponse.md -docs/Model/SearchUserIdsObject.md -docs/Model/SearchUserIdsResponse.md -docs/Model/SearchUserIdsResponseHighlightResult.md -docs/Model/SearchUserIdsResponseHits.md -docs/Model/SnippetResult.md -docs/Model/Source.md -docs/Model/StandardEntries.md -docs/Model/SynonymHit.md -docs/Model/SynonymHitHighlightResult.md -docs/Model/TimeRange.md -docs/Model/UpdateApiKeyResponse.md -docs/Model/UpdatedAtResponse.md -docs/Model/UpdatedAtWithObjectIdResponse.md -docs/Model/UpdatedRuleResponse.md -docs/Model/UserId.md -git_push.sh lib/Api/SearchApi.php lib/ApiException.php lib/Configuration.php @@ -203,4 +102,3 @@ lib/Model/UpdatedAtWithObjectIdResponse.php lib/Model/UpdatedRuleResponse.php lib/Model/UserId.php lib/ObjectSerializer.php -phpunit.xml.dist diff --git a/clients/algoliasearch-client-php/.php_cs b/clients/algoliasearch-client-php/.php_cs deleted file mode 100644 index 4fbe53ec5f..0000000000 --- a/clients/algoliasearch-client-php/.php_cs +++ /dev/null @@ -1,23 +0,0 @@ -setUsingCache(true) - ->setRules([ - '@PSR2' => true, - 'ordered_imports' => true, - 'phpdoc_order' => true, - 'array_syntax' => [ 'syntax' => 'short' ], - 'strict_comparison' => true, - 'strict_param' => true, - 'no_trailing_whitespace' => false, - 'no_trailing_whitespace_in_comment' => false, - 'braces' => false, - 'single_blank_line_at_eof' => false, - 'blank_line_after_namespace' => false, - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude('test') - ->exclude('tests') - ->in(__DIR__) - ); diff --git a/clients/algoliasearch-client-php/.travis.yml b/clients/algoliasearch-client-php/.travis.yml deleted file mode 100644 index 714772ee93..0000000000 --- a/clients/algoliasearch-client-php/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: php -# Bionic environment has preinstalled PHP from 7.1 to 7.4 -# https://docs.travis-ci.com/user/reference/bionic/#php-support -dist: bionic -php: - - 7.3 - - 7.4 -before_install: "composer install" -script: "vendor/bin/phpunit" diff --git a/clients/algoliasearch-client-php/README.md b/clients/algoliasearch-client-php/README.md deleted file mode 100644 index fdde69b885..0000000000 --- a/clients/algoliasearch-client-php/README.md +++ /dev/null @@ -1,278 +0,0 @@ -# OpenAPIClient-php - -API powering the Search feature of Algolia. - - -## Installation & Usage - -### Requirements - -PHP 7.3 and later. -Should also work with PHP 8.0 but has not been tested. - -### Composer - -To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: - -```json -{ - "repositories": [ - { - "type": "vcs", - "url": "https://algolia/algolia/algoliasearch-client-php.git" - } - ], - "require": { - "algolia/algoliasearch-client-php": "*@dev" - } -} -``` - -Then run `composer install` - -### Manual Installation - -Download the files and include `autoload.php`: - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$apiKey = new \Algolia\AlgoliaSearch\Model\ApiKey(); // \Algolia\AlgoliaSearch\Model\ApiKey - -try { - $result = $apiInstance->addApiKey($apiKey); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->addApiKey: ', $e->getMessage(), PHP_EOL; -} - -``` - -## API Endpoints - -All URIs are relative to *http://localhost* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SearchApi* | [**addApiKey**](docs/Api/SearchApi.md#addapikey) | **POST** /1/keys | Create a new API key. -*SearchApi* | [**addOrUpdateObject**](docs/Api/SearchApi.md#addorupdateobject) | **PUT** /1/indexes/{indexName}/{objectID} | Add or replace an object with a given object ID. -*SearchApi* | [**appendSource**](docs/Api/SearchApi.md#appendsource) | **POST** /1/security/sources/append | -*SearchApi* | [**assignUserId**](docs/Api/SearchApi.md#assignuserid) | **POST** /1/clusters/mapping | Assign or Move userID -*SearchApi* | [**batch**](docs/Api/SearchApi.md#batch) | **POST** /1/indexes/{indexName}/batch | -*SearchApi* | [**batchAssignUserIds**](docs/Api/SearchApi.md#batchassignuserids) | **POST** /1/clusters/mapping/batch | Batch assign userIDs -*SearchApi* | [**batchDictionaryEntries**](docs/Api/SearchApi.md#batchdictionaryentries) | **POST** /1/dictionaries/{dictionaryName}/batch | Send a batch of dictionary entries. -*SearchApi* | [**batchRules**](docs/Api/SearchApi.md#batchrules) | **POST** /1/indexes/{indexName}/rules/batch | Batch Rules. -*SearchApi* | [**browse**](docs/Api/SearchApi.md#browse) | **POST** /1/indexes/{indexName}/browse | Retrieve all index content. -*SearchApi* | [**clearAllSynonyms**](docs/Api/SearchApi.md#clearallsynonyms) | **POST** /1/indexes/{indexName}/synonyms/clear | Clear all synonyms. -*SearchApi* | [**clearObjects**](docs/Api/SearchApi.md#clearobjects) | **POST** /1/indexes/{indexName}/clear | clear all objects from an index. -*SearchApi* | [**clearRules**](docs/Api/SearchApi.md#clearrules) | **POST** /1/indexes/{indexName}/rules/clear | Clear Rules. -*SearchApi* | [**deleteApiKey**](docs/Api/SearchApi.md#deleteapikey) | **DELETE** /1/keys/{key} | Delete an API key. -*SearchApi* | [**deleteBy**](docs/Api/SearchApi.md#deleteby) | **POST** /1/indexes/{indexName}/deleteByQuery | Delete all records matching the query. -*SearchApi* | [**deleteIndex**](docs/Api/SearchApi.md#deleteindex) | **DELETE** /1/indexes/{indexName} | Delete index. -*SearchApi* | [**deleteObject**](docs/Api/SearchApi.md#deleteobject) | **DELETE** /1/indexes/{indexName}/{objectID} | Delete object. -*SearchApi* | [**deleteRule**](docs/Api/SearchApi.md#deleterule) | **DELETE** /1/indexes/{indexName}/rules/{objectID} | Delete a rule. -*SearchApi* | [**deleteSource**](docs/Api/SearchApi.md#deletesource) | **DELETE** /1/security/sources/{source} | -*SearchApi* | [**deleteSynonym**](docs/Api/SearchApi.md#deletesynonym) | **DELETE** /1/indexes/{indexName}/synonyms/{objectID} | Delete synonym. -*SearchApi* | [**getApiKey**](docs/Api/SearchApi.md#getapikey) | **GET** /1/keys/{key} | Get an API key. -*SearchApi* | [**getDictionaryLanguages**](docs/Api/SearchApi.md#getdictionarylanguages) | **GET** /1/dictionaries/*/languages | List dictionaries supported per language. -*SearchApi* | [**getDictionarySettings**](docs/Api/SearchApi.md#getdictionarysettings) | **GET** /1/dictionaries/*/settings | Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values. -*SearchApi* | [**getLogs**](docs/Api/SearchApi.md#getlogs) | **GET** /1/logs | -*SearchApi* | [**getObject**](docs/Api/SearchApi.md#getobject) | **GET** /1/indexes/{indexName}/{objectID} | Retrieve one object from the index. -*SearchApi* | [**getObjects**](docs/Api/SearchApi.md#getobjects) | **POST** /1/indexes/*/objects | Retrieve one or more objects. -*SearchApi* | [**getRule**](docs/Api/SearchApi.md#getrule) | **GET** /1/indexes/{indexName}/rules/{objectID} | Get a rule. -*SearchApi* | [**getSettings**](docs/Api/SearchApi.md#getsettings) | **GET** /1/indexes/{indexName}/settings | -*SearchApi* | [**getSources**](docs/Api/SearchApi.md#getsources) | **GET** /1/security/sources | -*SearchApi* | [**getSynonym**](docs/Api/SearchApi.md#getsynonym) | **GET** /1/indexes/{indexName}/synonyms/{objectID} | Get synonym. -*SearchApi* | [**getTask**](docs/Api/SearchApi.md#gettask) | **GET** /1/indexes/{indexName}/task/{taskID} | -*SearchApi* | [**getTopUserIds**](docs/Api/SearchApi.md#gettopuserids) | **GET** /1/clusters/mapping/top | Get top userID -*SearchApi* | [**getUserId**](docs/Api/SearchApi.md#getuserid) | **GET** /1/clusters/mapping/{userID} | Get userID -*SearchApi* | [**hasPendingMappings**](docs/Api/SearchApi.md#haspendingmappings) | **GET** /1/clusters/mapping/pending | Has pending mappings -*SearchApi* | [**listApiKeys**](docs/Api/SearchApi.md#listapikeys) | **GET** /1/keys | Get the full list of API Keys. -*SearchApi* | [**listClusters**](docs/Api/SearchApi.md#listclusters) | **GET** /1/clusters | List clusters -*SearchApi* | [**listIndices**](docs/Api/SearchApi.md#listindices) | **GET** /1/indexes | List existing indexes. -*SearchApi* | [**listUserIds**](docs/Api/SearchApi.md#listuserids) | **GET** /1/clusters/mapping | List userIDs -*SearchApi* | [**multipleBatch**](docs/Api/SearchApi.md#multiplebatch) | **POST** /1/indexes/*/batch | -*SearchApi* | [**multipleQueries**](docs/Api/SearchApi.md#multiplequeries) | **POST** /1/indexes/*/queries | -*SearchApi* | [**operationIndex**](docs/Api/SearchApi.md#operationindex) | **POST** /1/indexes/{indexName}/operation | Copy/move index. -*SearchApi* | [**partialUpdateObject**](docs/Api/SearchApi.md#partialupdateobject) | **POST** /1/indexes/{indexName}/{objectID}/partial | Partially update an object. -*SearchApi* | [**removeUserId**](docs/Api/SearchApi.md#removeuserid) | **DELETE** /1/clusters/mapping/{userID} | Remove userID -*SearchApi* | [**replaceSources**](docs/Api/SearchApi.md#replacesources) | **PUT** /1/security/sources | -*SearchApi* | [**restoreApiKey**](docs/Api/SearchApi.md#restoreapikey) | **POST** /1/keys/{key}/restore | Restore an API key. -*SearchApi* | [**saveObject**](docs/Api/SearchApi.md#saveobject) | **POST** /1/indexes/{indexName} | -*SearchApi* | [**saveRule**](docs/Api/SearchApi.md#saverule) | **PUT** /1/indexes/{indexName}/rules/{objectID} | Save/Update a rule. -*SearchApi* | [**saveSynonym**](docs/Api/SearchApi.md#savesynonym) | **PUT** /1/indexes/{indexName}/synonyms/{objectID} | Save synonym. -*SearchApi* | [**saveSynonyms**](docs/Api/SearchApi.md#savesynonyms) | **POST** /1/indexes/{indexName}/synonyms/batch | Save a batch of synonyms. -*SearchApi* | [**search**](docs/Api/SearchApi.md#search) | **POST** /1/indexes/{indexName}/query | -*SearchApi* | [**searchDictionaryEntries**](docs/Api/SearchApi.md#searchdictionaryentries) | **POST** /1/dictionaries/{dictionaryName}/search | Search the dictionary entries. -*SearchApi* | [**searchForFacetValues**](docs/Api/SearchApi.md#searchforfacetvalues) | **POST** /1/indexes/{indexName}/facets/{facetName}/query | Search for values of a given facet -*SearchApi* | [**searchRules**](docs/Api/SearchApi.md#searchrules) | **POST** /1/indexes/{indexName}/rules/search | Search for rules. -*SearchApi* | [**searchSynonyms**](docs/Api/SearchApi.md#searchsynonyms) | **POST** /1/indexes/{indexName}/synonyms/search | Get all synonyms that match a query. -*SearchApi* | [**searchUserIds**](docs/Api/SearchApi.md#searchuserids) | **POST** /1/clusters/mapping/search | Search userID -*SearchApi* | [**setDictionarySettings**](docs/Api/SearchApi.md#setdictionarysettings) | **PUT** /1/dictionaries/*/settings | Set dictionary settings. -*SearchApi* | [**setSettings**](docs/Api/SearchApi.md#setsettings) | **PUT** /1/indexes/{indexName}/settings | -*SearchApi* | [**updateApiKey**](docs/Api/SearchApi.md#updateapikey) | **PUT** /1/keys/{key} | Update an API key. - -## Models - -- [Action](docs/Model/Action.md) -- [AddApiKeyResponse](docs/Model/AddApiKeyResponse.md) -- [Anchoring](docs/Model/Anchoring.md) -- [ApiKey](docs/Model/ApiKey.md) -- [AssignUserIdObject](docs/Model/AssignUserIdObject.md) -- [AutomaticFacetFilter](docs/Model/AutomaticFacetFilter.md) -- [BaseBrowseResponse](docs/Model/BaseBrowseResponse.md) -- [BaseIndexSettings](docs/Model/BaseIndexSettings.md) -- [BaseSearchParams](docs/Model/BaseSearchParams.md) -- [BaseSearchResponse](docs/Model/BaseSearchResponse.md) -- [BaseSearchResponseFacetsStats](docs/Model/BaseSearchResponseFacetsStats.md) -- [BatchAssignUserIdsObject](docs/Model/BatchAssignUserIdsObject.md) -- [BatchDictionaryEntries](docs/Model/BatchDictionaryEntries.md) -- [BatchDictionaryEntriesRequest](docs/Model/BatchDictionaryEntriesRequest.md) -- [BatchObject](docs/Model/BatchObject.md) -- [BatchResponse](docs/Model/BatchResponse.md) -- [BatchWriteObject](docs/Model/BatchWriteObject.md) -- [BrowseRequest](docs/Model/BrowseRequest.md) -- [BrowseResponse](docs/Model/BrowseResponse.md) -- [BuildInOperation](docs/Model/BuildInOperation.md) -- [Condition](docs/Model/Condition.md) -- [Consequence](docs/Model/Consequence.md) -- [ConsequenceHide](docs/Model/ConsequenceHide.md) -- [ConsequenceParams](docs/Model/ConsequenceParams.md) -- [CreatedAtObject](docs/Model/CreatedAtObject.md) -- [CreatedAtResponse](docs/Model/CreatedAtResponse.md) -- [DeleteApiKeyResponse](docs/Model/DeleteApiKeyResponse.md) -- [DeleteSourceResponse](docs/Model/DeleteSourceResponse.md) -- [DeletedAtResponse](docs/Model/DeletedAtResponse.md) -- [DictionaryEntry](docs/Model/DictionaryEntry.md) -- [DictionaryLanguage](docs/Model/DictionaryLanguage.md) -- [DictionarySettingsRequest](docs/Model/DictionarySettingsRequest.md) -- [ErrorBase](docs/Model/ErrorBase.md) -- [GetDictionarySettingsResponse](docs/Model/GetDictionarySettingsResponse.md) -- [GetLogsResponse](docs/Model/GetLogsResponse.md) -- [GetLogsResponseInnerQueries](docs/Model/GetLogsResponseInnerQueries.md) -- [GetLogsResponseLogs](docs/Model/GetLogsResponseLogs.md) -- [GetObjectsObject](docs/Model/GetObjectsObject.md) -- [GetObjectsResponse](docs/Model/GetObjectsResponse.md) -- [GetTaskResponse](docs/Model/GetTaskResponse.md) -- [GetTopUserIdsResponse](docs/Model/GetTopUserIdsResponse.md) -- [HighlightResult](docs/Model/HighlightResult.md) -- [Index](docs/Model/Index.md) -- [IndexSettings](docs/Model/IndexSettings.md) -- [IndexSettingsAsSearchParams](docs/Model/IndexSettingsAsSearchParams.md) -- [KeyObject](docs/Model/KeyObject.md) -- [Languages](docs/Model/Languages.md) -- [ListApiKeysResponse](docs/Model/ListApiKeysResponse.md) -- [ListClustersResponse](docs/Model/ListClustersResponse.md) -- [ListIndicesResponse](docs/Model/ListIndicesResponse.md) -- [ListUserIdsResponse](docs/Model/ListUserIdsResponse.md) -- [MultipleBatchResponse](docs/Model/MultipleBatchResponse.md) -- [MultipleGetObjectsObject](docs/Model/MultipleGetObjectsObject.md) -- [MultipleQueries](docs/Model/MultipleQueries.md) -- [MultipleQueriesObject](docs/Model/MultipleQueriesObject.md) -- [MultipleQueriesResponse](docs/Model/MultipleQueriesResponse.md) -- [Operation](docs/Model/Operation.md) -- [OperationIndexObject](docs/Model/OperationIndexObject.md) -- [Params](docs/Model/Params.md) -- [Promote](docs/Model/Promote.md) -- [RankingInfo](docs/Model/RankingInfo.md) -- [RankingInfoMatchedGeoLocation](docs/Model/RankingInfoMatchedGeoLocation.md) -- [Record](docs/Model/Record.md) -- [RemoveUserIdResponse](docs/Model/RemoveUserIdResponse.md) -- [ReplaceSourceResponse](docs/Model/ReplaceSourceResponse.md) -- [RequiredSearchParams](docs/Model/RequiredSearchParams.md) -- [Rule](docs/Model/Rule.md) -- [SaveObjectResponse](docs/Model/SaveObjectResponse.md) -- [SaveSynonymResponse](docs/Model/SaveSynonymResponse.md) -- [SearchDictionaryEntries](docs/Model/SearchDictionaryEntries.md) -- [SearchForFacetValuesRequest](docs/Model/SearchForFacetValuesRequest.md) -- [SearchForFacetValuesResponse](docs/Model/SearchForFacetValuesResponse.md) -- [SearchForFacetValuesResponseFacetHits](docs/Model/SearchForFacetValuesResponseFacetHits.md) -- [SearchHits](docs/Model/SearchHits.md) -- [SearchParams](docs/Model/SearchParams.md) -- [SearchParamsObject](docs/Model/SearchParamsObject.md) -- [SearchParamsString](docs/Model/SearchParamsString.md) -- [SearchResponse](docs/Model/SearchResponse.md) -- [SearchRulesParams](docs/Model/SearchRulesParams.md) -- [SearchRulesResponse](docs/Model/SearchRulesResponse.md) -- [SearchSynonymsResponse](docs/Model/SearchSynonymsResponse.md) -- [SearchUserIdsObject](docs/Model/SearchUserIdsObject.md) -- [SearchUserIdsResponse](docs/Model/SearchUserIdsResponse.md) -- [SearchUserIdsResponseHighlightResult](docs/Model/SearchUserIdsResponseHighlightResult.md) -- [SearchUserIdsResponseHits](docs/Model/SearchUserIdsResponseHits.md) -- [SnippetResult](docs/Model/SnippetResult.md) -- [Source](docs/Model/Source.md) -- [StandardEntries](docs/Model/StandardEntries.md) -- [SynonymHit](docs/Model/SynonymHit.md) -- [SynonymHitHighlightResult](docs/Model/SynonymHitHighlightResult.md) -- [TimeRange](docs/Model/TimeRange.md) -- [UpdateApiKeyResponse](docs/Model/UpdateApiKeyResponse.md) -- [UpdatedAtResponse](docs/Model/UpdatedAtResponse.md) -- [UpdatedAtWithObjectIdResponse](docs/Model/UpdatedAtWithObjectIdResponse.md) -- [UpdatedRuleResponse](docs/Model/UpdatedRuleResponse.md) -- [UserId](docs/Model/UserId.md) - -## Authorization - -### apiKey - -- **Type**: API key -- **API key parameter name**: X-Algolia-API-Key -- **Location**: HTTP header - - - -### appId - -- **Type**: API key -- **API key parameter name**: X-Algolia-Application-Id -- **Location**: HTTP header - - -## Tests - -To run the tests, use: - -```bash -composer install -vendor/bin/phpunit -``` - -## Author - - - -## About this package - -This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: `0.1.0` -- Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/clients/algoliasearch-client-php/docs/Api/SearchApi.md b/clients/algoliasearch-client-php/docs/Api/SearchApi.md deleted file mode 100644 index 927acfe1e6..0000000000 --- a/clients/algoliasearch-client-php/docs/Api/SearchApi.md +++ /dev/null @@ -1,3971 +0,0 @@ -# Algolia\AlgoliaSearch\SearchApi - -All URIs are relative to http://localhost. - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addApiKey()**](SearchApi.md#addApiKey) | **POST** /1/keys | Create a new API key. -[**addOrUpdateObject()**](SearchApi.md#addOrUpdateObject) | **PUT** /1/indexes/{indexName}/{objectID} | Add or replace an object with a given object ID. -[**appendSource()**](SearchApi.md#appendSource) | **POST** /1/security/sources/append | -[**assignUserId()**](SearchApi.md#assignUserId) | **POST** /1/clusters/mapping | Assign or Move userID -[**batch()**](SearchApi.md#batch) | **POST** /1/indexes/{indexName}/batch | -[**batchAssignUserIds()**](SearchApi.md#batchAssignUserIds) | **POST** /1/clusters/mapping/batch | Batch assign userIDs -[**batchDictionaryEntries()**](SearchApi.md#batchDictionaryEntries) | **POST** /1/dictionaries/{dictionaryName}/batch | Send a batch of dictionary entries. -[**batchRules()**](SearchApi.md#batchRules) | **POST** /1/indexes/{indexName}/rules/batch | Batch Rules. -[**browse()**](SearchApi.md#browse) | **POST** /1/indexes/{indexName}/browse | Retrieve all index content. -[**clearAllSynonyms()**](SearchApi.md#clearAllSynonyms) | **POST** /1/indexes/{indexName}/synonyms/clear | Clear all synonyms. -[**clearObjects()**](SearchApi.md#clearObjects) | **POST** /1/indexes/{indexName}/clear | clear all objects from an index. -[**clearRules()**](SearchApi.md#clearRules) | **POST** /1/indexes/{indexName}/rules/clear | Clear Rules. -[**deleteApiKey()**](SearchApi.md#deleteApiKey) | **DELETE** /1/keys/{key} | Delete an API key. -[**deleteBy()**](SearchApi.md#deleteBy) | **POST** /1/indexes/{indexName}/deleteByQuery | Delete all records matching the query. -[**deleteIndex()**](SearchApi.md#deleteIndex) | **DELETE** /1/indexes/{indexName} | Delete index. -[**deleteObject()**](SearchApi.md#deleteObject) | **DELETE** /1/indexes/{indexName}/{objectID} | Delete object. -[**deleteRule()**](SearchApi.md#deleteRule) | **DELETE** /1/indexes/{indexName}/rules/{objectID} | Delete a rule. -[**deleteSource()**](SearchApi.md#deleteSource) | **DELETE** /1/security/sources/{source} | -[**deleteSynonym()**](SearchApi.md#deleteSynonym) | **DELETE** /1/indexes/{indexName}/synonyms/{objectID} | Delete synonym. -[**getApiKey()**](SearchApi.md#getApiKey) | **GET** /1/keys/{key} | Get an API key. -[**getDictionaryLanguages()**](SearchApi.md#getDictionaryLanguages) | **GET** /1/dictionaries/*/languages | List dictionaries supported per language. -[**getDictionarySettings()**](SearchApi.md#getDictionarySettings) | **GET** /1/dictionaries/*/settings | Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values. -[**getLogs()**](SearchApi.md#getLogs) | **GET** /1/logs | -[**getObject()**](SearchApi.md#getObject) | **GET** /1/indexes/{indexName}/{objectID} | Retrieve one object from the index. -[**getObjects()**](SearchApi.md#getObjects) | **POST** /1/indexes/*/objects | Retrieve one or more objects. -[**getRule()**](SearchApi.md#getRule) | **GET** /1/indexes/{indexName}/rules/{objectID} | Get a rule. -[**getSettings()**](SearchApi.md#getSettings) | **GET** /1/indexes/{indexName}/settings | -[**getSources()**](SearchApi.md#getSources) | **GET** /1/security/sources | -[**getSynonym()**](SearchApi.md#getSynonym) | **GET** /1/indexes/{indexName}/synonyms/{objectID} | Get synonym. -[**getTask()**](SearchApi.md#getTask) | **GET** /1/indexes/{indexName}/task/{taskID} | -[**getTopUserIds()**](SearchApi.md#getTopUserIds) | **GET** /1/clusters/mapping/top | Get top userID -[**getUserId()**](SearchApi.md#getUserId) | **GET** /1/clusters/mapping/{userID} | Get userID -[**hasPendingMappings()**](SearchApi.md#hasPendingMappings) | **GET** /1/clusters/mapping/pending | Has pending mappings -[**listApiKeys()**](SearchApi.md#listApiKeys) | **GET** /1/keys | Get the full list of API Keys. -[**listClusters()**](SearchApi.md#listClusters) | **GET** /1/clusters | List clusters -[**listIndices()**](SearchApi.md#listIndices) | **GET** /1/indexes | List existing indexes. -[**listUserIds()**](SearchApi.md#listUserIds) | **GET** /1/clusters/mapping | List userIDs -[**multipleBatch()**](SearchApi.md#multipleBatch) | **POST** /1/indexes/*/batch | -[**multipleQueries()**](SearchApi.md#multipleQueries) | **POST** /1/indexes/*/queries | -[**operationIndex()**](SearchApi.md#operationIndex) | **POST** /1/indexes/{indexName}/operation | Copy/move index. -[**partialUpdateObject()**](SearchApi.md#partialUpdateObject) | **POST** /1/indexes/{indexName}/{objectID}/partial | Partially update an object. -[**removeUserId()**](SearchApi.md#removeUserId) | **DELETE** /1/clusters/mapping/{userID} | Remove userID -[**replaceSources()**](SearchApi.md#replaceSources) | **PUT** /1/security/sources | -[**restoreApiKey()**](SearchApi.md#restoreApiKey) | **POST** /1/keys/{key}/restore | Restore an API key. -[**saveObject()**](SearchApi.md#saveObject) | **POST** /1/indexes/{indexName} | -[**saveRule()**](SearchApi.md#saveRule) | **PUT** /1/indexes/{indexName}/rules/{objectID} | Save/Update a rule. -[**saveSynonym()**](SearchApi.md#saveSynonym) | **PUT** /1/indexes/{indexName}/synonyms/{objectID} | Save synonym. -[**saveSynonyms()**](SearchApi.md#saveSynonyms) | **POST** /1/indexes/{indexName}/synonyms/batch | Save a batch of synonyms. -[**search()**](SearchApi.md#search) | **POST** /1/indexes/{indexName}/query | -[**searchDictionaryEntries()**](SearchApi.md#searchDictionaryEntries) | **POST** /1/dictionaries/{dictionaryName}/search | Search the dictionary entries. -[**searchForFacetValues()**](SearchApi.md#searchForFacetValues) | **POST** /1/indexes/{indexName}/facets/{facetName}/query | Search for values of a given facet -[**searchRules()**](SearchApi.md#searchRules) | **POST** /1/indexes/{indexName}/rules/search | Search for rules. -[**searchSynonyms()**](SearchApi.md#searchSynonyms) | **POST** /1/indexes/{indexName}/synonyms/search | Get all synonyms that match a query. -[**searchUserIds()**](SearchApi.md#searchUserIds) | **POST** /1/clusters/mapping/search | Search userID -[**setDictionarySettings()**](SearchApi.md#setDictionarySettings) | **PUT** /1/dictionaries/*/settings | Set dictionary settings. -[**setSettings()**](SearchApi.md#setSettings) | **PUT** /1/indexes/{indexName}/settings | -[**updateApiKey()**](SearchApi.md#updateApiKey) | **PUT** /1/keys/{key} | Update an API key. - - -## `addApiKey()` - -```php -addApiKey($apiKey): \Algolia\AlgoliaSearch\Model\AddApiKeyResponse -``` - -Create a new API key. - -Add a new API Key with specific permissions/restrictions. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$apiKey = new \Algolia\AlgoliaSearch\Model\ApiKey(); // \Algolia\AlgoliaSearch\Model\ApiKey - -try { - $result = $apiInstance->addApiKey($apiKey); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->addApiKey: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apiKey** | [**\Algolia\AlgoliaSearch\Model\ApiKey**](../Model/ApiKey.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\AddApiKeyResponse**](../Model/AddApiKeyResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `addOrUpdateObject()` - -```php -addOrUpdateObject($indexName, $objectID, $requestBody): \Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse -``` - -Add or replace an object with a given object ID. - -Add or replace an object with a given object ID. If the object does not exist, it will be created. If it already exists, it will be replaced. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$objectID = 123; // string | Unique identifier of an object. -$requestBody = array('key' => new \stdClass); // array | The Algolia object. - -try { - $result = $apiInstance->addOrUpdateObject($indexName, $objectID, $requestBody); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->addOrUpdateObject: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **objectID** | **string**| Unique identifier of an object. | - **requestBody** | [**array**](../Model/object.md)| The Algolia object. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse**](../Model/UpdatedAtWithObjectIdResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `appendSource()` - -```php -appendSource($source): \Algolia\AlgoliaSearch\Model\CreatedAtResponse -``` - - - -Add a single source to the list of allowed sources. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$source = new \Algolia\AlgoliaSearch\Model\Source(); // \Algolia\AlgoliaSearch\Model\Source | The source to add. - -try { - $result = $apiInstance->appendSource($source); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->appendSource: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **source** | [**\Algolia\AlgoliaSearch\Model\Source**](../Model/Source.md)| The source to add. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\CreatedAtResponse**](../Model/CreatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `assignUserId()` - -```php -assignUserId($xAlgoliaUserID, $assignUserIdObject): \Algolia\AlgoliaSearch\Model\CreatedAtResponse -``` - -Assign or Move userID - -Assign or Move a userID to a cluster. The time it takes to migrate (move) a user is proportional to the amount of data linked to the userID. Upon success, the response is 200 OK. A successful response indicates that the operation has been taken into account, and the userID is directly usable. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$xAlgoliaUserID = new \stdClass; // object | userID to assign. -$assignUserIdObject = new \Algolia\AlgoliaSearch\Model\AssignUserIdObject(); // \Algolia\AlgoliaSearch\Model\AssignUserIdObject - -try { - $result = $apiInstance->assignUserId($xAlgoliaUserID, $assignUserIdObject); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->assignUserId: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xAlgoliaUserID** | [**object**](../Model/.md)| userID to assign. | - **assignUserIdObject** | [**\Algolia\AlgoliaSearch\Model\AssignUserIdObject**](../Model/AssignUserIdObject.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\CreatedAtResponse**](../Model/CreatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `batch()` - -```php -batch($indexName, $batchWriteObject): \Algolia\AlgoliaSearch\Model\BatchResponse -``` - - - -Performs multiple write operations in a single API call. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$batchWriteObject = new \Algolia\AlgoliaSearch\Model\BatchWriteObject(); // \Algolia\AlgoliaSearch\Model\BatchWriteObject - -try { - $result = $apiInstance->batch($indexName, $batchWriteObject); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->batch: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **batchWriteObject** | [**\Algolia\AlgoliaSearch\Model\BatchWriteObject**](../Model/BatchWriteObject.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\BatchResponse**](../Model/BatchResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `batchAssignUserIds()` - -```php -batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject): \Algolia\AlgoliaSearch\Model\CreatedAtResponse -``` - -Batch assign userIDs - -Assign multiple userIDs to a cluster. Upon success, the response is 200 OK. A successful response indicates that the operation has been taken into account, and the userIDs are directly usable. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$xAlgoliaUserID = new \stdClass; // object | userID to assign. -$batchAssignUserIdsObject = new \Algolia\AlgoliaSearch\Model\BatchAssignUserIdsObject(); // \Algolia\AlgoliaSearch\Model\BatchAssignUserIdsObject - -try { - $result = $apiInstance->batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->batchAssignUserIds: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xAlgoliaUserID** | [**object**](../Model/.md)| userID to assign. | - **batchAssignUserIdsObject** | [**\Algolia\AlgoliaSearch\Model\BatchAssignUserIdsObject**](../Model/BatchAssignUserIdsObject.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\CreatedAtResponse**](../Model/CreatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `batchDictionaryEntries()` - -```php -batchDictionaryEntries($dictionaryName, $batchDictionaryEntries): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse -``` - -Send a batch of dictionary entries. - -Send a batch of dictionary entries. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$dictionaryName = 'dictionaryName_example'; // string | The dictionary to search in. -$batchDictionaryEntries = new \Algolia\AlgoliaSearch\Model\BatchDictionaryEntries(); // \Algolia\AlgoliaSearch\Model\BatchDictionaryEntries - -try { - $result = $apiInstance->batchDictionaryEntries($dictionaryName, $batchDictionaryEntries); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->batchDictionaryEntries: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **dictionaryName** | **string**| The dictionary to search in. | - **batchDictionaryEntries** | [**\Algolia\AlgoliaSearch\Model\BatchDictionaryEntries**](../Model/BatchDictionaryEntries.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `batchRules()` - -```php -batchRules($indexName, $rule, $forwardToReplicas, $clearExistingRules): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse -``` - -Batch Rules. - -Create or update a batch of Rules. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$rule = array(new \Algolia\AlgoliaSearch\Model\Rule()); // \Algolia\AlgoliaSearch\Model\Rule[] -$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. -$clearExistingRules = True; // bool | When true, existing Rules are cleared before adding this batch. When false, existing Rules are kept. - -try { - $result = $apiInstance->batchRules($indexName, $rule, $forwardToReplicas, $clearExistingRules); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->batchRules: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **rule** | [**\Algolia\AlgoliaSearch\Model\Rule[]**](../Model/Rule.md)| | - **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] - **clearExistingRules** | **bool**| When true, existing Rules are cleared before adding this batch. When false, existing Rules are kept. | [optional] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `browse()` - -```php -browse($indexName, $browseRequest): \Algolia\AlgoliaSearch\Model\BrowseResponse -``` - -Retrieve all index content. - -This method allows you to retrieve all index content. It can retrieve up to 1,000 records per call and supports full text search and filters. For performance reasons, some features are not supported, including `distinct`, sorting by `typos`, `words` or `geo distance`. When there is more content to be browsed, the response contains a cursor field. This cursor has to be passed to the subsequent call to browse in order to get the next page of results. When the end of the index has been reached, the cursor field is absent from the response. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$browseRequest = new \Algolia\AlgoliaSearch\Model\BrowseRequest(); // \Algolia\AlgoliaSearch\Model\BrowseRequest - -try { - $result = $apiInstance->browse($indexName, $browseRequest); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->browse: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **browseRequest** | [**\Algolia\AlgoliaSearch\Model\BrowseRequest**](../Model/BrowseRequest.md)| | [optional] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\BrowseResponse**](../Model/BrowseResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `clearAllSynonyms()` - -```php -clearAllSynonyms($indexName, $forwardToReplicas): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse -``` - -Clear all synonyms. - -Remove all synonyms from an index. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. - -try { - $result = $apiInstance->clearAllSynonyms($indexName, $forwardToReplicas); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->clearAllSynonyms: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `clearObjects()` - -```php -clearObjects($indexName): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse -``` - -clear all objects from an index. - -Delete an index's content, but leave settings and index-specific API keys untouched. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. - -try { - $result = $apiInstance->clearObjects($indexName); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->clearObjects: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `clearRules()` - -```php -clearRules($indexName, $forwardToReplicas): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse -``` - -Clear Rules. - -Delete all Rules in the index. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. - -try { - $result = $apiInstance->clearRules($indexName, $forwardToReplicas); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->clearRules: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `deleteApiKey()` - -```php -deleteApiKey($key): \Algolia\AlgoliaSearch\Model\DeleteApiKeyResponse -``` - -Delete an API key. - -Delete an existing API Key. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$key = myAPIKey; // string | API Key string. - -try { - $result = $apiInstance->deleteApiKey($key); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->deleteApiKey: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **key** | **string**| API Key string. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\DeleteApiKeyResponse**](../Model/DeleteApiKeyResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `deleteBy()` - -```php -deleteBy($indexName, $searchParams): \Algolia\AlgoliaSearch\Model\DeletedAtResponse -``` - -Delete all records matching the query. - -Remove all objects matching a filter (including geo filters). This method enables you to delete one or more objects based on filters (numeric, facet, tag or geo queries). It doesn't accept empty filters or a query. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$searchParams = new \Algolia\AlgoliaSearch\Model\SearchParams(); // \Algolia\AlgoliaSearch\Model\SearchParams - -try { - $result = $apiInstance->deleteBy($indexName, $searchParams); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->deleteBy: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **searchParams** | [**\Algolia\AlgoliaSearch\Model\SearchParams**](../Model/SearchParams.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\DeletedAtResponse**](../Model/DeletedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `deleteIndex()` - -```php -deleteIndex($indexName): \Algolia\AlgoliaSearch\Model\DeletedAtResponse -``` - -Delete index. - -Delete an existing index. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. - -try { - $result = $apiInstance->deleteIndex($indexName); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->deleteIndex: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\DeletedAtResponse**](../Model/DeletedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `deleteObject()` - -```php -deleteObject($indexName, $objectID): \Algolia\AlgoliaSearch\Model\DeletedAtResponse -``` - -Delete object. - -Delete an existing object. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$objectID = 123; // string | Unique identifier of an object. - -try { - $result = $apiInstance->deleteObject($indexName, $objectID); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->deleteObject: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **objectID** | **string**| Unique identifier of an object. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\DeletedAtResponse**](../Model/DeletedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `deleteRule()` - -```php -deleteRule($indexName, $objectID, $forwardToReplicas): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse -``` - -Delete a rule. - -Delete the Rule with the specified objectID. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$objectID = 123; // string | Unique identifier of an object. -$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. - -try { - $result = $apiInstance->deleteRule($indexName, $objectID, $forwardToReplicas); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->deleteRule: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **objectID** | **string**| Unique identifier of an object. | - **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `deleteSource()` - -```php -deleteSource($source): \Algolia\AlgoliaSearch\Model\DeleteSourceResponse -``` - - - -Remove a single source from the list of allowed sources. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$source = 10.0.0.1/32; // string | The IP range of the source. - -try { - $result = $apiInstance->deleteSource($source); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->deleteSource: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **source** | **string**| The IP range of the source. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\DeleteSourceResponse**](../Model/DeleteSourceResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `deleteSynonym()` - -```php -deleteSynonym($indexName, $objectID, $forwardToReplicas): \Algolia\AlgoliaSearch\Model\DeletedAtResponse -``` - -Delete synonym. - -Delete a single synonyms set, identified by the given objectID. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$objectID = 123; // string | Unique identifier of an object. -$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. - -try { - $result = $apiInstance->deleteSynonym($indexName, $objectID, $forwardToReplicas); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->deleteSynonym: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **objectID** | **string**| Unique identifier of an object. | - **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\DeletedAtResponse**](../Model/DeletedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getApiKey()` - -```php -getApiKey($key): \Algolia\AlgoliaSearch\Model\KeyObject -``` - -Get an API key. - -Get the permissions of an API key. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$key = myAPIKey; // string | API Key string. - -try { - $result = $apiInstance->getApiKey($key); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->getApiKey: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **key** | **string**| API Key string. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\KeyObject**](../Model/KeyObject.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getDictionaryLanguages()` - -```php -getDictionaryLanguages(): array -``` - -List dictionaries supported per language. - -List dictionaries supported per language. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); - -try { - $result = $apiInstance->getDictionaryLanguages(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->getDictionaryLanguages: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**array**](../Model/Languages.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getDictionarySettings()` - -```php -getDictionarySettings(): \Algolia\AlgoliaSearch\Model\GetDictionarySettingsResponse -``` - -Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values. - -Retrieve dictionaries settings. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); - -try { - $result = $apiInstance->getDictionarySettings(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->getDictionarySettings: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**\Algolia\AlgoliaSearch\Model\GetDictionarySettingsResponse**](../Model/GetDictionarySettingsResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getLogs()` - -```php -getLogs($offset, $length, $indexName, $type): \Algolia\AlgoliaSearch\Model\GetLogsResponse -``` - - - -Return the lastest log entries. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$offset = 0; // int | First entry to retrieve (zero-based). Log entries are sorted by decreasing date, therefore 0 designates the most recent log entry. -$length = 10; // int | Maximum number of entries to retrieve. The maximum allowed value is 1000. -$indexName = 'indexName_example'; // string | Index for which log entries should be retrieved. When omitted, log entries are retrieved across all indices. -$type = 'all'; // string | Type of log entries to retrieve. When omitted, all log entries are retrieved. - -try { - $result = $apiInstance->getLogs($offset, $length, $indexName, $type); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->getLogs: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **offset** | **int**| First entry to retrieve (zero-based). Log entries are sorted by decreasing date, therefore 0 designates the most recent log entry. | [optional] [default to 0] - **length** | **int**| Maximum number of entries to retrieve. The maximum allowed value is 1000. | [optional] [default to 10] - **indexName** | **string**| Index for which log entries should be retrieved. When omitted, log entries are retrieved across all indices. | [optional] - **type** | **string**| Type of log entries to retrieve. When omitted, all log entries are retrieved. | [optional] [default to 'all'] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\GetLogsResponse**](../Model/GetLogsResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getObject()` - -```php -getObject($indexName, $objectID, $attributesToRetrieve): array -``` - -Retrieve one object from the index. - -Retrieve one object from the index. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$objectID = 123; // string | Unique identifier of an object. -$attributesToRetrieve = array('attributesToRetrieve_example'); // string[] - -try { - $result = $apiInstance->getObject($indexName, $objectID, $attributesToRetrieve); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->getObject: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **objectID** | **string**| Unique identifier of an object. | - **attributesToRetrieve** | [**string[]**](../Model/string.md)| | [optional] - -### Return type - -**array** - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getObjects()` - -```php -getObjects($getObjectsObject): \Algolia\AlgoliaSearch\Model\GetObjectsResponse -``` - -Retrieve one or more objects. - -Retrieve one or more objects, potentially from different indices, in a single API call. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$getObjectsObject = new \Algolia\AlgoliaSearch\Model\GetObjectsObject(); // \Algolia\AlgoliaSearch\Model\GetObjectsObject - -try { - $result = $apiInstance->getObjects($getObjectsObject); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->getObjects: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **getObjectsObject** | [**\Algolia\AlgoliaSearch\Model\GetObjectsObject**](../Model/GetObjectsObject.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\GetObjectsResponse**](../Model/GetObjectsResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getRule()` - -```php -getRule($indexName, $objectID): \Algolia\AlgoliaSearch\Model\Rule -``` - -Get a rule. - -Retrieve the Rule with the specified objectID. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$objectID = 123; // string | Unique identifier of an object. - -try { - $result = $apiInstance->getRule($indexName, $objectID); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->getRule: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **objectID** | **string**| Unique identifier of an object. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\Rule**](../Model/Rule.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getSettings()` - -```php -getSettings($indexName): \Algolia\AlgoliaSearch\Model\IndexSettings -``` - - - -Retrieve settings of a given indexName. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. - -try { - $result = $apiInstance->getSettings($indexName); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->getSettings: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\IndexSettings**](../Model/IndexSettings.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getSources()` - -```php -getSources(): \Algolia\AlgoliaSearch\Model\Source[] -``` - - - -List all allowed sources. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); - -try { - $result = $apiInstance->getSources(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->getSources: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**\Algolia\AlgoliaSearch\Model\Source[]**](../Model/Source.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getSynonym()` - -```php -getSynonym($indexName, $objectID): \Algolia\AlgoliaSearch\Model\SynonymHit -``` - -Get synonym. - -Fetch a synonym object identified by its objectID. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$objectID = 123; // string | Unique identifier of an object. - -try { - $result = $apiInstance->getSynonym($indexName, $objectID); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->getSynonym: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **objectID** | **string**| Unique identifier of an object. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\SynonymHit**](../Model/SynonymHit.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getTask()` - -```php -getTask($indexName, $taskID): \Algolia\AlgoliaSearch\Model\GetTaskResponse -``` - - - -Check the current status of a given task. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$taskID = 13235; // int | Unique identifier of an task. Numeric value (up to 64bits) - -try { - $result = $apiInstance->getTask($indexName, $taskID); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->getTask: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **taskID** | **int**| Unique identifier of an task. Numeric value (up to 64bits) | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\GetTaskResponse**](../Model/GetTaskResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getTopUserIds()` - -```php -getTopUserIds(): \Algolia\AlgoliaSearch\Model\GetTopUserIdsResponse -``` - -Get top userID - -Get the top 10 userIDs with the highest number of records per cluster. The data returned will usually be a few seconds behind real time, because userID usage may take up to a few seconds to propagate to the different clusters. Upon success, the response is 200 OK and contains the following array of userIDs and clusters. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); - -try { - $result = $apiInstance->getTopUserIds(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->getTopUserIds: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**\Algolia\AlgoliaSearch\Model\GetTopUserIdsResponse**](../Model/GetTopUserIdsResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `getUserId()` - -```php -getUserId($userID): \Algolia\AlgoliaSearch\Model\UserId -``` - -Get userID - -Returns the userID data stored in the mapping. The data returned will usually be a few seconds behind real time, because userID usage may take up to a few seconds to propagate to the different clusters. Upon success, the response is 200 OK and contains the following userID data. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$userID = new \stdClass; // object | userID to assign. - -try { - $result = $apiInstance->getUserId($userID); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->getUserId: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userID** | [**object**](../Model/.md)| userID to assign. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UserId**](../Model/UserId.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `hasPendingMappings()` - -```php -hasPendingMappings($getClusters): \Algolia\AlgoliaSearch\Model\CreatedAtResponse -``` - -Has pending mappings - -Get the status of your clusters' migrations or user creations. Creating a large batch of users or migrating your multi-cluster may take quite some time. This method lets you retrieve the status of the migration, so you can know when it's done. Upon success, the response is 200 OK. A successful response indicates that the operation has been taken into account, and the userIDs are directly usable. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$getClusters = True; // bool - -try { - $result = $apiInstance->hasPendingMappings($getClusters); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->hasPendingMappings: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **getClusters** | **bool**| | [optional] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\CreatedAtResponse**](../Model/CreatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `listApiKeys()` - -```php -listApiKeys(): \Algolia\AlgoliaSearch\Model\ListApiKeysResponse -``` - -Get the full list of API Keys. - -List API keys, along with their associated rights. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); - -try { - $result = $apiInstance->listApiKeys(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->listApiKeys: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**\Algolia\AlgoliaSearch\Model\ListApiKeysResponse**](../Model/ListApiKeysResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `listClusters()` - -```php -listClusters(): \Algolia\AlgoliaSearch\Model\ListClustersResponse -``` - -List clusters - -List the clusters available in a multi-clusters setup for a single appID. Upon success, the response is 200 OK and contains the following clusters. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); - -try { - $result = $apiInstance->listClusters(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->listClusters: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**\Algolia\AlgoliaSearch\Model\ListClustersResponse**](../Model/ListClustersResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `listIndices()` - -```php -listIndices($page): \Algolia\AlgoliaSearch\Model\ListIndicesResponse -``` - -List existing indexes. - -List existing indexes from an application. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$page = 56; // int | Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). - -try { - $result = $apiInstance->listIndices($page); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->listIndices: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page** | **int**| Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). | [optional] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\ListIndicesResponse**](../Model/ListIndicesResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `listUserIds()` - -```php -listUserIds($page, $hitsPerPage): \Algolia\AlgoliaSearch\Model\ListUserIdsResponse -``` - -List userIDs - -List the userIDs assigned to a multi-clusters appID. The data returned will usually be a few seconds behind real time, because userID usage may take up to a few seconds to propagate to the different clusters. Upon success, the response is 200 OK and contains the following userIDs data. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$page = 56; // int | Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). -$hitsPerPage = 100; // int | Maximum number of objects to retrieve. - -try { - $result = $apiInstance->listUserIds($page, $hitsPerPage); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->listUserIds: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **page** | **int**| Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). | [optional] - **hitsPerPage** | **int**| Maximum number of objects to retrieve. | [optional] [default to 100] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\ListUserIdsResponse**](../Model/ListUserIdsResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `multipleBatch()` - -```php -multipleBatch($batchObject): \Algolia\AlgoliaSearch\Model\MultipleBatchResponse -``` - - - -Perform multiple write operations, potentially targeting multiple indices, in a single API call. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$batchObject = new \Algolia\AlgoliaSearch\Model\BatchObject(); // \Algolia\AlgoliaSearch\Model\BatchObject - -try { - $result = $apiInstance->multipleBatch($batchObject); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->multipleBatch: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **batchObject** | [**\Algolia\AlgoliaSearch\Model\BatchObject**](../Model/BatchObject.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\MultipleBatchResponse**](../Model/MultipleBatchResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `multipleQueries()` - -```php -multipleQueries($multipleQueriesObject): \Algolia\AlgoliaSearch\Model\MultipleQueriesResponse -``` - - - -Get search results for the given requests. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$multipleQueriesObject = new \Algolia\AlgoliaSearch\Model\MultipleQueriesObject(); // \Algolia\AlgoliaSearch\Model\MultipleQueriesObject - -try { - $result = $apiInstance->multipleQueries($multipleQueriesObject); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->multipleQueries: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **multipleQueriesObject** | [**\Algolia\AlgoliaSearch\Model\MultipleQueriesObject**](../Model/MultipleQueriesObject.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\MultipleQueriesResponse**](../Model/MultipleQueriesResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `operationIndex()` - -```php -operationIndex($indexName, $operationIndexObject): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse -``` - -Copy/move index. - -Peforms a copy or a move operation on a index. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$operationIndexObject = new \Algolia\AlgoliaSearch\Model\OperationIndexObject(); // \Algolia\AlgoliaSearch\Model\OperationIndexObject - -try { - $result = $apiInstance->operationIndex($indexName, $operationIndexObject); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->operationIndex: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **operationIndexObject** | [**\Algolia\AlgoliaSearch\Model\OperationIndexObject**](../Model/OperationIndexObject.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `partialUpdateObject()` - -```php -partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOperation, $createIfNotExists): \Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse -``` - -Partially update an object. - -Update one or more attributes of an existing object. This method lets you update only a part of an existing object, either by adding new attributes or updating existing ones. You can partially update several objects in a single method call. If the index targeted by this operation doesn't exist yet, it's automatically created. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$objectID = 123; // string | Unique identifier of an object. -$oneOfStringBuildInOperation = NULL; // array[] | The Algolia object. -$createIfNotExists = true; // bool | Creates the record if it does not exist yet. - -try { - $result = $apiInstance->partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOperation, $createIfNotExists); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->partialUpdateObject: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **objectID** | **string**| Unique identifier of an object. | - **oneOfStringBuildInOperation** | [**array[]**](../Model/array.md)| The Algolia object. | - **createIfNotExists** | **bool**| Creates the record if it does not exist yet. | [optional] [default to true] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse**](../Model/UpdatedAtWithObjectIdResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `removeUserId()` - -```php -removeUserId($userID): \Algolia\AlgoliaSearch\Model\RemoveUserIdResponse -``` - -Remove userID - -Remove a userID and its associated data from the multi-clusters. Upon success, the response is 200 OK and a task is created to remove the userID data and mapping. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$userID = new \stdClass; // object | userID to assign. - -try { - $result = $apiInstance->removeUserId($userID); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->removeUserId: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userID** | [**object**](../Model/.md)| userID to assign. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\RemoveUserIdResponse**](../Model/RemoveUserIdResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `replaceSources()` - -```php -replaceSources($source): \Algolia\AlgoliaSearch\Model\ReplaceSourceResponse -``` - - - -Replace all allowed sources. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$source = array(new \Algolia\AlgoliaSearch\Model\Source()); // \Algolia\AlgoliaSearch\Model\Source[] | The sources to allow. - -try { - $result = $apiInstance->replaceSources($source); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->replaceSources: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **source** | [**\Algolia\AlgoliaSearch\Model\Source[]**](../Model/Source.md)| The sources to allow. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\ReplaceSourceResponse**](../Model/ReplaceSourceResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `restoreApiKey()` - -```php -restoreApiKey($key): \Algolia\AlgoliaSearch\Model\AddApiKeyResponse -``` - -Restore an API key. - -Restore a deleted API key, along with its associated rights. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$key = myAPIKey; // string | API Key string. - -try { - $result = $apiInstance->restoreApiKey($key); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->restoreApiKey: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **key** | **string**| API Key string. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\AddApiKeyResponse**](../Model/AddApiKeyResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `saveObject()` - -```php -saveObject($indexName, $requestBody): \Algolia\AlgoliaSearch\Model\SaveObjectResponse -``` - - - -Add an object to the index, automatically assigning it an object ID. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$requestBody = array('key' => new \stdClass); // array | The Algolia object. - -try { - $result = $apiInstance->saveObject($indexName, $requestBody); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->saveObject: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **requestBody** | [**array**](../Model/object.md)| The Algolia object. | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\SaveObjectResponse**](../Model/SaveObjectResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `saveRule()` - -```php -saveRule($indexName, $objectID, $rule, $forwardToReplicas): \Algolia\AlgoliaSearch\Model\UpdatedRuleResponse -``` - -Save/Update a rule. - -Create or update the Rule with the specified objectID. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$objectID = 123; // string | Unique identifier of an object. -$rule = new \Algolia\AlgoliaSearch\Model\Rule(); // \Algolia\AlgoliaSearch\Model\Rule -$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. - -try { - $result = $apiInstance->saveRule($indexName, $objectID, $rule, $forwardToReplicas); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->saveRule: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **objectID** | **string**| Unique identifier of an object. | - **rule** | [**\Algolia\AlgoliaSearch\Model\Rule**](../Model/Rule.md)| | - **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdatedRuleResponse**](../Model/UpdatedRuleResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `saveSynonym()` - -```php -saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplicas): \Algolia\AlgoliaSearch\Model\SaveSynonymResponse -``` - -Save synonym. - -Create a new synonym object or update the existing synonym object with the given object ID. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$objectID = 123; // string | Unique identifier of an object. -$synonymHit = new \Algolia\AlgoliaSearch\Model\SynonymHit(); // \Algolia\AlgoliaSearch\Model\SynonymHit -$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. - -try { - $result = $apiInstance->saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplicas); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->saveSynonym: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **objectID** | **string**| Unique identifier of an object. | - **synonymHit** | [**\Algolia\AlgoliaSearch\Model\SynonymHit**](../Model/SynonymHit.md)| | - **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\SaveSynonymResponse**](../Model/SaveSynonymResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `saveSynonyms()` - -```php -saveSynonyms($indexName, $synonymHit, $forwardToReplicas, $replaceExistingSynonyms): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse -``` - -Save a batch of synonyms. - -Create/update multiple synonym objects at once, potentially replacing the entire list of synonyms if replaceExistingSynonyms is true. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$synonymHit = array(new \Algolia\AlgoliaSearch\Model\SynonymHit()); // \Algolia\AlgoliaSearch\Model\SynonymHit[] -$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. -$replaceExistingSynonyms = True; // bool | Replace all synonyms of the index with the ones sent with this request. - -try { - $result = $apiInstance->saveSynonyms($indexName, $synonymHit, $forwardToReplicas, $replaceExistingSynonyms); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->saveSynonyms: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **synonymHit** | [**\Algolia\AlgoliaSearch\Model\SynonymHit[]**](../Model/SynonymHit.md)| | - **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] - **replaceExistingSynonyms** | **bool**| Replace all synonyms of the index with the ones sent with this request. | [optional] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `search()` - -```php -search($indexName, $searchParams): \Algolia\AlgoliaSearch\Model\SearchResponse -``` - - - -Get search results. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$searchParams = new \Algolia\AlgoliaSearch\Model\SearchParams(); // \Algolia\AlgoliaSearch\Model\SearchParams - -try { - $result = $apiInstance->search($indexName, $searchParams); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->search: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **searchParams** | [**\Algolia\AlgoliaSearch\Model\SearchParams**](../Model/SearchParams.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\SearchResponse**](../Model/SearchResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `searchDictionaryEntries()` - -```php -searchDictionaryEntries($dictionaryName, $searchDictionaryEntries): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse -``` - -Search the dictionary entries. - -Search the dictionary entries. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$dictionaryName = 'dictionaryName_example'; // string | The dictionary to search in. -$searchDictionaryEntries = new \Algolia\AlgoliaSearch\Model\SearchDictionaryEntries(); // \Algolia\AlgoliaSearch\Model\SearchDictionaryEntries - -try { - $result = $apiInstance->searchDictionaryEntries($dictionaryName, $searchDictionaryEntries); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->searchDictionaryEntries: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **dictionaryName** | **string**| The dictionary to search in. | - **searchDictionaryEntries** | [**\Algolia\AlgoliaSearch\Model\SearchDictionaryEntries**](../Model/SearchDictionaryEntries.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `searchForFacetValues()` - -```php -searchForFacetValues($indexName, $facetName, $searchForFacetValuesRequest): \Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponse -``` - -Search for values of a given facet - -Search for values of a given facet, optionally restricting the returned values to those contained in objects matching other search criteria. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$facetName = 'facetName_example'; // string | The facet name. -$searchForFacetValuesRequest = new \Algolia\AlgoliaSearch\Model\SearchForFacetValuesRequest(); // \Algolia\AlgoliaSearch\Model\SearchForFacetValuesRequest - -try { - $result = $apiInstance->searchForFacetValues($indexName, $facetName, $searchForFacetValuesRequest); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->searchForFacetValues: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **facetName** | **string**| The facet name. | - **searchForFacetValuesRequest** | [**\Algolia\AlgoliaSearch\Model\SearchForFacetValuesRequest**](../Model/SearchForFacetValuesRequest.md)| | [optional] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponse**](../Model/SearchForFacetValuesResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `searchRules()` - -```php -searchRules($indexName, $searchRulesParams): \Algolia\AlgoliaSearch\Model\SearchRulesResponse -``` - -Search for rules. - -Search for rules matching various criteria. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$searchRulesParams = new \Algolia\AlgoliaSearch\Model\SearchRulesParams(); // \Algolia\AlgoliaSearch\Model\SearchRulesParams - -try { - $result = $apiInstance->searchRules($indexName, $searchRulesParams); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->searchRules: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **searchRulesParams** | [**\Algolia\AlgoliaSearch\Model\SearchRulesParams**](../Model/SearchRulesParams.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\SearchRulesResponse**](../Model/SearchRulesResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `searchSynonyms()` - -```php -searchSynonyms($indexName, $query, $type, $page, $hitsPerPage): \Algolia\AlgoliaSearch\Model\SearchSynonymsResponse -``` - -Get all synonyms that match a query. - -Search or browse all synonyms, optionally filtering them by type. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$query = ''; // string | Search for specific synonyms matching this string. -$type = 'type_example'; // string | Only search for specific types of synonyms. -$page = 0; // int | Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). -$hitsPerPage = 100; // int | Maximum number of objects to retrieve. - -try { - $result = $apiInstance->searchSynonyms($indexName, $query, $type, $page, $hitsPerPage); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->searchSynonyms: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **query** | **string**| Search for specific synonyms matching this string. | [optional] [default to ''] - **type** | **string**| Only search for specific types of synonyms. | [optional] - **page** | **int**| Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). | [optional] [default to 0] - **hitsPerPage** | **int**| Maximum number of objects to retrieve. | [optional] [default to 100] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\SearchSynonymsResponse**](../Model/SearchSynonymsResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `searchUserIds()` - -```php -searchUserIds($searchUserIdsObject): \Algolia\AlgoliaSearch\Model\SearchUserIdsResponse -``` - -Search userID - -Search for userIDs. The data returned will usually be a few seconds behind real time, because userID usage may take up to a few seconds propagate to the different clusters. To keep updates moving quickly, the index of userIDs isn't built synchronously with the mapping. Instead, the index is built once every 12h, at the same time as the update of userID usage. For example, when you perform a modification like adding or moving a userID, the search will report an outdated value until the next rebuild of the mapping, which takes place every 12h. Upon success, the response is 200 OK and contains the following userIDs data. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$searchUserIdsObject = new \Algolia\AlgoliaSearch\Model\SearchUserIdsObject(); // \Algolia\AlgoliaSearch\Model\SearchUserIdsObject - -try { - $result = $apiInstance->searchUserIds($searchUserIdsObject); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->searchUserIds: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **searchUserIdsObject** | [**\Algolia\AlgoliaSearch\Model\SearchUserIdsObject**](../Model/SearchUserIdsObject.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\SearchUserIdsResponse**](../Model/SearchUserIdsResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `setDictionarySettings()` - -```php -setDictionarySettings($dictionarySettingsRequest): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse -``` - -Set dictionary settings. - -Set dictionary settings. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$dictionarySettingsRequest = new \Algolia\AlgoliaSearch\Model\DictionarySettingsRequest(); // \Algolia\AlgoliaSearch\Model\DictionarySettingsRequest - -try { - $result = $apiInstance->setDictionarySettings($dictionarySettingsRequest); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->setDictionarySettings: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **dictionarySettingsRequest** | [**\Algolia\AlgoliaSearch\Model\DictionarySettingsRequest**](../Model/DictionarySettingsRequest.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `setSettings()` - -```php -setSettings($indexName, $indexSettings, $forwardToReplicas): \Algolia\AlgoliaSearch\Model\UpdatedAtResponse -``` - - - -Update settings of a given indexName. Only specified settings are overridden; unspecified settings are left unchanged. Specifying null for a setting resets it to its default value. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$indexName = myIndexName; // string | The index in which to perform the request. -$indexSettings = new \Algolia\AlgoliaSearch\Model\IndexSettings(); // \Algolia\AlgoliaSearch\Model\IndexSettings -$forwardToReplicas = True; // bool | When true, changes are also propagated to replicas of the given indexName. - -try { - $result = $apiInstance->setSettings($indexName, $indexSettings, $forwardToReplicas); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->setSettings: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **indexName** | **string**| The index in which to perform the request. | - **indexSettings** | [**\Algolia\AlgoliaSearch\Model\IndexSettings**](../Model/IndexSettings.md)| | - **forwardToReplicas** | **bool**| When true, changes are also propagated to replicas of the given indexName. | [optional] - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdatedAtResponse**](../Model/UpdatedAtResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) - -## `updateApiKey()` - -```php -updateApiKey($key, $apiKey): \Algolia\AlgoliaSearch\Model\UpdateApiKeyResponse -``` - -Update an API key. - -Replace every permission of an existing API key. - -### Example - -```php -setApiKey('X-Algolia-API-Key', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-API-Key', 'Bearer'); - -// Configure API key authorization: appId -$config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKey('X-Algolia-Application-Id', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Algolia\AlgoliaSearch\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-Algolia-Application-Id', 'Bearer'); - - -$apiInstance = new Algolia\AlgoliaSearch\Api\SearchApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$key = myAPIKey; // string | API Key string. -$apiKey = new \Algolia\AlgoliaSearch\Model\ApiKey(); // \Algolia\AlgoliaSearch\Model\ApiKey - -try { - $result = $apiInstance->updateApiKey($key, $apiKey); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SearchApi->updateApiKey: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **key** | **string**| API Key string. | - **apiKey** | [**\Algolia\AlgoliaSearch\Model\ApiKey**](../Model/ApiKey.md)| | - -### Return type - -[**\Algolia\AlgoliaSearch\Model\UpdateApiKeyResponse**](../Model/UpdateApiKeyResponse.md) - -### Authorization - -[apiKey](../../README.md#apiKey), [appId](../../README.md#appId) - -### HTTP request headers - -- **Content-Type**: `application/json` -- **Accept**: `application/json` - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Action.md b/clients/algoliasearch-client-php/docs/Model/Action.md deleted file mode 100644 index 20944a88df..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/Action.md +++ /dev/null @@ -1,8 +0,0 @@ -# # Action - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/AddApiKeyResponse.md b/clients/algoliasearch-client-php/docs/Model/AddApiKeyResponse.md deleted file mode 100644 index dc44bb95b5..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/AddApiKeyResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# # AddApiKeyResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**key** | **string** | Key string. | -**createdAt** | **\DateTime** | Date of creation (ISO-8601 format). | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Anchoring.md b/clients/algoliasearch-client-php/docs/Model/Anchoring.md deleted file mode 100644 index 05dfe6abf6..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/Anchoring.md +++ /dev/null @@ -1,8 +0,0 @@ -# # Anchoring - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ApiKey.md b/clients/algoliasearch-client-php/docs/Model/ApiKey.md deleted file mode 100644 index 4c37f19fd1..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/ApiKey.md +++ /dev/null @@ -1,16 +0,0 @@ -# # ApiKey - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**acl** | **string[]** | Set of permissions associated with the key. | -**description** | **string** | A comment used to identify a key more easily in the dashboard. It is not interpreted by the API. | [optional] [default to ''] -**indexes** | **string[]** | Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed. | [optional] -**maxHitsPerQuery** | **int** | Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. | [optional] [default to 0] -**maxQueriesPerIPPerHour** | **int** | Maximum number of API calls per hour allowed from a given IP address or a user token. | [optional] [default to 0] -**queryParameters** | **string** | URL-encoded query string. Force some query parameters to be applied for each query made with this API key. | [optional] [default to ''] -**referers** | **string[]** | Restrict this new API key to specific referers. If empty or blank, defaults to all referers. | [optional] -**validity** | **int** | Validity limit for this key in seconds. The key will automatically be removed after this period of time. | [optional] [default to 0] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/AssignUserIdObject.md b/clients/algoliasearch-client-php/docs/Model/AssignUserIdObject.md deleted file mode 100644 index f80f845e4d..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/AssignUserIdObject.md +++ /dev/null @@ -1,9 +0,0 @@ -# # AssignUserIdObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cluster** | **string** | Name of the cluster. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/AutomaticFacetFilter.md b/clients/algoliasearch-client-php/docs/Model/AutomaticFacetFilter.md deleted file mode 100644 index 8c9839016e..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/AutomaticFacetFilter.md +++ /dev/null @@ -1,11 +0,0 @@ -# # AutomaticFacetFilter - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**facet** | **string** | Attribute to filter on. This must match a facet placeholder in the Rule's pattern. | -**score** | **int** | Score for the filter. Typically used for optional or disjunctive filters. | [optional] [default to 1] -**disjunctive** | **bool** | Whether the filter is disjunctive (true) or conjunctive (false). | [optional] [default to false] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BaseBrowseResponse.md b/clients/algoliasearch-client-php/docs/Model/BaseBrowseResponse.md deleted file mode 100644 index c6a2891c64..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/BaseBrowseResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # BaseBrowseResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cursor** | **string** | Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BaseIndexSettings.md b/clients/algoliasearch-client-php/docs/Model/BaseIndexSettings.md deleted file mode 100644 index 365891b00a..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/BaseIndexSettings.md +++ /dev/null @@ -1,20 +0,0 @@ -# # BaseIndexSettings - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**replicas** | **string[]** | Creates replicas, exact copies of an index. | [optional] -**paginationLimitedTo** | **int** | Set the maximum number of hits accessible via pagination. | [optional] [default to 1000] -**disableTypoToleranceOnWords** | **string[]** | A list of words for which you want to turn off typo tolerance. | [optional] -**attributesToTransliterate** | **string[]** | Specify on which attributes to apply transliteration. | [optional] -**camelCaseAttributes** | **string[]** | List of attributes on which to do a decomposition of camel case words. | [optional] -**decompoundedAttributes** | **array** | Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding. | [optional] -**indexLanguages** | **string[]** | Sets the languages at the index level for language-specific processing such as tokenization and normalization. | [optional] -**filterPromotes** | **bool** | Whether promoted results should match the filters of the current search, except for geographic filters. | [optional] [default to false] -**disablePrefixOnAttributes** | **string[]** | List of attributes on which you want to disable prefix matching. | [optional] -**allowCompressionOfIntegerArray** | **bool** | Enables compression of large integer arrays. | [optional] [default to false] -**numericAttributesForFiltering** | **string[]** | List of numeric attributes that can be used as numerical filters. | [optional] -**userData** | **array** | Lets you store custom data in your indices. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BaseSearchParams.md b/clients/algoliasearch-client-php/docs/Model/BaseSearchParams.md deleted file mode 100644 index 62c616a889..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/BaseSearchParams.md +++ /dev/null @@ -1,40 +0,0 @@ -# # BaseSearchParams - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**similarQuery** | **string** | Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. | [optional] [default to ''] -**filters** | **string** | Filter the query with numeric, facet and/or tag filters. | [optional] [default to ''] -**facetFilters** | **string[]** | Filter hits by facet value. | [optional] -**optionalFilters** | **string[]** | Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. | [optional] -**numericFilters** | **string[]** | Filter on numeric attributes. | [optional] -**tagFilters** | **string[]** | Filter hits by tags. | [optional] -**sumOrFiltersScores** | **bool** | Determines how to calculate the total score for filtering. | [optional] [default to false] -**facets** | **string[]** | Retrieve facets and their facet values. | [optional] -**maxValuesPerFacet** | **int** | Maximum number of facet values to return for each facet during a regular search. | [optional] [default to 100] -**facetingAfterDistinct** | **bool** | Force faceting to be applied after de-duplication (via the Distinct setting). | [optional] [default to false] -**sortFacetValuesBy** | **string** | Controls how facet values are fetched. | [optional] [default to 'count'] -**page** | **int** | Specify the page to retrieve. | [optional] [default to 0] -**offset** | **int** | Specify the offset of the first hit to return. | [optional] -**length** | **int** | Set the number of hits to retrieve (used only with offset). | [optional] -**aroundLatLng** | **string** | Search for entries around a central geolocation, enabling a geo search within a circular area. | [optional] [default to ''] -**aroundLatLngViaIP** | **bool** | Search for entries around a given location automatically computed from the requester's IP address. | [optional] [default to false] -**aroundRadius** | [**OneOfIntegerString**](OneOfIntegerString.md) | Define the maximum radius for a geo search (in meters). | [optional] -**aroundPrecision** | **int** | Precision of geo search (in meters), to add grouping by geo location to the ranking formula. | [optional] [default to 10] -**minimumAroundRadius** | **int** | Minimum radius (in meters) used for a geo search when aroundRadius is not set. | [optional] -**insideBoundingBox** | **float[]** | Search inside a rectangular area (in geo coordinates). | [optional] -**insidePolygon** | **float[]** | Search inside a polygon (in geo coordinates). | [optional] -**naturalLanguages** | **string[]** | This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. | [optional] -**ruleContexts** | **string[]** | Enables contextual rules. | [optional] -**personalizationImpact** | **int** | Define the impact of the Personalization feature. | [optional] [default to 100] -**userToken** | **string** | Associates a certain user token with the current search. | [optional] -**getRankingInfo** | **bool** | Retrieve detailed ranking information. | [optional] [default to false] -**clickAnalytics** | **bool** | Enable the Click Analytics feature. | [optional] [default to false] -**analytics** | **bool** | Whether the current query will be taken into account in the Analytics. | [optional] [default to true] -**analyticsTags** | **string[]** | List of tags to apply to the query for analytics purposes. | [optional] -**percentileComputation** | **bool** | Whether to include or exclude a query from the processing-time percentile computation. | [optional] [default to true] -**enableABTest** | **bool** | Whether this search should participate in running AB tests. | [optional] [default to true] -**enableReRanking** | **bool** | Whether this search should use AI Re-Ranking. | [optional] [default to true] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BaseSearchResponse.md b/clients/algoliasearch-client-php/docs/Model/BaseSearchResponse.md deleted file mode 100644 index c3785c4563..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/BaseSearchResponse.md +++ /dev/null @@ -1,32 +0,0 @@ -# # BaseSearchResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**abTestID** | **int** | If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID. | [optional] -**abTestVariantID** | **int** | If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used. | [optional] -**aroundLatLng** | **string** | The computed geo location. | [optional] -**automaticRadius** | **string** | The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. | [optional] -**exhaustiveFacetsCount** | **bool** | Whether the facet count is exhaustive or approximate. | [optional] -**exhaustiveNbHits** | **bool** | Indicate if the nbHits count was exhaustive or approximate | -**exhaustiveTypo** | **bool** | Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) | -**facets** | **array>** | A mapping of each facet name to the corresponding facet counts. | [optional] -**facetsStats** | [**array**](BaseSearchResponseFacetsStats.md) | Statistics for numerical facets. | [optional] -**hitsPerPage** | **int** | Set the number of hits per page. | [default to 20] -**index** | **string** | Index name used for the query. | [optional] -**indexUsed** | **string** | Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. | [optional] -**message** | **string** | Used to return warnings about the query. | [optional] -**nbHits** | **int** | Number of hits that the search query matched. | -**nbPages** | **int** | Number of pages available for the current query | -**nbSortedHits** | **int** | The number of hits selected and sorted by the relevant sort algorithm | [optional] -**page** | **int** | Specify the page to retrieve. | [default to 0] -**params** | **string** | A url-encoded string of all search parameters. | -**parsedQuery** | **string** | The query string that will be searched, after normalization. | [optional] -**processingTimeMS** | **int** | Time the server took to process the request, in milliseconds. | -**query** | **string** | The text to search in the index. | [default to ''] -**queryAfterRemoval** | **string** | A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. | [optional] -**serverUsed** | **string** | Actual host name of the server that processed the request. | [optional] -**userData** | **array** | Lets you store custom data in your indices. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BaseSearchResponseFacetsStats.md b/clients/algoliasearch-client-php/docs/Model/BaseSearchResponseFacetsStats.md deleted file mode 100644 index b7e8d1fbeb..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/BaseSearchResponseFacetsStats.md +++ /dev/null @@ -1,12 +0,0 @@ -# # BaseSearchResponseFacetsStats - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**min** | **int** | The minimum value in the result set. | [optional] -**max** | **int** | The maximum value in the result set. | [optional] -**avg** | **int** | The average facet value in the result set. | [optional] -**sum** | **int** | The sum of all values in the result set. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BatchAssignUserIdsObject.md b/clients/algoliasearch-client-php/docs/Model/BatchAssignUserIdsObject.md deleted file mode 100644 index a0c4f91756..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/BatchAssignUserIdsObject.md +++ /dev/null @@ -1,10 +0,0 @@ -# # BatchAssignUserIdsObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cluster** | **string** | Name of the cluster. | -**users** | **string[]** | userIDs to assign. Note you cannot move users with this method. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntries.md b/clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntries.md deleted file mode 100644 index ba997c56e8..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntries.md +++ /dev/null @@ -1,10 +0,0 @@ -# # BatchDictionaryEntries - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**clearExistingDictionaryEntries** | **bool** | When `true`, start the batch by removing all the custom entries from the dictionary. | [optional] [default to false] -**requests** | [**\Algolia\AlgoliaSearch\Model\BatchDictionaryEntriesRequest[]**](BatchDictionaryEntriesRequest.md) | List of operations to batch. Each operation is described by an `action` and a `body`. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntriesRequest.md b/clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntriesRequest.md deleted file mode 100644 index b963945028..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/BatchDictionaryEntriesRequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# # BatchDictionaryEntriesRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**action** | **string** | Actions to perform. | -**body** | [**\Algolia\AlgoliaSearch\Model\DictionaryEntry**](DictionaryEntry.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BatchObject.md b/clients/algoliasearch-client-php/docs/Model/BatchObject.md deleted file mode 100644 index bb6546224c..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/BatchObject.md +++ /dev/null @@ -1,9 +0,0 @@ -# # BatchObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**requests** | [**\Algolia\AlgoliaSearch\Model\Operation[]**](Operation.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BatchResponse.md b/clients/algoliasearch-client-php/docs/Model/BatchResponse.md deleted file mode 100644 index c4688672ab..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/BatchResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# # BatchResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**taskID** | **int** | taskID of the indexing task to wait for. | [optional] -**objectIDs** | **string[]** | List of objectID. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BatchWriteObject.md b/clients/algoliasearch-client-php/docs/Model/BatchWriteObject.md deleted file mode 100644 index 30502cb8fb..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/BatchWriteObject.md +++ /dev/null @@ -1,9 +0,0 @@ -# # BatchWriteObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**requests** | [**\Algolia\AlgoliaSearch\Model\Operation[]**](Operation.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BrowseRequest.md b/clients/algoliasearch-client-php/docs/Model/BrowseRequest.md deleted file mode 100644 index aa4af2b1e4..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/BrowseRequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# # BrowseRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**params** | **string** | Search parameters as URL-encoded query string. | [optional] [default to ''] -**cursor** | **string** | Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BrowseResponse.md b/clients/algoliasearch-client-php/docs/Model/BrowseResponse.md deleted file mode 100644 index e49a3f5daf..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/BrowseResponse.md +++ /dev/null @@ -1,34 +0,0 @@ -# # BrowseResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**abTestID** | **int** | If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID. | [optional] -**abTestVariantID** | **int** | If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used. | [optional] -**aroundLatLng** | **string** | The computed geo location. | [optional] -**automaticRadius** | **string** | The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. | [optional] -**exhaustiveFacetsCount** | **bool** | Whether the facet count is exhaustive or approximate. | [optional] -**exhaustiveNbHits** | **bool** | Indicate if the nbHits count was exhaustive or approximate | -**exhaustiveTypo** | **bool** | Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) | -**facets** | **array>** | A mapping of each facet name to the corresponding facet counts. | [optional] -**facetsStats** | [**array**](BaseSearchResponseFacetsStats.md) | Statistics for numerical facets. | [optional] -**hitsPerPage** | **int** | Set the number of hits per page. | [default to 20] -**index** | **string** | Index name used for the query. | [optional] -**indexUsed** | **string** | Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. | [optional] -**message** | **string** | Used to return warnings about the query. | [optional] -**nbHits** | **int** | Number of hits that the search query matched. | -**nbPages** | **int** | Number of pages available for the current query | -**nbSortedHits** | **int** | The number of hits selected and sorted by the relevant sort algorithm | [optional] -**page** | **int** | Specify the page to retrieve. | [default to 0] -**params** | **string** | A url-encoded string of all search parameters. | -**parsedQuery** | **string** | The query string that will be searched, after normalization. | [optional] -**processingTimeMS** | **int** | Time the server took to process the request, in milliseconds. | -**query** | **string** | The text to search in the index. | [default to ''] -**queryAfterRemoval** | **string** | A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. | [optional] -**serverUsed** | **string** | Actual host name of the server that processed the request. | [optional] -**userData** | **array** | Lets you store custom data in your indices. | [optional] -**hits** | [**\Algolia\AlgoliaSearch\Model\Record[]**](Record.md) | | -**cursor** | **string** | Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/BuildInOperation.md b/clients/algoliasearch-client-php/docs/Model/BuildInOperation.md deleted file mode 100644 index 44258e1acd..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/BuildInOperation.md +++ /dev/null @@ -1,10 +0,0 @@ -# # BuildInOperation - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**operation** | **string** | The operation to apply on the attribute. | -**value** | **string** | the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Condition.md b/clients/algoliasearch-client-php/docs/Model/Condition.md deleted file mode 100644 index 29cfc785ab..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/Condition.md +++ /dev/null @@ -1,12 +0,0 @@ -# # Condition - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pattern** | **string** | Query pattern syntax | [optional] -**anchoring** | [**\Algolia\AlgoliaSearch\Model\Anchoring**](Anchoring.md) | | [optional] -**alternatives** | **bool** | Whether the pattern matches on plurals, synonyms, and typos. | [optional] [default to false] -**context** | **string** | Rule context format: [A-Za-z0-9_-]+). | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Consequence.md b/clients/algoliasearch-client-php/docs/Model/Consequence.md deleted file mode 100644 index 44d97b2323..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/Consequence.md +++ /dev/null @@ -1,13 +0,0 @@ -# # Consequence - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**params** | [**\Algolia\AlgoliaSearch\Model\ConsequenceParams**](ConsequenceParams.md) | | [optional] -**promote** | [**\Algolia\AlgoliaSearch\Model\Promote[]**](Promote.md) | Objects to promote as hits. | [optional] -**filterPromotes** | **bool** | Only use in combination with the promote consequence. When true, promoted results will be restricted to match the filters of the current search. When false, the promoted results will show up regardless of the filters. | [optional] [default to false] -**hide** | [**\Algolia\AlgoliaSearch\Model\ConsequenceHide[]**](ConsequenceHide.md) | Objects to hide from hits. Each object must contain an objectID field. By default, you can hide up to 50 items per rule. | [optional] -**userData** | **array** | Custom JSON object that will be appended to the userData array in the response. This object isn't interpreted by the API. It's limited to 1kB of minified JSON. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ConsequenceHide.md b/clients/algoliasearch-client-php/docs/Model/ConsequenceHide.md deleted file mode 100644 index ae79a1a832..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/ConsequenceHide.md +++ /dev/null @@ -1,9 +0,0 @@ -# # ConsequenceHide - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**objectID** | **string** | Unique identifier of the object. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ConsequenceParams.md b/clients/algoliasearch-client-php/docs/Model/ConsequenceParams.md deleted file mode 100644 index 888b29c966..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/ConsequenceParams.md +++ /dev/null @@ -1,87 +0,0 @@ -# # ConsequenceParams - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**query** | **string** | Query string. | [optional] -**automaticFacetFilters** | [**\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]**](AutomaticFacetFilter.md) | Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern. | [optional] -**automaticOptionalFacetFilters** | [**\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]**](AutomaticFacetFilter.md) | Same syntax as automaticFacetFilters, but the engine treats the filters as optional. | [optional] -**similarQuery** | **string** | Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. | [optional] [default to ''] -**filters** | **string** | Filter the query with numeric, facet and/or tag filters. | [optional] [default to ''] -**facetFilters** | **string[]** | Filter hits by facet value. | [optional] -**optionalFilters** | **string[]** | Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. | [optional] -**numericFilters** | **string[]** | Filter on numeric attributes. | [optional] -**tagFilters** | **string[]** | Filter hits by tags. | [optional] -**sumOrFiltersScores** | **bool** | Determines how to calculate the total score for filtering. | [optional] [default to false] -**facets** | **string[]** | Retrieve facets and their facet values. | [optional] -**maxValuesPerFacet** | **int** | Maximum number of facet values to return for each facet during a regular search. | [optional] [default to 100] -**facetingAfterDistinct** | **bool** | Force faceting to be applied after de-duplication (via the Distinct setting). | [optional] [default to false] -**sortFacetValuesBy** | **string** | Controls how facet values are fetched. | [optional] [default to 'count'] -**page** | **int** | Specify the page to retrieve. | [optional] [default to 0] -**offset** | **int** | Specify the offset of the first hit to return. | [optional] -**length** | **int** | Set the number of hits to retrieve (used only with offset). | [optional] -**aroundLatLng** | **string** | Search for entries around a central geolocation, enabling a geo search within a circular area. | [optional] [default to ''] -**aroundLatLngViaIP** | **bool** | Search for entries around a given location automatically computed from the requester's IP address. | [optional] [default to false] -**aroundRadius** | [**OneOfIntegerString**](OneOfIntegerString.md) | Define the maximum radius for a geo search (in meters). | [optional] -**aroundPrecision** | **int** | Precision of geo search (in meters), to add grouping by geo location to the ranking formula. | [optional] [default to 10] -**minimumAroundRadius** | **int** | Minimum radius (in meters) used for a geo search when aroundRadius is not set. | [optional] -**insideBoundingBox** | **float[]** | Search inside a rectangular area (in geo coordinates). | [optional] -**insidePolygon** | **float[]** | Search inside a polygon (in geo coordinates). | [optional] -**naturalLanguages** | **string[]** | This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. | [optional] -**ruleContexts** | **string[]** | Enables contextual rules. | [optional] -**personalizationImpact** | **int** | Define the impact of the Personalization feature. | [optional] [default to 100] -**userToken** | **string** | Associates a certain user token with the current search. | [optional] -**getRankingInfo** | **bool** | Retrieve detailed ranking information. | [optional] [default to false] -**clickAnalytics** | **bool** | Enable the Click Analytics feature. | [optional] [default to false] -**analytics** | **bool** | Whether the current query will be taken into account in the Analytics. | [optional] [default to true] -**analyticsTags** | **string[]** | List of tags to apply to the query for analytics purposes. | [optional] -**percentileComputation** | **bool** | Whether to include or exclude a query from the processing-time percentile computation. | [optional] [default to true] -**enableABTest** | **bool** | Whether this search should participate in running AB tests. | [optional] [default to true] -**enableReRanking** | **bool** | Whether this search should use AI Re-Ranking. | [optional] [default to true] -**searchableAttributes** | **string[]** | The complete list of attributes used for searching. | [optional] -**attributesForFaceting** | **string[]** | The complete list of attributes that will be used for faceting. | [optional] -**unretrievableAttributes** | **string[]** | List of attributes that can't be retrieved at query time. | [optional] -**attributesToRetrieve** | **string[]** | This parameter controls which attributes to retrieve and which not to retrieve. | [optional] -**restrictSearchableAttributes** | **string[]** | Restricts a given query to look in only a subset of your searchable attributes. | [optional] -**ranking** | **string[]** | Controls how Algolia should sort your results. | [optional] -**customRanking** | **string[]** | Specifies the custom ranking criterion. | [optional] -**relevancyStrictness** | **int** | Controls the relevancy threshold below which less relevant results aren't included in the results. | [optional] [default to 100] -**attributesToHighlight** | **string[]** | List of attributes to highlight. | [optional] -**attributesToSnippet** | **string[]** | List of attributes to snippet, with an optional maximum number of words to snippet. | [optional] -**highlightPreTag** | **string** | The HTML string to insert before the highlighted parts in all highlight and snippet results. | [optional] [default to ''] -**highlightPostTag** | **string** | The HTML string to insert after the highlighted parts in all highlight and snippet results. | [optional] [default to ''] -**snippetEllipsisText** | **string** | String used as an ellipsis indicator when a snippet is truncated. | [optional] [default to '…'] -**restrictHighlightAndSnippetArrays** | **bool** | Restrict highlighting and snippeting to items that matched the query. | [optional] [default to false] -**hitsPerPage** | **int** | Set the number of hits per page. | [optional] [default to 20] -**minWordSizefor1Typo** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 1 typo. | [optional] [default to 4] -**minWordSizefor2Typos** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 2 typos. | [optional] [default to 8] -**typoTolerance** | **string** | Controls whether typo tolerance is enabled and how it is applied. | [optional] [default to 'true'] -**allowTyposOnNumericTokens** | **bool** | Whether to allow typos on numbers (\"numeric tokens\") in the query string. | [optional] [default to true] -**disableTypoToleranceOnAttributes** | **string[]** | List of attributes on which you want to disable typo tolerance. | [optional] -**separatorsToIndex** | **string** | Control which separators are indexed. | [optional] [default to ''] -**ignorePlurals** | **string** | Treats singular, plurals, and other forms of declensions as matching terms. | [optional] [default to 'false'] -**removeStopWords** | **string** | Removes stop (common) words from the query before executing it. | [optional] [default to 'false'] -**keepDiacriticsOnCharacters** | **string** | List of characters that the engine shouldn't automatically normalize. | [optional] [default to ''] -**queryLanguages** | **string[]** | Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. | [optional] -**decompoundQuery** | **bool** | Splits compound words into their composing atoms in the query. | [optional] [default to true] -**enableRules** | **bool** | Whether Rules should be globally enabled. | [optional] [default to true] -**enablePersonalization** | **bool** | Enable the Personalization feature. | [optional] [default to false] -**queryType** | **string** | Controls if and how query words are interpreted as prefixes. | [optional] [default to 'prefixLast'] -**removeWordsIfNoResults** | **string** | Selects a strategy to remove words from the query when it doesn't match any hits. | [optional] [default to 'none'] -**advancedSyntax** | **bool** | Enables the advanced query syntax. | [optional] [default to false] -**optionalWords** | **string[]** | A list of words that should be considered as optional when found in the query. | [optional] -**disableExactOnAttributes** | **string[]** | List of attributes on which you want to disable the exact ranking criterion. | [optional] -**exactOnSingleWordQuery** | **string** | Controls how the exact ranking criterion is computed when the query contains only one word. | [optional] [default to 'attribute'] -**alternativesAsExact** | **string[]** | List of alternatives that should be considered an exact match by the exact ranking criterion. | [optional] -**advancedSyntaxFeatures** | **string[]** | Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. | [optional] -**distinct** | **int** | Enables de-duplication or grouping of results. | [optional] [default to 0] -**synonyms** | **bool** | Whether to take into account an index's synonyms for a particular search. | [optional] [default to true] -**replaceSynonymsInHighlight** | **bool** | Whether to highlight and snippet the original word that matches the synonym or the synonym itself. | [optional] [default to false] -**minProximity** | **int** | Precision of the proximity ranking criterion. | [optional] [default to 1] -**responseFields** | **string[]** | Choose which fields to return in the API response. This parameters applies to search and browse queries. | [optional] -**maxFacetHits** | **int** | Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. | [optional] [default to 10] -**attributeCriteriaComputedByMinProximity** | **bool** | When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. | [optional] [default to false] -**renderingContent** | **object** | Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/CreatedAtObject.md b/clients/algoliasearch-client-php/docs/Model/CreatedAtObject.md deleted file mode 100644 index d4e28dd37a..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/CreatedAtObject.md +++ /dev/null @@ -1,9 +0,0 @@ -# # CreatedAtObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createdAt** | **\DateTime** | Date of creation (ISO-8601 format). | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/CreatedAtResponse.md b/clients/algoliasearch-client-php/docs/Model/CreatedAtResponse.md deleted file mode 100644 index 63b0903777..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/CreatedAtResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # CreatedAtResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createdAt** | **\DateTime** | Date of creation (ISO-8601 format). | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/DeleteApiKeyResponse.md b/clients/algoliasearch-client-php/docs/Model/DeleteApiKeyResponse.md deleted file mode 100644 index c2a976c61f..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/DeleteApiKeyResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # DeleteApiKeyResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**deletedAt** | **\DateTime** | Date of deletion (ISO-8601 format). | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/DeleteSourceResponse.md b/clients/algoliasearch-client-php/docs/Model/DeleteSourceResponse.md deleted file mode 100644 index 52fe48f01a..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/DeleteSourceResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # DeleteSourceResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**deletedAt** | **\DateTime** | Date of deletion (ISO-8601 format). | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/DeletedAtResponse.md b/clients/algoliasearch-client-php/docs/Model/DeletedAtResponse.md deleted file mode 100644 index 193e9681f9..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/DeletedAtResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# # DeletedAtResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**taskID** | **int** | taskID of the indexing task to wait for. | -**deletedAt** | **\DateTime** | Date of deletion (ISO-8601 format). | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/DictionaryEntry.md b/clients/algoliasearch-client-php/docs/Model/DictionaryEntry.md deleted file mode 100644 index 9b82059ebb..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/DictionaryEntry.md +++ /dev/null @@ -1,14 +0,0 @@ -# # DictionaryEntry - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**objectID** | **string** | Unique identifier of the object. | -**language** | **string** | Language ISO code supported by the dictionary (e.g., \"en\" for English). | -**word** | **string** | The word of the dictionary entry. | [optional] -**words** | **string[]** | The words of the dictionary entry. | [optional] -**decomposition** | **string[]** | A decomposition of the word of the dictionary entry. | [optional] -**state** | **string** | The state of the dictionary entry. | [optional] [default to 'enabled'] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/DictionaryLanguage.md b/clients/algoliasearch-client-php/docs/Model/DictionaryLanguage.md deleted file mode 100644 index ea5d112dbc..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/DictionaryLanguage.md +++ /dev/null @@ -1,9 +0,0 @@ -# # DictionaryLanguage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**nbCustomEntires** | **int** | When nbCustomEntries is set to 0, the user didn't customize the dictionary. The dictionary is still supported with standard, Algolia-provided entries. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/DictionarySettingsRequest.md b/clients/algoliasearch-client-php/docs/Model/DictionarySettingsRequest.md deleted file mode 100644 index 20543a7edc..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/DictionarySettingsRequest.md +++ /dev/null @@ -1,9 +0,0 @@ -# # DictionarySettingsRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**disableStandardEntries** | [**\Algolia\AlgoliaSearch\Model\StandardEntries**](StandardEntries.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ErrorBase.md b/clients/algoliasearch-client-php/docs/Model/ErrorBase.md deleted file mode 100644 index 3e7fb2b482..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/ErrorBase.md +++ /dev/null @@ -1,9 +0,0 @@ -# # ErrorBase - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**message** | **string** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetDictionarySettingsResponse.md b/clients/algoliasearch-client-php/docs/Model/GetDictionarySettingsResponse.md deleted file mode 100644 index 8b9d0a3831..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/GetDictionarySettingsResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # GetDictionarySettingsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**disableStandardEntries** | [**\Algolia\AlgoliaSearch\Model\StandardEntries**](StandardEntries.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetLogsResponse.md b/clients/algoliasearch-client-php/docs/Model/GetLogsResponse.md deleted file mode 100644 index fe065fe89b..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/GetLogsResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # GetLogsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**logs** | [**\Algolia\AlgoliaSearch\Model\GetLogsResponseLogs[]**](GetLogsResponseLogs.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetLogsResponseInnerQueries.md b/clients/algoliasearch-client-php/docs/Model/GetLogsResponseInnerQueries.md deleted file mode 100644 index 42016555a7..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/GetLogsResponseInnerQueries.md +++ /dev/null @@ -1,11 +0,0 @@ -# # GetLogsResponseInnerQueries - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**indexName** | **string** | Index targeted by the query. | [optional] -**userToken** | **string** | User identifier. | [optional] -**queryId** | **string** | QueryID for the given query. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetLogsResponseLogs.md b/clients/algoliasearch-client-php/docs/Model/GetLogsResponseLogs.md deleted file mode 100644 index 4fbc7559f0..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/GetLogsResponseLogs.md +++ /dev/null @@ -1,23 +0,0 @@ -# # GetLogsResponseLogs - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**timestamp** | **string** | Timestamp in ISO-8601 format. | -**method** | **string** | HTTP method of the perfomed request. | -**answerCode** | **string** | HTTP response code. | -**queryBody** | **string** | Request body. Truncated after 1000 characters. | -**answer** | **string** | Answer body. Truncated after 1000 characters. | -**url** | **string** | Request URL. | -**ip** | **string** | IP of the client which perfomed the request. | -**queryHeaders** | **string** | Request Headers (API Key is obfuscated). | -**sha1** | **string** | SHA1 signature of the log entry. | -**nbApiCalls** | **string** | Number of API calls. | -**processingTimeMs** | **string** | Processing time for the query. It doesn't include network time. | -**index** | **string** | Index targeted by the query. | [optional] -**queryParams** | **string** | Query parameters sent with the request. | [optional] -**queryNbHits** | **string** | Number of hits returned for the query. | [optional] -**innerQueries** | [**\Algolia\AlgoliaSearch\Model\GetLogsResponseInnerQueries[]**](GetLogsResponseInnerQueries.md) | Array of all performed queries for the given request. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetObjectsObject.md b/clients/algoliasearch-client-php/docs/Model/GetObjectsObject.md deleted file mode 100644 index 7694ac8a06..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/GetObjectsObject.md +++ /dev/null @@ -1,9 +0,0 @@ -# # GetObjectsObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**requests** | [**\Algolia\AlgoliaSearch\Model\MultipleGetObjectsObject[]**](MultipleGetObjectsObject.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetObjectsResponse.md b/clients/algoliasearch-client-php/docs/Model/GetObjectsResponse.md deleted file mode 100644 index 9717b71167..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/GetObjectsResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # GetObjectsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**results** | **array[]** | List of results fetched. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetTaskResponse.md b/clients/algoliasearch-client-php/docs/Model/GetTaskResponse.md deleted file mode 100644 index 3f35342bf1..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/GetTaskResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # GetTaskResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **string** | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/GetTopUserIdsResponse.md b/clients/algoliasearch-client-php/docs/Model/GetTopUserIdsResponse.md deleted file mode 100644 index e3cc337811..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/GetTopUserIdsResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # GetTopUserIdsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**topUsers** | **array[]** | Mapping of cluster names to top users. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/HighlightResult.md b/clients/algoliasearch-client-php/docs/Model/HighlightResult.md deleted file mode 100644 index 7586bba50a..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/HighlightResult.md +++ /dev/null @@ -1,12 +0,0 @@ -# # HighlightResult - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **string** | Markup text with occurrences highlighted. | [optional] -**matchLevel** | **string** | Indicates how well the attribute matched the search query. | [optional] -**matchedWords** | **string[]** | List of words from the query that matched the object. | [optional] -**fullyHighlighted** | **bool** | Whether the entire attribute value is highlighted. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Index.md b/clients/algoliasearch-client-php/docs/Model/Index.md deleted file mode 100644 index 9f3c2cb90a..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/Index.md +++ /dev/null @@ -1,19 +0,0 @@ -# # Index - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **string** | Index name. | -**createdAt** | **\DateTime** | Index creation date. An empty string means that the index has no records. | -**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | -**entries** | **int** | Number of records contained in the index. | -**dataSize** | **int** | Number of bytes of the index in minified format. | -**fileSize** | **int** | Number of bytes of the index binary file. | -**lastBuildTimeS** | **int** | Last build time | -**numberOfPendingTask** | **int** | Number of pending indexing operations. This value is deprecated and should not be used. | [optional] -**pendingTask** | **bool** | A boolean which says whether the index has pending tasks. This value is deprecated and should not be used. | -**primary** | **string** | Only present if the index is a replica. Contains the name of the related primary index. | [optional] -**replicas** | **string[]** | Only present if the index is a primary index with replicas. Contains the names of all linked replicas. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/IndexSettings.md b/clients/algoliasearch-client-php/docs/Model/IndexSettings.md deleted file mode 100644 index 84090e742c..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/IndexSettings.md +++ /dev/null @@ -1,64 +0,0 @@ -# # IndexSettings - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**replicas** | **string[]** | Creates replicas, exact copies of an index. | [optional] -**paginationLimitedTo** | **int** | Set the maximum number of hits accessible via pagination. | [optional] [default to 1000] -**disableTypoToleranceOnWords** | **string[]** | A list of words for which you want to turn off typo tolerance. | [optional] -**attributesToTransliterate** | **string[]** | Specify on which attributes to apply transliteration. | [optional] -**camelCaseAttributes** | **string[]** | List of attributes on which to do a decomposition of camel case words. | [optional] -**decompoundedAttributes** | **array** | Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding. | [optional] -**indexLanguages** | **string[]** | Sets the languages at the index level for language-specific processing such as tokenization and normalization. | [optional] -**filterPromotes** | **bool** | Whether promoted results should match the filters of the current search, except for geographic filters. | [optional] [default to false] -**disablePrefixOnAttributes** | **string[]** | List of attributes on which you want to disable prefix matching. | [optional] -**allowCompressionOfIntegerArray** | **bool** | Enables compression of large integer arrays. | [optional] [default to false] -**numericAttributesForFiltering** | **string[]** | List of numeric attributes that can be used as numerical filters. | [optional] -**userData** | **array** | Lets you store custom data in your indices. | [optional] -**searchableAttributes** | **string[]** | The complete list of attributes used for searching. | [optional] -**attributesForFaceting** | **string[]** | The complete list of attributes that will be used for faceting. | [optional] -**unretrievableAttributes** | **string[]** | List of attributes that can't be retrieved at query time. | [optional] -**attributesToRetrieve** | **string[]** | This parameter controls which attributes to retrieve and which not to retrieve. | [optional] -**restrictSearchableAttributes** | **string[]** | Restricts a given query to look in only a subset of your searchable attributes. | [optional] -**ranking** | **string[]** | Controls how Algolia should sort your results. | [optional] -**customRanking** | **string[]** | Specifies the custom ranking criterion. | [optional] -**relevancyStrictness** | **int** | Controls the relevancy threshold below which less relevant results aren't included in the results. | [optional] [default to 100] -**attributesToHighlight** | **string[]** | List of attributes to highlight. | [optional] -**attributesToSnippet** | **string[]** | List of attributes to snippet, with an optional maximum number of words to snippet. | [optional] -**highlightPreTag** | **string** | The HTML string to insert before the highlighted parts in all highlight and snippet results. | [optional] [default to ''] -**highlightPostTag** | **string** | The HTML string to insert after the highlighted parts in all highlight and snippet results. | [optional] [default to ''] -**snippetEllipsisText** | **string** | String used as an ellipsis indicator when a snippet is truncated. | [optional] [default to '…'] -**restrictHighlightAndSnippetArrays** | **bool** | Restrict highlighting and snippeting to items that matched the query. | [optional] [default to false] -**hitsPerPage** | **int** | Set the number of hits per page. | [optional] [default to 20] -**minWordSizefor1Typo** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 1 typo. | [optional] [default to 4] -**minWordSizefor2Typos** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 2 typos. | [optional] [default to 8] -**typoTolerance** | **string** | Controls whether typo tolerance is enabled and how it is applied. | [optional] [default to 'true'] -**allowTyposOnNumericTokens** | **bool** | Whether to allow typos on numbers (\"numeric tokens\") in the query string. | [optional] [default to true] -**disableTypoToleranceOnAttributes** | **string[]** | List of attributes on which you want to disable typo tolerance. | [optional] -**separatorsToIndex** | **string** | Control which separators are indexed. | [optional] [default to ''] -**ignorePlurals** | **string** | Treats singular, plurals, and other forms of declensions as matching terms. | [optional] [default to 'false'] -**removeStopWords** | **string** | Removes stop (common) words from the query before executing it. | [optional] [default to 'false'] -**keepDiacriticsOnCharacters** | **string** | List of characters that the engine shouldn't automatically normalize. | [optional] [default to ''] -**queryLanguages** | **string[]** | Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. | [optional] -**decompoundQuery** | **bool** | Splits compound words into their composing atoms in the query. | [optional] [default to true] -**enableRules** | **bool** | Whether Rules should be globally enabled. | [optional] [default to true] -**enablePersonalization** | **bool** | Enable the Personalization feature. | [optional] [default to false] -**queryType** | **string** | Controls if and how query words are interpreted as prefixes. | [optional] [default to 'prefixLast'] -**removeWordsIfNoResults** | **string** | Selects a strategy to remove words from the query when it doesn't match any hits. | [optional] [default to 'none'] -**advancedSyntax** | **bool** | Enables the advanced query syntax. | [optional] [default to false] -**optionalWords** | **string[]** | A list of words that should be considered as optional when found in the query. | [optional] -**disableExactOnAttributes** | **string[]** | List of attributes on which you want to disable the exact ranking criterion. | [optional] -**exactOnSingleWordQuery** | **string** | Controls how the exact ranking criterion is computed when the query contains only one word. | [optional] [default to 'attribute'] -**alternativesAsExact** | **string[]** | List of alternatives that should be considered an exact match by the exact ranking criterion. | [optional] -**advancedSyntaxFeatures** | **string[]** | Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. | [optional] -**distinct** | **int** | Enables de-duplication or grouping of results. | [optional] [default to 0] -**synonyms** | **bool** | Whether to take into account an index's synonyms for a particular search. | [optional] [default to true] -**replaceSynonymsInHighlight** | **bool** | Whether to highlight and snippet the original word that matches the synonym or the synonym itself. | [optional] [default to false] -**minProximity** | **int** | Precision of the proximity ranking criterion. | [optional] [default to 1] -**responseFields** | **string[]** | Choose which fields to return in the API response. This parameters applies to search and browse queries. | [optional] -**maxFacetHits** | **int** | Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. | [optional] [default to 10] -**attributeCriteriaComputedByMinProximity** | **bool** | When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. | [optional] [default to false] -**renderingContent** | **object** | Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/IndexSettingsAsSearchParams.md b/clients/algoliasearch-client-php/docs/Model/IndexSettingsAsSearchParams.md deleted file mode 100644 index 4a42360a65..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/IndexSettingsAsSearchParams.md +++ /dev/null @@ -1,52 +0,0 @@ -# # IndexSettingsAsSearchParams - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**searchableAttributes** | **string[]** | The complete list of attributes used for searching. | [optional] -**attributesForFaceting** | **string[]** | The complete list of attributes that will be used for faceting. | [optional] -**unretrievableAttributes** | **string[]** | List of attributes that can't be retrieved at query time. | [optional] -**attributesToRetrieve** | **string[]** | This parameter controls which attributes to retrieve and which not to retrieve. | [optional] -**restrictSearchableAttributes** | **string[]** | Restricts a given query to look in only a subset of your searchable attributes. | [optional] -**ranking** | **string[]** | Controls how Algolia should sort your results. | [optional] -**customRanking** | **string[]** | Specifies the custom ranking criterion. | [optional] -**relevancyStrictness** | **int** | Controls the relevancy threshold below which less relevant results aren't included in the results. | [optional] [default to 100] -**attributesToHighlight** | **string[]** | List of attributes to highlight. | [optional] -**attributesToSnippet** | **string[]** | List of attributes to snippet, with an optional maximum number of words to snippet. | [optional] -**highlightPreTag** | **string** | The HTML string to insert before the highlighted parts in all highlight and snippet results. | [optional] [default to ''] -**highlightPostTag** | **string** | The HTML string to insert after the highlighted parts in all highlight and snippet results. | [optional] [default to ''] -**snippetEllipsisText** | **string** | String used as an ellipsis indicator when a snippet is truncated. | [optional] [default to '…'] -**restrictHighlightAndSnippetArrays** | **bool** | Restrict highlighting and snippeting to items that matched the query. | [optional] [default to false] -**hitsPerPage** | **int** | Set the number of hits per page. | [optional] [default to 20] -**minWordSizefor1Typo** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 1 typo. | [optional] [default to 4] -**minWordSizefor2Typos** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 2 typos. | [optional] [default to 8] -**typoTolerance** | **string** | Controls whether typo tolerance is enabled and how it is applied. | [optional] [default to 'true'] -**allowTyposOnNumericTokens** | **bool** | Whether to allow typos on numbers (\"numeric tokens\") in the query string. | [optional] [default to true] -**disableTypoToleranceOnAttributes** | **string[]** | List of attributes on which you want to disable typo tolerance. | [optional] -**separatorsToIndex** | **string** | Control which separators are indexed. | [optional] [default to ''] -**ignorePlurals** | **string** | Treats singular, plurals, and other forms of declensions as matching terms. | [optional] [default to 'false'] -**removeStopWords** | **string** | Removes stop (common) words from the query before executing it. | [optional] [default to 'false'] -**keepDiacriticsOnCharacters** | **string** | List of characters that the engine shouldn't automatically normalize. | [optional] [default to ''] -**queryLanguages** | **string[]** | Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. | [optional] -**decompoundQuery** | **bool** | Splits compound words into their composing atoms in the query. | [optional] [default to true] -**enableRules** | **bool** | Whether Rules should be globally enabled. | [optional] [default to true] -**enablePersonalization** | **bool** | Enable the Personalization feature. | [optional] [default to false] -**queryType** | **string** | Controls if and how query words are interpreted as prefixes. | [optional] [default to 'prefixLast'] -**removeWordsIfNoResults** | **string** | Selects a strategy to remove words from the query when it doesn't match any hits. | [optional] [default to 'none'] -**advancedSyntax** | **bool** | Enables the advanced query syntax. | [optional] [default to false] -**optionalWords** | **string[]** | A list of words that should be considered as optional when found in the query. | [optional] -**disableExactOnAttributes** | **string[]** | List of attributes on which you want to disable the exact ranking criterion. | [optional] -**exactOnSingleWordQuery** | **string** | Controls how the exact ranking criterion is computed when the query contains only one word. | [optional] [default to 'attribute'] -**alternativesAsExact** | **string[]** | List of alternatives that should be considered an exact match by the exact ranking criterion. | [optional] -**advancedSyntaxFeatures** | **string[]** | Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. | [optional] -**distinct** | **int** | Enables de-duplication or grouping of results. | [optional] [default to 0] -**synonyms** | **bool** | Whether to take into account an index's synonyms for a particular search. | [optional] [default to true] -**replaceSynonymsInHighlight** | **bool** | Whether to highlight and snippet the original word that matches the synonym or the synonym itself. | [optional] [default to false] -**minProximity** | **int** | Precision of the proximity ranking criterion. | [optional] [default to 1] -**responseFields** | **string[]** | Choose which fields to return in the API response. This parameters applies to search and browse queries. | [optional] -**maxFacetHits** | **int** | Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. | [optional] [default to 10] -**attributeCriteriaComputedByMinProximity** | **bool** | When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. | [optional] [default to false] -**renderingContent** | **object** | Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/KeyObject.md b/clients/algoliasearch-client-php/docs/Model/KeyObject.md deleted file mode 100644 index ae9fd12b35..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/KeyObject.md +++ /dev/null @@ -1,17 +0,0 @@ -# # KeyObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**acl** | **string[]** | Set of permissions associated with the key. | -**description** | **string** | A comment used to identify a key more easily in the dashboard. It is not interpreted by the API. | [optional] [default to ''] -**indexes** | **string[]** | Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed. | [optional] -**maxHitsPerQuery** | **int** | Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. | [optional] [default to 0] -**maxQueriesPerIPPerHour** | **int** | Maximum number of API calls per hour allowed from a given IP address or a user token. | [optional] [default to 0] -**queryParameters** | **string** | URL-encoded query string. Force some query parameters to be applied for each query made with this API key. | [optional] [default to ''] -**referers** | **string[]** | Restrict this new API key to specific referers. If empty or blank, defaults to all referers. | [optional] -**validity** | **int** | Validity limit for this key in seconds. The key will automatically be removed after this period of time. | [optional] [default to 0] -**createdAt** | **\DateTime** | Date of creation (ISO-8601 format). | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Languages.md b/clients/algoliasearch-client-php/docs/Model/Languages.md deleted file mode 100644 index e773db9f3e..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/Languages.md +++ /dev/null @@ -1,11 +0,0 @@ -# # Languages - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**plurals** | [**\Algolia\AlgoliaSearch\Model\DictionaryLanguage**](DictionaryLanguage.md) | | -**stopwords** | [**\Algolia\AlgoliaSearch\Model\DictionaryLanguage**](DictionaryLanguage.md) | | -**compounds** | [**\Algolia\AlgoliaSearch\Model\DictionaryLanguage**](DictionaryLanguage.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ListApiKeysResponse.md b/clients/algoliasearch-client-php/docs/Model/ListApiKeysResponse.md deleted file mode 100644 index 58e3c50712..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/ListApiKeysResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # ListApiKeysResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**keys** | [**\Algolia\AlgoliaSearch\Model\KeyObject[]**](KeyObject.md) | List of api keys. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ListClustersResponse.md b/clients/algoliasearch-client-php/docs/Model/ListClustersResponse.md deleted file mode 100644 index fef1cbdf5e..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/ListClustersResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # ListClustersResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**topUsers** | **string[]** | Mapping of cluster names to top users. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ListIndicesResponse.md b/clients/algoliasearch-client-php/docs/Model/ListIndicesResponse.md deleted file mode 100644 index 5155de572b..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/ListIndicesResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# # ListIndicesResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**items** | [**\Algolia\AlgoliaSearch\Model\Index[]**](Index.md) | List of the fetched indices. | [optional] -**nbPages** | **int** | Number of pages. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ListUserIdsResponse.md b/clients/algoliasearch-client-php/docs/Model/ListUserIdsResponse.md deleted file mode 100644 index 669e0339af..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/ListUserIdsResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # ListUserIdsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**userIDs** | [**\Algolia\AlgoliaSearch\Model\UserId[]**](UserId.md) | List of userIDs. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/MultipleBatchResponse.md b/clients/algoliasearch-client-php/docs/Model/MultipleBatchResponse.md deleted file mode 100644 index edf260187f..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/MultipleBatchResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# # MultipleBatchResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**taskID** | **array** | List of tasksIDs per index. | [optional] -**objectIDs** | **string[]** | List of objectID. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/MultipleGetObjectsObject.md b/clients/algoliasearch-client-php/docs/Model/MultipleGetObjectsObject.md deleted file mode 100644 index 298e7b0a18..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/MultipleGetObjectsObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# # MultipleGetObjectsObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attributesToRetrieve** | **string[]** | List of attributes to retrieve. By default, all retrievable attributes are returned. | [optional] -**objectID** | **string** | ID of the object within that index. | -**indexName** | **string** | name of the index containing the object. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/MultipleQueries.md b/clients/algoliasearch-client-php/docs/Model/MultipleQueries.md deleted file mode 100644 index 32369cc025..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/MultipleQueries.md +++ /dev/null @@ -1,13 +0,0 @@ -# # MultipleQueries - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**indexName** | **string** | The Algolia index name. | -**query** | **string** | The text to search in the index. | [optional] [default to ''] -**type** | **string** | Perform a search query with `default`, will search for facet values if `facet` is given. | [optional] [default to 'default'] -**facet** | **string** | The `facet` name. | [optional] -**params** | **string** | A query string of search parameters. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/MultipleQueriesObject.md b/clients/algoliasearch-client-php/docs/Model/MultipleQueriesObject.md deleted file mode 100644 index 33aa884adf..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/MultipleQueriesObject.md +++ /dev/null @@ -1,10 +0,0 @@ -# # MultipleQueriesObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**requests** | [**\Algolia\AlgoliaSearch\Model\MultipleQueries[]**](MultipleQueries.md) | | -**strategy** | **string** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/MultipleQueriesResponse.md b/clients/algoliasearch-client-php/docs/Model/MultipleQueriesResponse.md deleted file mode 100644 index 38a30d184a..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/MultipleQueriesResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # MultipleQueriesResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**results** | [**\Algolia\AlgoliaSearch\Model\SearchResponse[]**](SearchResponse.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Operation.md b/clients/algoliasearch-client-php/docs/Model/Operation.md deleted file mode 100644 index e0cde21a6f..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/Operation.md +++ /dev/null @@ -1,11 +0,0 @@ -# # Operation - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**action** | [**\Algolia\AlgoliaSearch\Model\Action**](Action.md) | | [optional] -**body** | **array** | arguments to the operation (depends on the type of the operation). | [optional] -**indexName** | **string** | Index to target for this operation. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/OperationIndexObject.md b/clients/algoliasearch-client-php/docs/Model/OperationIndexObject.md deleted file mode 100644 index e841be9638..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/OperationIndexObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# # OperationIndexObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**operation** | **string** | Type of operation to perform (move or copy). | -**destination** | **string** | The Algolia index name. | -**scope** | **string[]** | Scope of the data to copy. When absent, a full copy is performed. When present, only the selected scopes are copied. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Params.md b/clients/algoliasearch-client-php/docs/Model/Params.md deleted file mode 100644 index 17733ef9b3..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/Params.md +++ /dev/null @@ -1,11 +0,0 @@ -# # Params - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**query** | **string** | Query string. | [optional] -**automaticFacetFilters** | [**\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]**](AutomaticFacetFilter.md) | Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern. | [optional] -**automaticOptionalFacetFilters** | [**\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]**](AutomaticFacetFilter.md) | Same syntax as automaticFacetFilters, but the engine treats the filters as optional. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Promote.md b/clients/algoliasearch-client-php/docs/Model/Promote.md deleted file mode 100644 index b4994e9856..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/Promote.md +++ /dev/null @@ -1,11 +0,0 @@ -# # Promote - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**objectID** | **string** | Unique identifier of the object to promote. | [optional] -**objectIDs** | **string[]** | Array of unique identifiers of the objects to promote. | [optional] -**position** | **int** | The position to promote the objects to (zero-based). If you pass objectIDs, the objects are placed at this position as a group. For example, if you pass four objectIDs to position 0, the objects take the first four positions. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/RankingInfo.md b/clients/algoliasearch-client-php/docs/Model/RankingInfo.md deleted file mode 100644 index fe506ae957..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/RankingInfo.md +++ /dev/null @@ -1,19 +0,0 @@ -# # RankingInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**filters** | **int** | This field is reserved for advanced usage. | [optional] -**firstMatchedWord** | **int** | Position of the most important matched attribute in the attributes to index list. | [optional] -**geoDistance** | **int** | Distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters). | [optional] -**geoPrecision** | **int** | Precision used when computing the geo distance, in meters. | [optional] -**matchedGeoLocation** | [**array**](RankingInfoMatchedGeoLocation.md) | | [optional] -**nbExactWords** | **int** | Number of exactly matched words. | [optional] -**nbTypos** | **int** | Number of typos encountered when matching the record. | [optional] -**promoted** | **bool** | Present and set to true if a Rule promoted the hit. | [optional] -**proximityDistance** | **int** | When the query contains more than one word, the sum of the distances between matched words (in meters). | [optional] -**userScore** | **int** | Custom ranking for the object, expressed as a single integer value. | [optional] -**word** | **int** | Number of matched words, including prefixes and typos. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/RankingInfoMatchedGeoLocation.md b/clients/algoliasearch-client-php/docs/Model/RankingInfoMatchedGeoLocation.md deleted file mode 100644 index e2656bdd7a..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/RankingInfoMatchedGeoLocation.md +++ /dev/null @@ -1,11 +0,0 @@ -# # RankingInfoMatchedGeoLocation - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**lat** | **double** | Latitude of the matched location. | [optional] -**lng** | **double** | Longitude of the matched location. | [optional] -**distance** | **int** | Distance between the matched location and the search location (in meters). | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Record.md b/clients/algoliasearch-client-php/docs/Model/Record.md deleted file mode 100644 index 35d17fdd4e..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/Record.md +++ /dev/null @@ -1,13 +0,0 @@ -# # Record - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**objectID** | **string** | Unique identifier of the object. | -**highlightResult** | [**\Algolia\AlgoliaSearch\Model\HighlightResult**](HighlightResult.md) | | [optional] -**snippetResult** | [**\Algolia\AlgoliaSearch\Model\SnippetResult**](SnippetResult.md) | | [optional] -**rankingInfo** | [**\Algolia\AlgoliaSearch\Model\RankingInfo**](RankingInfo.md) | | [optional] -**distinctSeqID** | **int** | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/RemoveUserIdResponse.md b/clients/algoliasearch-client-php/docs/Model/RemoveUserIdResponse.md deleted file mode 100644 index b87a842977..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/RemoveUserIdResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # RemoveUserIdResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**deletedAt** | **\DateTime** | Date of deletion (ISO-8601 format). | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/ReplaceSourceResponse.md b/clients/algoliasearch-client-php/docs/Model/ReplaceSourceResponse.md deleted file mode 100644 index 1317d81ebc..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/ReplaceSourceResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # ReplaceSourceResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/RequiredSearchParams.md b/clients/algoliasearch-client-php/docs/Model/RequiredSearchParams.md deleted file mode 100644 index 69b2d4b1fc..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/RequiredSearchParams.md +++ /dev/null @@ -1,9 +0,0 @@ -# # RequiredSearchParams - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**query** | **string** | The text to search in the index. | [default to ''] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Rule.md b/clients/algoliasearch-client-php/docs/Model/Rule.md deleted file mode 100644 index 1a8258509d..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/Rule.md +++ /dev/null @@ -1,14 +0,0 @@ -# # Rule - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**objectID** | **string** | Unique identifier of the object. | -**conditions** | [**\Algolia\AlgoliaSearch\Model\Condition[]**](Condition.md) | A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule. | [optional] -**consequence** | [**\Algolia\AlgoliaSearch\Model\Consequence**](Consequence.md) | | -**description** | **string** | This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It's not interpreted by the API. | [optional] -**enabled** | **bool** | Whether the Rule is enabled. Disabled Rules remain in the index, but aren't applied at query time. | [optional] [default to true] -**validity** | [**\Algolia\AlgoliaSearch\Model\TimeRange[]**](TimeRange.md) | By default, Rules are permanently valid. When validity periods are specified, the Rule applies only during those periods; it's ignored the rest of the time. The list must not be empty. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SaveObjectResponse.md b/clients/algoliasearch-client-php/docs/Model/SaveObjectResponse.md deleted file mode 100644 index 78b5687749..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SaveObjectResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# # SaveObjectResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**createdAt** | **string** | | [optional] -**taskID** | **int** | taskID of the indexing task to wait for. | [optional] -**objectID** | **string** | Unique identifier of the object. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SaveSynonymResponse.md b/clients/algoliasearch-client-php/docs/Model/SaveSynonymResponse.md deleted file mode 100644 index fabf0b890f..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SaveSynonymResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# # SaveSynonymResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**taskID** | **int** | taskID of the indexing task to wait for. | -**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | -**id** | **string** | objectID of the inserted object. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchDictionaryEntries.md b/clients/algoliasearch-client-php/docs/Model/SearchDictionaryEntries.md deleted file mode 100644 index 5d7a8b0157..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchDictionaryEntries.md +++ /dev/null @@ -1,12 +0,0 @@ -# # SearchDictionaryEntries - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**query** | **string** | The text to search in the index. | [default to ''] -**page** | **int** | Specify the page to retrieve. | [optional] [default to 0] -**hitsPerPage** | **int** | Set the number of hits per page. | [optional] [default to 20] -**language** | **string** | Language ISO code supported by the dictionary (e.g., \"en\" for English). | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesRequest.md b/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesRequest.md deleted file mode 100644 index f8d9590d0b..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesRequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# # SearchForFacetValuesRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**params** | **string** | Search parameters as URL-encoded query string. | [optional] [default to ''] -**facetQuery** | **string** | Text to search inside the facet's values. | [optional] [default to ''] -**maxFacetHits** | **int** | Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. | [optional] [default to 10] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponse.md b/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponse.md deleted file mode 100644 index 1a755869e9..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # SearchForFacetValuesResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**facetHits** | [**\Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponseFacetHits[]**](SearchForFacetValuesResponseFacetHits.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponseFacetHits.md b/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponseFacetHits.md deleted file mode 100644 index 35d97604d6..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchForFacetValuesResponseFacetHits.md +++ /dev/null @@ -1,11 +0,0 @@ -# # SearchForFacetValuesResponseFacetHits - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **string** | Raw value of the facet. | -**highlighted** | **string** | Markup text with occurrences highlighted. | -**count** | **int** | How many objects contain this facet value. This takes into account the extra search parameters specified in the query. Like for a regular search query, the counts may not be exhaustive. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchHits.md b/clients/algoliasearch-client-php/docs/Model/SearchHits.md deleted file mode 100644 index 7ceaf3e1a1..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchHits.md +++ /dev/null @@ -1,9 +0,0 @@ -# # SearchHits - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hits** | [**\Algolia\AlgoliaSearch\Model\Record[]**](Record.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchParams.md b/clients/algoliasearch-client-php/docs/Model/SearchParams.md deleted file mode 100644 index b6b8430a54..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchParams.md +++ /dev/null @@ -1,86 +0,0 @@ -# # SearchParams - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**params** | **string** | Search parameters as URL-encoded query string. | [optional] [default to ''] -**similarQuery** | **string** | Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. | [optional] [default to ''] -**filters** | **string** | Filter the query with numeric, facet and/or tag filters. | [optional] [default to ''] -**facetFilters** | **string[]** | Filter hits by facet value. | [optional] -**optionalFilters** | **string[]** | Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. | [optional] -**numericFilters** | **string[]** | Filter on numeric attributes. | [optional] -**tagFilters** | **string[]** | Filter hits by tags. | [optional] -**sumOrFiltersScores** | **bool** | Determines how to calculate the total score for filtering. | [optional] [default to false] -**facets** | **string[]** | Retrieve facets and their facet values. | [optional] -**maxValuesPerFacet** | **int** | Maximum number of facet values to return for each facet during a regular search. | [optional] [default to 100] -**facetingAfterDistinct** | **bool** | Force faceting to be applied after de-duplication (via the Distinct setting). | [optional] [default to false] -**sortFacetValuesBy** | **string** | Controls how facet values are fetched. | [optional] [default to 'count'] -**page** | **int** | Specify the page to retrieve. | [optional] [default to 0] -**offset** | **int** | Specify the offset of the first hit to return. | [optional] -**length** | **int** | Set the number of hits to retrieve (used only with offset). | [optional] -**aroundLatLng** | **string** | Search for entries around a central geolocation, enabling a geo search within a circular area. | [optional] [default to ''] -**aroundLatLngViaIP** | **bool** | Search for entries around a given location automatically computed from the requester's IP address. | [optional] [default to false] -**aroundRadius** | [**OneOfIntegerString**](OneOfIntegerString.md) | Define the maximum radius for a geo search (in meters). | [optional] -**aroundPrecision** | **int** | Precision of geo search (in meters), to add grouping by geo location to the ranking formula. | [optional] [default to 10] -**minimumAroundRadius** | **int** | Minimum radius (in meters) used for a geo search when aroundRadius is not set. | [optional] -**insideBoundingBox** | **float[]** | Search inside a rectangular area (in geo coordinates). | [optional] -**insidePolygon** | **float[]** | Search inside a polygon (in geo coordinates). | [optional] -**naturalLanguages** | **string[]** | This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. | [optional] -**ruleContexts** | **string[]** | Enables contextual rules. | [optional] -**personalizationImpact** | **int** | Define the impact of the Personalization feature. | [optional] [default to 100] -**userToken** | **string** | Associates a certain user token with the current search. | [optional] -**getRankingInfo** | **bool** | Retrieve detailed ranking information. | [optional] [default to false] -**clickAnalytics** | **bool** | Enable the Click Analytics feature. | [optional] [default to false] -**analytics** | **bool** | Whether the current query will be taken into account in the Analytics. | [optional] [default to true] -**analyticsTags** | **string[]** | List of tags to apply to the query for analytics purposes. | [optional] -**percentileComputation** | **bool** | Whether to include or exclude a query from the processing-time percentile computation. | [optional] [default to true] -**enableABTest** | **bool** | Whether this search should participate in running AB tests. | [optional] [default to true] -**enableReRanking** | **bool** | Whether this search should use AI Re-Ranking. | [optional] [default to true] -**query** | **string** | The text to search in the index. | [default to ''] -**searchableAttributes** | **string[]** | The complete list of attributes used for searching. | [optional] -**attributesForFaceting** | **string[]** | The complete list of attributes that will be used for faceting. | [optional] -**unretrievableAttributes** | **string[]** | List of attributes that can't be retrieved at query time. | [optional] -**attributesToRetrieve** | **string[]** | This parameter controls which attributes to retrieve and which not to retrieve. | [optional] -**restrictSearchableAttributes** | **string[]** | Restricts a given query to look in only a subset of your searchable attributes. | [optional] -**ranking** | **string[]** | Controls how Algolia should sort your results. | [optional] -**customRanking** | **string[]** | Specifies the custom ranking criterion. | [optional] -**relevancyStrictness** | **int** | Controls the relevancy threshold below which less relevant results aren't included in the results. | [optional] [default to 100] -**attributesToHighlight** | **string[]** | List of attributes to highlight. | [optional] -**attributesToSnippet** | **string[]** | List of attributes to snippet, with an optional maximum number of words to snippet. | [optional] -**highlightPreTag** | **string** | The HTML string to insert before the highlighted parts in all highlight and snippet results. | [optional] [default to ''] -**highlightPostTag** | **string** | The HTML string to insert after the highlighted parts in all highlight and snippet results. | [optional] [default to ''] -**snippetEllipsisText** | **string** | String used as an ellipsis indicator when a snippet is truncated. | [optional] [default to '…'] -**restrictHighlightAndSnippetArrays** | **bool** | Restrict highlighting and snippeting to items that matched the query. | [optional] [default to false] -**hitsPerPage** | **int** | Set the number of hits per page. | [optional] [default to 20] -**minWordSizefor1Typo** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 1 typo. | [optional] [default to 4] -**minWordSizefor2Typos** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 2 typos. | [optional] [default to 8] -**typoTolerance** | **string** | Controls whether typo tolerance is enabled and how it is applied. | [optional] [default to 'true'] -**allowTyposOnNumericTokens** | **bool** | Whether to allow typos on numbers (\"numeric tokens\") in the query string. | [optional] [default to true] -**disableTypoToleranceOnAttributes** | **string[]** | List of attributes on which you want to disable typo tolerance. | [optional] -**separatorsToIndex** | **string** | Control which separators are indexed. | [optional] [default to ''] -**ignorePlurals** | **string** | Treats singular, plurals, and other forms of declensions as matching terms. | [optional] [default to 'false'] -**removeStopWords** | **string** | Removes stop (common) words from the query before executing it. | [optional] [default to 'false'] -**keepDiacriticsOnCharacters** | **string** | List of characters that the engine shouldn't automatically normalize. | [optional] [default to ''] -**queryLanguages** | **string[]** | Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. | [optional] -**decompoundQuery** | **bool** | Splits compound words into their composing atoms in the query. | [optional] [default to true] -**enableRules** | **bool** | Whether Rules should be globally enabled. | [optional] [default to true] -**enablePersonalization** | **bool** | Enable the Personalization feature. | [optional] [default to false] -**queryType** | **string** | Controls if and how query words are interpreted as prefixes. | [optional] [default to 'prefixLast'] -**removeWordsIfNoResults** | **string** | Selects a strategy to remove words from the query when it doesn't match any hits. | [optional] [default to 'none'] -**advancedSyntax** | **bool** | Enables the advanced query syntax. | [optional] [default to false] -**optionalWords** | **string[]** | A list of words that should be considered as optional when found in the query. | [optional] -**disableExactOnAttributes** | **string[]** | List of attributes on which you want to disable the exact ranking criterion. | [optional] -**exactOnSingleWordQuery** | **string** | Controls how the exact ranking criterion is computed when the query contains only one word. | [optional] [default to 'attribute'] -**alternativesAsExact** | **string[]** | List of alternatives that should be considered an exact match by the exact ranking criterion. | [optional] -**advancedSyntaxFeatures** | **string[]** | Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. | [optional] -**distinct** | **int** | Enables de-duplication or grouping of results. | [optional] [default to 0] -**synonyms** | **bool** | Whether to take into account an index's synonyms for a particular search. | [optional] [default to true] -**replaceSynonymsInHighlight** | **bool** | Whether to highlight and snippet the original word that matches the synonym or the synonym itself. | [optional] [default to false] -**minProximity** | **int** | Precision of the proximity ranking criterion. | [optional] [default to 1] -**responseFields** | **string[]** | Choose which fields to return in the API response. This parameters applies to search and browse queries. | [optional] -**maxFacetHits** | **int** | Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. | [optional] [default to 10] -**attributeCriteriaComputedByMinProximity** | **bool** | When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. | [optional] [default to false] -**renderingContent** | **object** | Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchParamsObject.md b/clients/algoliasearch-client-php/docs/Model/SearchParamsObject.md deleted file mode 100644 index 8df35e3b47..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchParamsObject.md +++ /dev/null @@ -1,85 +0,0 @@ -# # SearchParamsObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**similarQuery** | **string** | Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. | [optional] [default to ''] -**filters** | **string** | Filter the query with numeric, facet and/or tag filters. | [optional] [default to ''] -**facetFilters** | **string[]** | Filter hits by facet value. | [optional] -**optionalFilters** | **string[]** | Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. | [optional] -**numericFilters** | **string[]** | Filter on numeric attributes. | [optional] -**tagFilters** | **string[]** | Filter hits by tags. | [optional] -**sumOrFiltersScores** | **bool** | Determines how to calculate the total score for filtering. | [optional] [default to false] -**facets** | **string[]** | Retrieve facets and their facet values. | [optional] -**maxValuesPerFacet** | **int** | Maximum number of facet values to return for each facet during a regular search. | [optional] [default to 100] -**facetingAfterDistinct** | **bool** | Force faceting to be applied after de-duplication (via the Distinct setting). | [optional] [default to false] -**sortFacetValuesBy** | **string** | Controls how facet values are fetched. | [optional] [default to 'count'] -**page** | **int** | Specify the page to retrieve. | [optional] [default to 0] -**offset** | **int** | Specify the offset of the first hit to return. | [optional] -**length** | **int** | Set the number of hits to retrieve (used only with offset). | [optional] -**aroundLatLng** | **string** | Search for entries around a central geolocation, enabling a geo search within a circular area. | [optional] [default to ''] -**aroundLatLngViaIP** | **bool** | Search for entries around a given location automatically computed from the requester's IP address. | [optional] [default to false] -**aroundRadius** | [**OneOfIntegerString**](OneOfIntegerString.md) | Define the maximum radius for a geo search (in meters). | [optional] -**aroundPrecision** | **int** | Precision of geo search (in meters), to add grouping by geo location to the ranking formula. | [optional] [default to 10] -**minimumAroundRadius** | **int** | Minimum radius (in meters) used for a geo search when aroundRadius is not set. | [optional] -**insideBoundingBox** | **float[]** | Search inside a rectangular area (in geo coordinates). | [optional] -**insidePolygon** | **float[]** | Search inside a polygon (in geo coordinates). | [optional] -**naturalLanguages** | **string[]** | This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. | [optional] -**ruleContexts** | **string[]** | Enables contextual rules. | [optional] -**personalizationImpact** | **int** | Define the impact of the Personalization feature. | [optional] [default to 100] -**userToken** | **string** | Associates a certain user token with the current search. | [optional] -**getRankingInfo** | **bool** | Retrieve detailed ranking information. | [optional] [default to false] -**clickAnalytics** | **bool** | Enable the Click Analytics feature. | [optional] [default to false] -**analytics** | **bool** | Whether the current query will be taken into account in the Analytics. | [optional] [default to true] -**analyticsTags** | **string[]** | List of tags to apply to the query for analytics purposes. | [optional] -**percentileComputation** | **bool** | Whether to include or exclude a query from the processing-time percentile computation. | [optional] [default to true] -**enableABTest** | **bool** | Whether this search should participate in running AB tests. | [optional] [default to true] -**enableReRanking** | **bool** | Whether this search should use AI Re-Ranking. | [optional] [default to true] -**query** | **string** | The text to search in the index. | [default to ''] -**searchableAttributes** | **string[]** | The complete list of attributes used for searching. | [optional] -**attributesForFaceting** | **string[]** | The complete list of attributes that will be used for faceting. | [optional] -**unretrievableAttributes** | **string[]** | List of attributes that can't be retrieved at query time. | [optional] -**attributesToRetrieve** | **string[]** | This parameter controls which attributes to retrieve and which not to retrieve. | [optional] -**restrictSearchableAttributes** | **string[]** | Restricts a given query to look in only a subset of your searchable attributes. | [optional] -**ranking** | **string[]** | Controls how Algolia should sort your results. | [optional] -**customRanking** | **string[]** | Specifies the custom ranking criterion. | [optional] -**relevancyStrictness** | **int** | Controls the relevancy threshold below which less relevant results aren't included in the results. | [optional] [default to 100] -**attributesToHighlight** | **string[]** | List of attributes to highlight. | [optional] -**attributesToSnippet** | **string[]** | List of attributes to snippet, with an optional maximum number of words to snippet. | [optional] -**highlightPreTag** | **string** | The HTML string to insert before the highlighted parts in all highlight and snippet results. | [optional] [default to ''] -**highlightPostTag** | **string** | The HTML string to insert after the highlighted parts in all highlight and snippet results. | [optional] [default to ''] -**snippetEllipsisText** | **string** | String used as an ellipsis indicator when a snippet is truncated. | [optional] [default to '…'] -**restrictHighlightAndSnippetArrays** | **bool** | Restrict highlighting and snippeting to items that matched the query. | [optional] [default to false] -**hitsPerPage** | **int** | Set the number of hits per page. | [optional] [default to 20] -**minWordSizefor1Typo** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 1 typo. | [optional] [default to 4] -**minWordSizefor2Typos** | **int** | Minimum number of characters a word in the query string must contain to accept matches with 2 typos. | [optional] [default to 8] -**typoTolerance** | **string** | Controls whether typo tolerance is enabled and how it is applied. | [optional] [default to 'true'] -**allowTyposOnNumericTokens** | **bool** | Whether to allow typos on numbers (\"numeric tokens\") in the query string. | [optional] [default to true] -**disableTypoToleranceOnAttributes** | **string[]** | List of attributes on which you want to disable typo tolerance. | [optional] -**separatorsToIndex** | **string** | Control which separators are indexed. | [optional] [default to ''] -**ignorePlurals** | **string** | Treats singular, plurals, and other forms of declensions as matching terms. | [optional] [default to 'false'] -**removeStopWords** | **string** | Removes stop (common) words from the query before executing it. | [optional] [default to 'false'] -**keepDiacriticsOnCharacters** | **string** | List of characters that the engine shouldn't automatically normalize. | [optional] [default to ''] -**queryLanguages** | **string[]** | Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. | [optional] -**decompoundQuery** | **bool** | Splits compound words into their composing atoms in the query. | [optional] [default to true] -**enableRules** | **bool** | Whether Rules should be globally enabled. | [optional] [default to true] -**enablePersonalization** | **bool** | Enable the Personalization feature. | [optional] [default to false] -**queryType** | **string** | Controls if and how query words are interpreted as prefixes. | [optional] [default to 'prefixLast'] -**removeWordsIfNoResults** | **string** | Selects a strategy to remove words from the query when it doesn't match any hits. | [optional] [default to 'none'] -**advancedSyntax** | **bool** | Enables the advanced query syntax. | [optional] [default to false] -**optionalWords** | **string[]** | A list of words that should be considered as optional when found in the query. | [optional] -**disableExactOnAttributes** | **string[]** | List of attributes on which you want to disable the exact ranking criterion. | [optional] -**exactOnSingleWordQuery** | **string** | Controls how the exact ranking criterion is computed when the query contains only one word. | [optional] [default to 'attribute'] -**alternativesAsExact** | **string[]** | List of alternatives that should be considered an exact match by the exact ranking criterion. | [optional] -**advancedSyntaxFeatures** | **string[]** | Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. | [optional] -**distinct** | **int** | Enables de-duplication or grouping of results. | [optional] [default to 0] -**synonyms** | **bool** | Whether to take into account an index's synonyms for a particular search. | [optional] [default to true] -**replaceSynonymsInHighlight** | **bool** | Whether to highlight and snippet the original word that matches the synonym or the synonym itself. | [optional] [default to false] -**minProximity** | **int** | Precision of the proximity ranking criterion. | [optional] [default to 1] -**responseFields** | **string[]** | Choose which fields to return in the API response. This parameters applies to search and browse queries. | [optional] -**maxFacetHits** | **int** | Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. | [optional] [default to 10] -**attributeCriteriaComputedByMinProximity** | **bool** | When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. | [optional] [default to false] -**renderingContent** | **object** | Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchParamsString.md b/clients/algoliasearch-client-php/docs/Model/SearchParamsString.md deleted file mode 100644 index 3e0dbbd57a..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchParamsString.md +++ /dev/null @@ -1,9 +0,0 @@ -# # SearchParamsString - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**params** | **string** | Search parameters as URL-encoded query string. | [optional] [default to ''] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchResponse.md b/clients/algoliasearch-client-php/docs/Model/SearchResponse.md deleted file mode 100644 index bd035d4f1a..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchResponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# # SearchResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**abTestID** | **int** | If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID. | [optional] -**abTestVariantID** | **int** | If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used. | [optional] -**aroundLatLng** | **string** | The computed geo location. | [optional] -**automaticRadius** | **string** | The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. | [optional] -**exhaustiveFacetsCount** | **bool** | Whether the facet count is exhaustive or approximate. | [optional] -**exhaustiveNbHits** | **bool** | Indicate if the nbHits count was exhaustive or approximate | -**exhaustiveTypo** | **bool** | Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) | -**facets** | **array>** | A mapping of each facet name to the corresponding facet counts. | [optional] -**facetsStats** | [**array**](BaseSearchResponseFacetsStats.md) | Statistics for numerical facets. | [optional] -**hitsPerPage** | **int** | Set the number of hits per page. | [default to 20] -**index** | **string** | Index name used for the query. | [optional] -**indexUsed** | **string** | Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. | [optional] -**message** | **string** | Used to return warnings about the query. | [optional] -**nbHits** | **int** | Number of hits that the search query matched. | -**nbPages** | **int** | Number of pages available for the current query | -**nbSortedHits** | **int** | The number of hits selected and sorted by the relevant sort algorithm | [optional] -**page** | **int** | Specify the page to retrieve. | [default to 0] -**params** | **string** | A url-encoded string of all search parameters. | -**parsedQuery** | **string** | The query string that will be searched, after normalization. | [optional] -**processingTimeMS** | **int** | Time the server took to process the request, in milliseconds. | -**query** | **string** | The text to search in the index. | [default to ''] -**queryAfterRemoval** | **string** | A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. | [optional] -**serverUsed** | **string** | Actual host name of the server that processed the request. | [optional] -**userData** | **array** | Lets you store custom data in your indices. | [optional] -**hits** | [**\Algolia\AlgoliaSearch\Model\Record[]**](Record.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchRulesParams.md b/clients/algoliasearch-client-php/docs/Model/SearchRulesParams.md deleted file mode 100644 index 239d32e40d..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchRulesParams.md +++ /dev/null @@ -1,15 +0,0 @@ -# # SearchRulesParams - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**query** | **string** | Full text query. | [optional] [default to ''] -**anchoring** | [**\Algolia\AlgoliaSearch\Model\Anchoring**](Anchoring.md) | | [optional] -**context** | **string** | Restricts matches to contextual rules with a specific context (exact match). | [optional] -**page** | **int** | Requested page (zero-based). | [optional] [default to 0] -**hitsPerPage** | **int** | Maximum number of hits in a page. Minimum is 1, maximum is 1000. | [optional] [default to 20] -**enabled** | **bool** | When specified, restricts matches to rules with a specific enabled status. When absent (default), all rules are retrieved, regardless of their enabled status. | [optional] -**requestOptions** | **array[]** | A mapping of requestOptions to send along with the request. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchRulesResponse.md b/clients/algoliasearch-client-php/docs/Model/SearchRulesResponse.md deleted file mode 100644 index ff916fc82e..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchRulesResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# # SearchRulesResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hits** | [**\Algolia\AlgoliaSearch\Model\Rule[]**](Rule.md) | Fetched rules. | -**nbHits** | **int** | Number of fetched rules. | -**page** | **int** | Current page. | -**nbPages** | **int** | Number of pages. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchSynonymsResponse.md b/clients/algoliasearch-client-php/docs/Model/SearchSynonymsResponse.md deleted file mode 100644 index 9a160e8c7d..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchSynonymsResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# # SearchSynonymsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hits** | [**\Algolia\AlgoliaSearch\Model\SynonymHit[]**](SynonymHit.md) | Array of synonym objects. | -**nbHits** | **int** | Number of hits that the search query matched. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchUserIdsObject.md b/clients/algoliasearch-client-php/docs/Model/SearchUserIdsObject.md deleted file mode 100644 index f0e986492e..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchUserIdsObject.md +++ /dev/null @@ -1,12 +0,0 @@ -# # SearchUserIdsObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**query** | **string** | Query to search. The search is a prefix search with typoTolerance. Use empty query to retrieve all users. | -**clusterName** | **string** | Name of the cluster. | [optional] -**page** | **int** | Specify the page to retrieve. | [optional] [default to 0] -**hitsPerPage** | **int** | Set the number of hits per page. | [optional] [default to 20] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponse.md b/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponse.md deleted file mode 100644 index fcf15b69a1..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponse.md +++ /dev/null @@ -1,13 +0,0 @@ -# # SearchUserIdsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**hits** | [**\Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHits[]**](SearchUserIdsResponseHits.md) | List of user object matching the query. | -**nbHits** | **int** | Number of hits that the search query matched. | -**page** | **int** | Specify the page to retrieve. | [default to 0] -**hitsPerPage** | **int** | Maximum number of hits in a page. Minimum is 1, maximum is 1000. | [default to 20] -**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHighlightResult.md b/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHighlightResult.md deleted file mode 100644 index 191fc1f7c3..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHighlightResult.md +++ /dev/null @@ -1,10 +0,0 @@ -# # SearchUserIdsResponseHighlightResult - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**userID** | [**\Algolia\AlgoliaSearch\Model\HighlightResult**](HighlightResult.md) | | -**clusterName** | [**\Algolia\AlgoliaSearch\Model\HighlightResult**](HighlightResult.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHits.md b/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHits.md deleted file mode 100644 index 9b49743086..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SearchUserIdsResponseHits.md +++ /dev/null @@ -1,14 +0,0 @@ -# # SearchUserIdsResponseHits - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**userID** | [**\Algolia\AlgoliaSearch\Model\UserId**](UserId.md) | | -**clusterName** | **string** | Name of the cluster. | -**nbRecords** | **int** | Number of records in the cluster. | -**dataSize** | **int** | Data size taken by all the users assigned to the cluster. | -**objectID** | **string** | userID of the requested user. Same as userID. | -**highlightResult** | [**\Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHighlightResult**](SearchUserIdsResponseHighlightResult.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SnippetResult.md b/clients/algoliasearch-client-php/docs/Model/SnippetResult.md deleted file mode 100644 index a706605139..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SnippetResult.md +++ /dev/null @@ -1,10 +0,0 @@ -# # SnippetResult - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **string** | Markup text with occurrences highlighted. | [optional] -**matchLevel** | **string** | Indicates how well the attribute matched the search query. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/Source.md b/clients/algoliasearch-client-php/docs/Model/Source.md deleted file mode 100644 index e76b64d7f2..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/Source.md +++ /dev/null @@ -1,10 +0,0 @@ -# # Source - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**source** | **string** | The IP range of the source. | -**description** | **string** | The description of the source. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/StandardEntries.md b/clients/algoliasearch-client-php/docs/Model/StandardEntries.md deleted file mode 100644 index 7209819299..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/StandardEntries.md +++ /dev/null @@ -1,11 +0,0 @@ -# # StandardEntries - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**plurals** | **array** | Language ISO code. | [optional] -**stopwords** | **array** | Language ISO code. | [optional] -**compounds** | **array** | Language ISO code. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SynonymHit.md b/clients/algoliasearch-client-php/docs/Model/SynonymHit.md deleted file mode 100644 index 10a89ddc6c..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SynonymHit.md +++ /dev/null @@ -1,17 +0,0 @@ -# # SynonymHit - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**objectID** | **string** | Unique identifier of the synonym object to be created or updated. | -**type** | **string** | Type of the synonym object. | -**synonyms** | **string[]** | Words or phrases to be considered equivalent. | [optional] -**input** | **string** | Word or phrase to appear in query strings (for onewaysynonym). | [optional] -**word** | **string** | Word or phrase to appear in query strings (for altcorrection1 and altcorrection2). | [optional] -**corrections** | **string[]** | Words to be matched in records. | [optional] -**placeholder** | **string** | Token to be put inside records. | [optional] -**replacements** | **string[]** | List of query words that will match the token. | [optional] -**highlightResult** | [**\Algolia\AlgoliaSearch\Model\SynonymHitHighlightResult**](SynonymHitHighlightResult.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/SynonymHitHighlightResult.md b/clients/algoliasearch-client-php/docs/Model/SynonymHitHighlightResult.md deleted file mode 100644 index b2da6899e8..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/SynonymHitHighlightResult.md +++ /dev/null @@ -1,10 +0,0 @@ -# # SynonymHitHighlightResult - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | [**\Algolia\AlgoliaSearch\Model\HighlightResult**](HighlightResult.md) | | [optional] -**synonyms** | [**\Algolia\AlgoliaSearch\Model\HighlightResult[]**](HighlightResult.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/TimeRange.md b/clients/algoliasearch-client-php/docs/Model/TimeRange.md deleted file mode 100644 index 8ae75b967e..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/TimeRange.md +++ /dev/null @@ -1,10 +0,0 @@ -# # TimeRange - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**from** | **int** | Lower bound of the time range (Unix timestamp). | -**until** | **int** | Upper bound of the time range (Unix timestamp). | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/UpdateApiKeyResponse.md b/clients/algoliasearch-client-php/docs/Model/UpdateApiKeyResponse.md deleted file mode 100644 index 48ed38b6d6..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/UpdateApiKeyResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# # UpdateApiKeyResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**key** | **string** | Key string. | -**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/UpdatedAtResponse.md b/clients/algoliasearch-client-php/docs/Model/UpdatedAtResponse.md deleted file mode 100644 index 3eef1fee3b..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/UpdatedAtResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# # UpdatedAtResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**taskID** | **int** | taskID of the indexing task to wait for. | -**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/UpdatedAtWithObjectIdResponse.md b/clients/algoliasearch-client-php/docs/Model/UpdatedAtWithObjectIdResponse.md deleted file mode 100644 index 49b3a91d06..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/UpdatedAtWithObjectIdResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# # UpdatedAtWithObjectIdResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**taskID** | **int** | taskID of the indexing task to wait for. | [optional] -**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | [optional] -**objectID** | **string** | Unique identifier of the object. | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/UpdatedRuleResponse.md b/clients/algoliasearch-client-php/docs/Model/UpdatedRuleResponse.md deleted file mode 100644 index 77ea91d585..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/UpdatedRuleResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# # UpdatedRuleResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**objectID** | **string** | Unique identifier of the object. | -**updatedAt** | **\DateTime** | Date of last update (ISO-8601 format). | -**taskID** | **int** | taskID of the indexing task to wait for. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/docs/Model/UserId.md b/clients/algoliasearch-client-php/docs/Model/UserId.md deleted file mode 100644 index 8a176f16af..0000000000 --- a/clients/algoliasearch-client-php/docs/Model/UserId.md +++ /dev/null @@ -1,12 +0,0 @@ -# # UserId - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**userID** | **string** | userID of the user. | -**clusterName** | **string** | Cluster on which the user is assigned. | -**nbRecords** | **int** | Number of records belonging to the user. | -**dataSize** | **int** | Data size used by the user. | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/clients/algoliasearch-client-php/git_push.sh b/clients/algoliasearch-client-php/git_push.sh deleted file mode 100644 index 6e0e3126c4..0000000000 --- a/clients/algoliasearch-client-php/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="algolia" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="algolia" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="algoliasearch-client-php" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/clients/algoliasearch-client-php/lib/Api/SearchApi.php b/clients/algoliasearch-client-php/lib/Api/SearchApi.php index 000794e58b..9491959484 100644 --- a/clients/algoliasearch-client-php/lib/Api/SearchApi.php +++ b/clients/algoliasearch-client-php/lib/Api/SearchApi.php @@ -1,29 +1,4 @@ $requestBody The Algolia object. (required) + * @param object $body The Algolia object. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ - public function addOrUpdateObject($indexName, $objectID, $requestBody) + public function addOrUpdateObject($indexName, $objectID, $body) { // verify the required parameter 'indexName' is set if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { @@ -203,10 +176,10 @@ public function addOrUpdateObject($indexName, $objectID, $requestBody) 'Missing the required parameter $objectID when calling addOrUpdateObject' ); } - // verify the required parameter 'requestBody' is set - if ($requestBody === null || (is_array($requestBody) && count($requestBody) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $requestBody when calling addOrUpdateObject' + 'Missing the required parameter $body when calling addOrUpdateObject' ); } @@ -234,8 +207,8 @@ public function addOrUpdateObject($indexName, $objectID, $requestBody) ['application/json'], ['application/json'] ); - if (isset($requestBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($requestBody)); + if (isset($body)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body)); } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); @@ -343,7 +316,7 @@ public function appendSource($source) * * Assign or Move userID * - * @param object $xAlgoliaUserID userID to assign. (required) + * @param string $xAlgoliaUserID userID to assign. (required) * @param \Algolia\AlgoliaSearch\Model\AssignUserIdObject $assignUserIdObject assignUserIdObject (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response @@ -358,6 +331,10 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdObject) 'Missing the required parameter $xAlgoliaUserID when calling assignUserId' ); } + if (!preg_match("/^[a-zA-Z0-9 \\-*.]+$/", $xAlgoliaUserID)) { + throw new \InvalidArgumentException("invalid value for \"xAlgoliaUserID\" when calling SearchApi.assignUserId, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."); + } + // verify the required parameter 'assignUserIdObject' is set if ($assignUserIdObject === null || (is_array($assignUserIdObject) && count($assignUserIdObject) === 0)) { throw new \InvalidArgumentException( @@ -504,7 +481,7 @@ public function batch($indexName, $batchWriteObject) * * Batch assign userIDs * - * @param object $xAlgoliaUserID userID to assign. (required) + * @param string $xAlgoliaUserID userID to assign. (required) * @param \Algolia\AlgoliaSearch\Model\BatchAssignUserIdsObject $batchAssignUserIdsObject batchAssignUserIdsObject (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response @@ -519,6 +496,10 @@ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject) 'Missing the required parameter $xAlgoliaUserID when calling batchAssignUserIds' ); } + if (!preg_match("/^[a-zA-Z0-9 \\-*.]+$/", $xAlgoliaUserID)) { + throw new \InvalidArgumentException("invalid value for \"xAlgoliaUserID\" when calling SearchApi.batchAssignUserIds, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."); + } + // verify the required parameter 'batchAssignUserIdsObject' is set if ($batchAssignUserIdsObject === null || (is_array($batchAssignUserIdsObject) && count($batchAssignUserIdsObject) === 0)) { throw new \InvalidArgumentException( @@ -2526,7 +2507,7 @@ public function getTopUserIds() * * Get userID * - * @param object $userID userID to assign. (required) + * @param string $userID userID to assign. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2540,6 +2521,10 @@ public function getUserId($userID) 'Missing the required parameter $userID when calling getUserId' ); } + if (!preg_match("/^[a-zA-Z0-9 \\-*.]+$/", $userID)) { + throw new \InvalidArgumentException("invalid value for \"userID\" when calling SearchApi.getUserId, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."); + } + $resourcePath = '/1/clusters/mapping/{userID}'; $queryParams = []; @@ -2795,7 +2780,7 @@ public function listIndices($page = null) $page = ObjectSerializer::serializeCollection($page, '', true); } if ($page !== null) { - $queryParams['Page'] = $page; + $queryParams['page'] = $page; } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -2861,7 +2846,7 @@ public function listUserIds($page = null, $hitsPerPage = 100) $page = ObjectSerializer::serializeCollection($page, '', true); } if ($page !== null) { - $queryParams['Page'] = $page; + $queryParams['page'] = $page; } // query params if (is_array($hitsPerPage)) { @@ -3232,7 +3217,7 @@ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOp * * Remove userID * - * @param object $userID userID to assign. (required) + * @param string $userID userID to assign. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -3246,6 +3231,10 @@ public function removeUserId($userID) 'Missing the required parameter $userID when calling removeUserId' ); } + if (!preg_match("/^[a-zA-Z0-9 \\-*.]+$/", $userID)) { + throw new \InvalidArgumentException("invalid value for \"userID\" when calling SearchApi.removeUserId, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."); + } + $resourcePath = '/1/clusters/mapping/{userID}'; $queryParams = []; @@ -3440,13 +3429,13 @@ public function restoreApiKey($key) * Operation saveObject * * @param string $indexName The index in which to perform the request. (required) - * @param array $requestBody The Algolia object. (required) + * @param object $body The Algolia object. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Algolia\AlgoliaSearch\Model\SaveObjectResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ - public function saveObject($indexName, $requestBody) + public function saveObject($indexName, $body) { // verify the required parameter 'indexName' is set if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { @@ -3454,10 +3443,10 @@ public function saveObject($indexName, $requestBody) 'Missing the required parameter $indexName when calling saveObject' ); } - // verify the required parameter 'requestBody' is set - if ($requestBody === null || (is_array($requestBody) && count($requestBody) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $requestBody when calling saveObject' + 'Missing the required parameter $body when calling saveObject' ); } @@ -3477,8 +3466,8 @@ public function saveObject($indexName, $requestBody) ['application/json'], ['application/json'] ); - if (isset($requestBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($requestBody)); + if (isset($body)) { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body)); } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); @@ -4206,7 +4195,7 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $page = ObjectSerializer::serializeCollection($page, '', true); } if ($page !== null) { - $queryParams['Page'] = $page; + $queryParams['page'] = $page; } // query params if (is_array($hitsPerPage)) { diff --git a/clients/algoliasearch-client-php/lib/ApiException.php b/clients/algoliasearch-client-php/lib/ApiException.php index 15b171f871..0f80549494 100644 --- a/clients/algoliasearch-client-php/lib/ApiException.php +++ b/clients/algoliasearch-client-php/lib/ApiException.php @@ -1,29 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/Anchoring.php b/clients/algoliasearch-client-php/lib/Model/Anchoring.php index c40e959f29..7760ddb377 100644 --- a/clients/algoliasearch-client-php/lib/Model/Anchoring.php +++ b/clients/algoliasearch-client-php/lib/Model/Anchoring.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php b/clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php index ded86b4c6a..d46ef38fc3 100644 --- a/clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php +++ b/clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/AutomaticFacetFilter.php b/clients/algoliasearch-client-php/lib/Model/AutomaticFacetFilter.php index 00dc6ff019..9f4acf5062 100644 --- a/clients/algoliasearch-client-php/lib/Model/AutomaticFacetFilter.php +++ b/clients/algoliasearch-client-php/lib/Model/AutomaticFacetFilter.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/BaseBrowseResponse.php b/clients/algoliasearch-client-php/lib/Model/BaseBrowseResponse.php index 178d83ae52..fead53a789 100644 --- a/clients/algoliasearch-client-php/lib/Model/BaseBrowseResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/BaseBrowseResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/BaseIndexSettings.php b/clients/algoliasearch-client-php/lib/Model/BaseIndexSettings.php index de9e79b577..80195a5625 100644 --- a/clients/algoliasearch-client-php/lib/Model/BaseIndexSettings.php +++ b/clients/algoliasearch-client-php/lib/Model/BaseIndexSettings.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null @@ -64,13 +36,13 @@ class BaseIndexSettings implements ModelInterface, ArrayAccess, \JsonSerializabl 'disableTypoToleranceOnWords' => 'string[]', 'attributesToTransliterate' => 'string[]', 'camelCaseAttributes' => 'string[]', - 'decompoundedAttributes' => 'array', + 'decompoundedAttributes' => 'object', 'indexLanguages' => 'string[]', 'filterPromotes' => 'bool', 'disablePrefixOnAttributes' => 'string[]', 'allowCompressionOfIntegerArray' => 'bool', 'numericAttributesForFiltering' => 'string[]', - 'userData' => 'array' + 'userData' => 'object' ]; /** @@ -394,7 +366,7 @@ public function setCamelCaseAttributes($camelCaseAttributes) /** * Gets decompoundedAttributes * - * @return array|null + * @return object|null */ public function getDecompoundedAttributes() { @@ -404,7 +376,7 @@ public function getDecompoundedAttributes() /** * Sets decompoundedAttributes * - * @param array|null $decompoundedAttributes Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding. + * @param object|null $decompoundedAttributes Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding. * * @return self */ @@ -538,7 +510,7 @@ public function setNumericAttributesForFiltering($numericAttributesForFiltering) /** * Gets userData * - * @return array|null + * @return object|null */ public function getUserData() { @@ -548,7 +520,7 @@ public function getUserData() /** * Sets userData * - * @param array|null $userData Lets you store custom data in your indices. + * @param object|null $userData Lets you store custom data in your indices. * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/BaseSearchParams.php b/clients/algoliasearch-client-php/lib/Model/BaseSearchParams.php index 32b0541ebe..bf573dc75a 100644 --- a/clients/algoliasearch-client-php/lib/Model/BaseSearchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/BaseSearchParams.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/BaseSearchResponse.php b/clients/algoliasearch-client-php/lib/Model/BaseSearchResponse.php index b8ff03fe36..37b4705831 100644 --- a/clients/algoliasearch-client-php/lib/Model/BaseSearchResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/BaseSearchResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null @@ -82,7 +54,7 @@ class BaseSearchResponse implements ModelInterface, ArrayAccess, \JsonSerializab 'query' => 'string', 'queryAfterRemoval' => 'string', 'serverUsed' => 'string', - 'userData' => 'array' + 'userData' => 'object' ]; /** @@ -934,7 +906,7 @@ public function setServerUsed($serverUsed) /** * Gets userData * - * @return array|null + * @return object|null */ public function getUserData() { @@ -944,7 +916,7 @@ public function getUserData() /** * Sets userData * - * @param array|null $userData Lets you store custom data in your indices. + * @param object|null $userData Lets you store custom data in your indices. * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php b/clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php index fb78c548dc..2d97e8e94b 100644 --- a/clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php +++ b/clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php b/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php index 9939f1015d..43c76dd3dd 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php +++ b/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntries.php b/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntries.php index c9ca304c73..8c5a853c0e 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntries.php +++ b/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntries.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php b/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php index 8e4b221878..073e38595f 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php +++ b/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/BatchObject.php b/clients/algoliasearch-client-php/lib/Model/BatchObject.php index 248a8ba594..815e85b5cb 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchObject.php +++ b/clients/algoliasearch-client-php/lib/Model/BatchObject.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/BatchResponse.php b/clients/algoliasearch-client-php/lib/Model/BatchResponse.php index b77b09a47e..ad20982c93 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/BatchResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php b/clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php index 3e8118482f..896d0c3b8f 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php +++ b/clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/BrowseRequest.php b/clients/algoliasearch-client-php/lib/Model/BrowseRequest.php index 2e256bb0c1..8c2728944a 100644 --- a/clients/algoliasearch-client-php/lib/Model/BrowseRequest.php +++ b/clients/algoliasearch-client-php/lib/Model/BrowseRequest.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php b/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php index d6907dde12..389fa30b65 100644 --- a/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null @@ -82,7 +54,7 @@ class BrowseResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'query' => 'string', 'queryAfterRemoval' => 'string', 'serverUsed' => 'string', - 'userData' => 'array', + 'userData' => 'object', 'hits' => '\Algolia\AlgoliaSearch\Model\Record[]', 'cursor' => 'string' ]; @@ -952,7 +924,7 @@ public function setServerUsed($serverUsed) /** * Gets userData * - * @return array|null + * @return object|null */ public function getUserData() { @@ -962,7 +934,7 @@ public function getUserData() /** * Sets userData * - * @param array|null $userData Lets you store custom data in your indices. + * @param object|null $userData Lets you store custom data in your indices. * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/BuildInOperation.php b/clients/algoliasearch-client-php/lib/Model/BuildInOperation.php index df6817f512..3812d64acb 100644 --- a/clients/algoliasearch-client-php/lib/Model/BuildInOperation.php +++ b/clients/algoliasearch-client-php/lib/Model/BuildInOperation.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/Condition.php b/clients/algoliasearch-client-php/lib/Model/Condition.php index 42f3485a1f..56abe62cb6 100644 --- a/clients/algoliasearch-client-php/lib/Model/Condition.php +++ b/clients/algoliasearch-client-php/lib/Model/Condition.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/Consequence.php b/clients/algoliasearch-client-php/lib/Model/Consequence.php index 806b66a146..5399db7de5 100644 --- a/clients/algoliasearch-client-php/lib/Model/Consequence.php +++ b/clients/algoliasearch-client-php/lib/Model/Consequence.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null @@ -64,7 +36,7 @@ class Consequence implements ModelInterface, ArrayAccess, \JsonSerializable 'promote' => '\Algolia\AlgoliaSearch\Model\Promote[]', 'filterPromotes' => 'bool', 'hide' => '\Algolia\AlgoliaSearch\Model\ConsequenceHide[]', - 'userData' => 'array' + 'userData' => 'object' ]; /** @@ -329,7 +301,7 @@ public function setHide($hide) /** * Gets userData * - * @return array|null + * @return object|null */ public function getUserData() { @@ -339,7 +311,7 @@ public function getUserData() /** * Sets userData * - * @param array|null $userData Custom JSON object that will be appended to the userData array in the response. This object isn't interpreted by the API. It's limited to 1kB of minified JSON. + * @param object|null $userData Custom JSON object that will be appended to the userData array in the response. This object isn't interpreted by the API. It's limited to 1kB of minified JSON. * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php b/clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php index b39c4de520..35fcc49b7b 100644 --- a/clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php +++ b/clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/ConsequenceParams.php b/clients/algoliasearch-client-php/lib/Model/ConsequenceParams.php index 3c4dbec7ff..1d45a92a8a 100644 --- a/clients/algoliasearch-client-php/lib/Model/ConsequenceParams.php +++ b/clients/algoliasearch-client-php/lib/Model/ConsequenceParams.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php b/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php index 367591485d..0aa84a34c1 100644 --- a/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php +++ b/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php index 0fb610a418..315a5ae358 100644 --- a/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php b/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php index 7b8ddaf81b..91a0261797 100644 --- a/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php b/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php index cb32c5defd..0d93123442 100644 --- a/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php index 530c8f920c..7877e7405a 100644 --- a/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/DictionaryEntry.php b/clients/algoliasearch-client-php/lib/Model/DictionaryEntry.php index 851c93823c..5f82ce427d 100644 --- a/clients/algoliasearch-client-php/lib/Model/DictionaryEntry.php +++ b/clients/algoliasearch-client-php/lib/Model/DictionaryEntry.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/DictionaryLanguage.php b/clients/algoliasearch-client-php/lib/Model/DictionaryLanguage.php index a35e519a75..fca61ce2e7 100644 --- a/clients/algoliasearch-client-php/lib/Model/DictionaryLanguage.php +++ b/clients/algoliasearch-client-php/lib/Model/DictionaryLanguage.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/DictionarySettingsRequest.php b/clients/algoliasearch-client-php/lib/Model/DictionarySettingsRequest.php index 2ae285a938..598f8285e6 100644 --- a/clients/algoliasearch-client-php/lib/Model/DictionarySettingsRequest.php +++ b/clients/algoliasearch-client-php/lib/Model/DictionarySettingsRequest.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/ErrorBase.php b/clients/algoliasearch-client-php/lib/Model/ErrorBase.php index 98300434b8..53696972f2 100644 --- a/clients/algoliasearch-client-php/lib/Model/ErrorBase.php +++ b/clients/algoliasearch-client-php/lib/Model/ErrorBase.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/GetDictionarySettingsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetDictionarySettingsResponse.php index 2a5405a2d8..d946c1d7b9 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetDictionarySettingsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/GetDictionarySettingsResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php index b468af9f20..c2e0033e7d 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php b/clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php index a482907374..a895461a73 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php +++ b/clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/GetLogsResponseLogs.php b/clients/algoliasearch-client-php/lib/Model/GetLogsResponseLogs.php index 2f90ed8771..1c30d989b3 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetLogsResponseLogs.php +++ b/clients/algoliasearch-client-php/lib/Model/GetLogsResponseLogs.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php b/clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php index 9b76770799..7e4184184d 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php +++ b/clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php index da1bdf3842..3e54417691 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null @@ -59,7 +31,7 @@ class GetObjectsResponse implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'results' => 'array[]' + 'results' => 'object[]' ]; /** @@ -208,7 +180,7 @@ public function valid() /** * Gets results * - * @return array[]|null + * @return object[]|null */ public function getResults() { @@ -218,7 +190,7 @@ public function getResults() /** * Sets results * - * @param array[]|null $results List of results fetched. + * @param object[]|null $results List of results fetched. * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetTaskResponse.php b/clients/algoliasearch-client-php/lib/Model/GetTaskResponse.php index 5f8b468df3..5f11816c35 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetTaskResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/GetTaskResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopUserIdsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetTopUserIdsResponse.php index 49fd97006e..138d5abf2f 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetTopUserIdsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/GetTopUserIdsResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/HighlightResult.php b/clients/algoliasearch-client-php/lib/Model/HighlightResult.php index 97e837b72d..129b4740ed 100644 --- a/clients/algoliasearch-client-php/lib/Model/HighlightResult.php +++ b/clients/algoliasearch-client-php/lib/Model/HighlightResult.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/Index.php b/clients/algoliasearch-client-php/lib/Model/Index.php index f559b89d5f..03a2871dcd 100644 --- a/clients/algoliasearch-client-php/lib/Model/Index.php +++ b/clients/algoliasearch-client-php/lib/Model/Index.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/IndexSettings.php b/clients/algoliasearch-client-php/lib/Model/IndexSettings.php index 17caf45d65..01ea27278c 100644 --- a/clients/algoliasearch-client-php/lib/Model/IndexSettings.php +++ b/clients/algoliasearch-client-php/lib/Model/IndexSettings.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null @@ -65,13 +37,13 @@ class IndexSettings implements ModelInterface, ArrayAccess, \JsonSerializable 'disableTypoToleranceOnWords' => 'string[]', 'attributesToTransliterate' => 'string[]', 'camelCaseAttributes' => 'string[]', - 'decompoundedAttributes' => 'array', + 'decompoundedAttributes' => 'object', 'indexLanguages' => 'string[]', 'filterPromotes' => 'bool', 'disablePrefixOnAttributes' => 'string[]', 'allowCompressionOfIntegerArray' => 'bool', 'numericAttributesForFiltering' => 'string[]', - 'userData' => 'array', + 'userData' => 'object', 'searchableAttributes' => 'string[]', 'attributesForFaceting' => 'string[]', 'unretrievableAttributes' => 'string[]', @@ -819,7 +791,7 @@ public function setCamelCaseAttributes($camelCaseAttributes) /** * Gets decompoundedAttributes * - * @return array|null + * @return object|null */ public function getDecompoundedAttributes() { @@ -829,7 +801,7 @@ public function getDecompoundedAttributes() /** * Sets decompoundedAttributes * - * @param array|null $decompoundedAttributes Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding. + * @param object|null $decompoundedAttributes Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding. * * @return self */ @@ -963,7 +935,7 @@ public function setNumericAttributesForFiltering($numericAttributesForFiltering) /** * Gets userData * - * @return array|null + * @return object|null */ public function getUserData() { @@ -973,7 +945,7 @@ public function getUserData() /** * Sets userData * - * @param array|null $userData Lets you store custom data in your indices. + * @param object|null $userData Lets you store custom data in your indices. * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/IndexSettingsAsSearchParams.php b/clients/algoliasearch-client-php/lib/Model/IndexSettingsAsSearchParams.php index 291be1b686..1672b402c3 100644 --- a/clients/algoliasearch-client-php/lib/Model/IndexSettingsAsSearchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/IndexSettingsAsSearchParams.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/KeyObject.php b/clients/algoliasearch-client-php/lib/Model/KeyObject.php index 070d8b2f0f..68429a2485 100644 --- a/clients/algoliasearch-client-php/lib/Model/KeyObject.php +++ b/clients/algoliasearch-client-php/lib/Model/KeyObject.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/Languages.php b/clients/algoliasearch-client-php/lib/Model/Languages.php index d760c70ecc..373bef4ce2 100644 --- a/clients/algoliasearch-client-php/lib/Model/Languages.php +++ b/clients/algoliasearch-client-php/lib/Model/Languages.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php b/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php index 82807ca45e..6ffa69ff60 100644 --- a/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php b/clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php index 14f50b8b27..da37124416 100644 --- a/clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php b/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php index f51013b74d..2177f69f96 100644 --- a/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php b/clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php index cfbc3d2bab..64b26c1d72 100644 --- a/clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/ModelInterface.php b/clients/algoliasearch-client-php/lib/Model/ModelInterface.php index 0168035fb2..a9505a67e5 100644 --- a/clients/algoliasearch-client-php/lib/Model/ModelInterface.php +++ b/clients/algoliasearch-client-php/lib/Model/ModelInterface.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null @@ -59,7 +31,7 @@ class MultipleBatchResponse implements ModelInterface, ArrayAccess, \JsonSeriali * @var string[] */ protected static $openAPITypes = [ - 'taskID' => 'array', + 'taskID' => 'object', 'objectIDs' => 'string[]' ]; @@ -214,7 +186,7 @@ public function valid() /** * Gets taskID * - * @return array|null + * @return object|null */ public function getTaskID() { @@ -224,7 +196,7 @@ public function getTaskID() /** * Sets taskID * - * @param array|null $taskID List of tasksIDs per index. + * @param object|null $taskID List of tasksIDs per index. * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php b/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php index b6bedbd847..ab47ce8284 100644 --- a/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php +++ b/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php b/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php index 78c03e207f..f29705e627 100644 --- a/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php +++ b/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php index 364d2bbff2..448a05f979 100644 --- a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php +++ b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php index a3ae8a211a..a5109a497d 100644 --- a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/Operation.php b/clients/algoliasearch-client-php/lib/Model/Operation.php index 6acd193b41..8683c73b1b 100644 --- a/clients/algoliasearch-client-php/lib/Model/Operation.php +++ b/clients/algoliasearch-client-php/lib/Model/Operation.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null @@ -60,7 +32,7 @@ class Operation implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'action' => '\Algolia\AlgoliaSearch\Model\Action', - 'body' => 'array', + 'body' => 'object', 'indexName' => 'string' ]; @@ -244,7 +216,7 @@ public function setAction($action) /** * Gets body * - * @return array|null + * @return object|null */ public function getBody() { @@ -254,7 +226,7 @@ public function getBody() /** * Sets body * - * @param array|null $body arguments to the operation (depends on the type of the operation). + * @param object|null $body arguments to the operation (depends on the type of the operation). * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php b/clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php index c159e57455..6ce1064869 100644 --- a/clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php +++ b/clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/Params.php b/clients/algoliasearch-client-php/lib/Model/Params.php index ce0b7bf720..91841228dc 100644 --- a/clients/algoliasearch-client-php/lib/Model/Params.php +++ b/clients/algoliasearch-client-php/lib/Model/Params.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/Promote.php b/clients/algoliasearch-client-php/lib/Model/Promote.php index a13cdd05ff..14718b1d2c 100644 --- a/clients/algoliasearch-client-php/lib/Model/Promote.php +++ b/clients/algoliasearch-client-php/lib/Model/Promote.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/RankingInfo.php b/clients/algoliasearch-client-php/lib/Model/RankingInfo.php index 64b80f554a..03196a4eb5 100644 --- a/clients/algoliasearch-client-php/lib/Model/RankingInfo.php +++ b/clients/algoliasearch-client-php/lib/Model/RankingInfo.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php b/clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php index aa50e9c526..40e0ff224f 100644 --- a/clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php +++ b/clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/Record.php b/clients/algoliasearch-client-php/lib/Model/Record.php index 74f975408c..cc58da5171 100644 --- a/clients/algoliasearch-client-php/lib/Model/Record.php +++ b/clients/algoliasearch-client-php/lib/Model/Record.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php b/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php index cfdc2bb649..0c70495abb 100644 --- a/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php b/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php index 86e2e46303..2b7487736e 100644 --- a/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/RequiredSearchParams.php b/clients/algoliasearch-client-php/lib/Model/RequiredSearchParams.php index f867b7bc15..180e14b0cd 100644 --- a/clients/algoliasearch-client-php/lib/Model/RequiredSearchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/RequiredSearchParams.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/Rule.php b/clients/algoliasearch-client-php/lib/Model/Rule.php index 208a43c287..ff0c3fb926 100644 --- a/clients/algoliasearch-client-php/lib/Model/Rule.php +++ b/clients/algoliasearch-client-php/lib/Model/Rule.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php b/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php index d16eb8b9e8..4b894609d1 100644 --- a/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php b/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php index 528986e0fa..5781c715c7 100644 --- a/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SearchDictionaryEntries.php b/clients/algoliasearch-client-php/lib/Model/SearchDictionaryEntries.php index 899ca3a393..1db78c1742 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchDictionaryEntries.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchDictionaryEntries.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesRequest.php b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesRequest.php index 68c4966f2b..9ab47c9980 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesRequest.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesRequest.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponse.php index 224d294af8..7f1bfa58fa 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php index 0213a8da2f..0b4efb1a49 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SearchHits.php b/clients/algoliasearch-client-php/lib/Model/SearchHits.php index af0410537b..98d474deaf 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchHits.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchHits.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SearchParams.php b/clients/algoliasearch-client-php/lib/Model/SearchParams.php index 8de21015f4..184d6356e4 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchParams.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SearchParamsObject.php b/clients/algoliasearch-client-php/lib/Model/SearchParamsObject.php index aa4e7fe7a6..49956dd09f 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchParamsObject.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchParamsObject.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SearchParamsString.php b/clients/algoliasearch-client-php/lib/Model/SearchParamsString.php index 75f8d497f1..ad130c49c8 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchParamsString.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchParamsString.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SearchResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchResponse.php index dcc62da8fa..f5adcaad07 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null @@ -82,7 +54,7 @@ class SearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'query' => 'string', 'queryAfterRemoval' => 'string', 'serverUsed' => 'string', - 'userData' => 'array', + 'userData' => 'object', 'hits' => '\Algolia\AlgoliaSearch\Model\Record[]' ]; @@ -943,7 +915,7 @@ public function setServerUsed($serverUsed) /** * Gets userData * - * @return array|null + * @return object|null */ public function getUserData() { @@ -953,7 +925,7 @@ public function getUserData() /** * Sets userData * - * @param array|null $userData Lets you store custom data in your indices. + * @param object|null $userData Lets you store custom data in your indices. * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php b/clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php index 46ffd28a58..604d9db2ea 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null @@ -66,7 +38,7 @@ class SearchRulesParams implements ModelInterface, ArrayAccess, \JsonSerializabl 'page' => 'int', 'hitsPerPage' => 'int', 'enabled' => 'bool', - 'requestOptions' => 'array[]' + 'requestOptions' => 'object[]' ]; /** @@ -389,7 +361,7 @@ public function setEnabled($enabled) /** * Gets requestOptions * - * @return array[]|null + * @return object[]|null */ public function getRequestOptions() { @@ -399,7 +371,7 @@ public function getRequestOptions() /** * Sets requestOptions * - * @param array[]|null $requestOptions A mapping of requestOptions to send along with the request. + * @param object[]|null $requestOptions A mapping of requestOptions to send along with the request. * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php index 4bc7436af7..2bfe6387a8 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php index c0826af49e..95e04a6329 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php index 2996cbd0a9..2db6a4eb66 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php index 7a3c0f192a..3c0a3ddf23 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php index 8a715a3f28..c51f5eb88d 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php index a57b79c5e7..66c19bf600 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SnippetResult.php b/clients/algoliasearch-client-php/lib/Model/SnippetResult.php index 458bdf5bda..a508bd46e3 100644 --- a/clients/algoliasearch-client-php/lib/Model/SnippetResult.php +++ b/clients/algoliasearch-client-php/lib/Model/SnippetResult.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/Source.php b/clients/algoliasearch-client-php/lib/Model/Source.php index 09cdc934d6..f78c6ba8fe 100644 --- a/clients/algoliasearch-client-php/lib/Model/Source.php +++ b/clients/algoliasearch-client-php/lib/Model/Source.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/StandardEntries.php b/clients/algoliasearch-client-php/lib/Model/StandardEntries.php index 6901a48bff..88e8918f9f 100644 --- a/clients/algoliasearch-client-php/lib/Model/StandardEntries.php +++ b/clients/algoliasearch-client-php/lib/Model/StandardEntries.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SynonymHit.php b/clients/algoliasearch-client-php/lib/Model/SynonymHit.php index 31f9c859a1..cab013367c 100644 --- a/clients/algoliasearch-client-php/lib/Model/SynonymHit.php +++ b/clients/algoliasearch-client-php/lib/Model/SynonymHit.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php b/clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php index ada56d25e7..5fc7fac8f2 100644 --- a/clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php +++ b/clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/TimeRange.php b/clients/algoliasearch-client-php/lib/Model/TimeRange.php index 5235fe9265..d9b5b8ff4d 100644 --- a/clients/algoliasearch-client-php/lib/Model/TimeRange.php +++ b/clients/algoliasearch-client-php/lib/Model/TimeRange.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php index 3d2d221580..9030ab6488 100644 --- a/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php index bee6877cc6..cc85dcb1ac 100644 --- a/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php index 4c12643092..49fafad1cf 100644 --- a/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php index b78f7f711a..2cc041c7a4 100644 --- a/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/Model/UserId.php b/clients/algoliasearch-client-php/lib/Model/UserId.php index c501110e69..84d828f010 100644 --- a/clients/algoliasearch-client-php/lib/Model/UserId.php +++ b/clients/algoliasearch-client-php/lib/Model/UserId.php @@ -1,30 +1,4 @@ * @template TKey int|null * @template TValue mixed|null diff --git a/clients/algoliasearch-client-php/lib/ObjectSerializer.php b/clients/algoliasearch-client-php/lib/ObjectSerializer.php index f22e39a458..25900ca3fa 100644 --- a/clients/algoliasearch-client-php/lib/ObjectSerializer.php +++ b/clients/algoliasearch-client-php/lib/ObjectSerializer.php @@ -1,30 +1,4 @@ - - - - ./lib/Api - ./lib/Model - - - - - ./test/Api - ./test/Model - - - - - - diff --git a/clients/algoliasearch-client-php/test/Api/SearchApiTest.php b/clients/algoliasearch-client-php/test/Api/SearchApiTest.php deleted file mode 100644 index be62bc69f4..0000000000 --- a/clients/algoliasearch-client-php/test/Api/SearchApiTest.php +++ /dev/null @@ -1,757 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test case for addOrUpdateObject - * - * Add or replace an object with a given object ID.. - * - */ - public function testAddOrUpdateObject() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for appendSource - * - * . - * - */ - public function testAppendSource() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for assignUserId - * - * Assign or Move userID. - * - */ - public function testAssignUserId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for batch - * - * . - * - */ - public function testBatch() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for batchAssignUserIds - * - * Batch assign userIDs. - * - */ - public function testBatchAssignUserIds() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for batchDictionaryEntries - * - * Send a batch of dictionary entries.. - * - */ - public function testBatchDictionaryEntries() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for batchRules - * - * Batch Rules.. - * - */ - public function testBatchRules() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for browse - * - * Retrieve all index content.. - * - */ - public function testBrowse() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for clearAllSynonyms - * - * Clear all synonyms.. - * - */ - public function testClearAllSynonyms() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for clearObjects - * - * clear all objects from an index.. - * - */ - public function testClearObjects() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for clearRules - * - * Clear Rules.. - * - */ - public function testClearRules() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for deleteApiKey - * - * Delete an API key.. - * - */ - public function testDeleteApiKey() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for deleteBy - * - * Delete all records matching the query.. - * - */ - public function testDeleteBy() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for deleteIndex - * - * Delete index.. - * - */ - public function testDeleteIndex() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for deleteObject - * - * Delete object.. - * - */ - public function testDeleteObject() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for deleteRule - * - * Delete a rule.. - * - */ - public function testDeleteRule() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for deleteSource - * - * . - * - */ - public function testDeleteSource() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for deleteSynonym - * - * Delete synonym.. - * - */ - public function testDeleteSynonym() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for getApiKey - * - * Get an API key.. - * - */ - public function testGetApiKey() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for getDictionaryLanguages - * - * List dictionaries supported per language.. - * - */ - public function testGetDictionaryLanguages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for getDictionarySettings - * - * Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values.. - * - */ - public function testGetDictionarySettings() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for getLogs - * - * . - * - */ - public function testGetLogs() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for getObject - * - * Retrieve one object from the index.. - * - */ - public function testGetObject() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for getObjects - * - * Retrieve one or more objects.. - * - */ - public function testGetObjects() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for getRule - * - * Get a rule.. - * - */ - public function testGetRule() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for getSettings - * - * . - * - */ - public function testGetSettings() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for getSources - * - * . - * - */ - public function testGetSources() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for getSynonym - * - * Get synonym.. - * - */ - public function testGetSynonym() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for getTask - * - * . - * - */ - public function testGetTask() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for getTopUserIds - * - * Get top userID. - * - */ - public function testGetTopUserIds() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for getUserId - * - * Get userID. - * - */ - public function testGetUserId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for hasPendingMappings - * - * Has pending mappings. - * - */ - public function testHasPendingMappings() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for listApiKeys - * - * Get the full list of API Keys.. - * - */ - public function testListApiKeys() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for listClusters - * - * List clusters. - * - */ - public function testListClusters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for listIndices - * - * List existing indexes.. - * - */ - public function testListIndices() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for listUserIds - * - * List userIDs. - * - */ - public function testListUserIds() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for multipleBatch - * - * . - * - */ - public function testMultipleBatch() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for multipleQueries - * - * . - * - */ - public function testMultipleQueries() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for operationIndex - * - * Copy/move index.. - * - */ - public function testOperationIndex() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for partialUpdateObject - * - * Partially update an object.. - * - */ - public function testPartialUpdateObject() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for removeUserId - * - * Remove userID. - * - */ - public function testRemoveUserId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for replaceSources - * - * . - * - */ - public function testReplaceSources() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for restoreApiKey - * - * Restore an API key.. - * - */ - public function testRestoreApiKey() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for saveObject - * - * . - * - */ - public function testSaveObject() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for saveRule - * - * Save/Update a rule.. - * - */ - public function testSaveRule() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for saveSynonym - * - * Save synonym.. - * - */ - public function testSaveSynonym() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for saveSynonyms - * - * Save a batch of synonyms.. - * - */ - public function testSaveSynonyms() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for search - * - * . - * - */ - public function testSearch() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for searchDictionaryEntries - * - * Search the dictionary entries.. - * - */ - public function testSearchDictionaryEntries() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for searchForFacetValues - * - * Search for values of a given facet. - * - */ - public function testSearchForFacetValues() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for searchRules - * - * Search for rules.. - * - */ - public function testSearchRules() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for searchSynonyms - * - * Get all synonyms that match a query.. - * - */ - public function testSearchSynonyms() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for searchUserIds - * - * Search userID. - * - */ - public function testSearchUserIds() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for setDictionarySettings - * - * Set dictionary settings.. - * - */ - public function testSetDictionarySettings() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for setSettings - * - * . - * - */ - public function testSetSettings() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test case for updateApiKey - * - * Update an API key.. - * - */ - public function testUpdateApiKey() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/ActionTest.php b/clients/algoliasearch-client-php/test/Model/ActionTest.php deleted file mode 100644 index aa148ac48f..0000000000 --- a/clients/algoliasearch-client-php/test/Model/ActionTest.php +++ /dev/null @@ -1,81 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/AddApiKeyResponseTest.php b/clients/algoliasearch-client-php/test/Model/AddApiKeyResponseTest.php deleted file mode 100644 index bb09051f19..0000000000 --- a/clients/algoliasearch-client-php/test/Model/AddApiKeyResponseTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "key" - */ - public function testPropertyKey() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "createdAt" - */ - public function testPropertyCreatedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/AnchoringTest.php b/clients/algoliasearch-client-php/test/Model/AnchoringTest.php deleted file mode 100644 index d057c62a46..0000000000 --- a/clients/algoliasearch-client-php/test/Model/AnchoringTest.php +++ /dev/null @@ -1,81 +0,0 @@ -markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/ApiKeyTest.php b/clients/algoliasearch-client-php/test/Model/ApiKeyTest.php deleted file mode 100644 index da62429c08..0000000000 --- a/clients/algoliasearch-client-php/test/Model/ApiKeyTest.php +++ /dev/null @@ -1,153 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "acl" - */ - public function testPropertyAcl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "description" - */ - public function testPropertyDescription() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "indexes" - */ - public function testPropertyIndexes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "maxHitsPerQuery" - */ - public function testPropertyMaxHitsPerQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "maxQueriesPerIPPerHour" - */ - public function testPropertyMaxQueriesPerIPPerHour() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryParameters" - */ - public function testPropertyQueryParameters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "referers" - */ - public function testPropertyReferers() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "validity" - */ - public function testPropertyValidity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/AssignUserIdObjectTest.php b/clients/algoliasearch-client-php/test/Model/AssignUserIdObjectTest.php deleted file mode 100644 index dbd6e25121..0000000000 --- a/clients/algoliasearch-client-php/test/Model/AssignUserIdObjectTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "cluster" - */ - public function testPropertyCluster() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/AutomaticFacetFilterTest.php b/clients/algoliasearch-client-php/test/Model/AutomaticFacetFilterTest.php deleted file mode 100644 index 80a511b55a..0000000000 --- a/clients/algoliasearch-client-php/test/Model/AutomaticFacetFilterTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facet" - */ - public function testPropertyFacet() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "score" - */ - public function testPropertyScore() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disjunctive" - */ - public function testPropertyDisjunctive() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/BaseBrowseResponseTest.php b/clients/algoliasearch-client-php/test/Model/BaseBrowseResponseTest.php deleted file mode 100644 index 83a50609f6..0000000000 --- a/clients/algoliasearch-client-php/test/Model/BaseBrowseResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "cursor" - */ - public function testPropertyCursor() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/BaseIndexSettingsTest.php b/clients/algoliasearch-client-php/test/Model/BaseIndexSettingsTest.php deleted file mode 100644 index c54a4e720f..0000000000 --- a/clients/algoliasearch-client-php/test/Model/BaseIndexSettingsTest.php +++ /dev/null @@ -1,189 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "replicas" - */ - public function testPropertyReplicas() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "paginationLimitedTo" - */ - public function testPropertyPaginationLimitedTo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disableTypoToleranceOnWords" - */ - public function testPropertyDisableTypoToleranceOnWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToTransliterate" - */ - public function testPropertyAttributesToTransliterate() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "camelCaseAttributes" - */ - public function testPropertyCamelCaseAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "decompoundedAttributes" - */ - public function testPropertyDecompoundedAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "indexLanguages" - */ - public function testPropertyIndexLanguages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "filterPromotes" - */ - public function testPropertyFilterPromotes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disablePrefixOnAttributes" - */ - public function testPropertyDisablePrefixOnAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "allowCompressionOfIntegerArray" - */ - public function testPropertyAllowCompressionOfIntegerArray() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "numericAttributesForFiltering" - */ - public function testPropertyNumericAttributesForFiltering() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userData" - */ - public function testPropertyUserData() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/BaseSearchParamsTest.php b/clients/algoliasearch-client-php/test/Model/BaseSearchParamsTest.php deleted file mode 100644 index 2e79f8360a..0000000000 --- a/clients/algoliasearch-client-php/test/Model/BaseSearchParamsTest.php +++ /dev/null @@ -1,369 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "similarQuery" - */ - public function testPropertySimilarQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "filters" - */ - public function testPropertyFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facetFilters" - */ - public function testPropertyFacetFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "optionalFilters" - */ - public function testPropertyOptionalFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "numericFilters" - */ - public function testPropertyNumericFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "tagFilters" - */ - public function testPropertyTagFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sumOrFiltersScores" - */ - public function testPropertySumOrFiltersScores() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facets" - */ - public function testPropertyFacets() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "maxValuesPerFacet" - */ - public function testPropertyMaxValuesPerFacet() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facetingAfterDistinct" - */ - public function testPropertyFacetingAfterDistinct() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sortFacetValuesBy" - */ - public function testPropertySortFacetValuesBy() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "page" - */ - public function testPropertyPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "offset" - */ - public function testPropertyOffset() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "length" - */ - public function testPropertyLength() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundLatLng" - */ - public function testPropertyAroundLatLng() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundLatLngViaIP" - */ - public function testPropertyAroundLatLngViaIP() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundRadius" - */ - public function testPropertyAroundRadius() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundPrecision" - */ - public function testPropertyAroundPrecision() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minimumAroundRadius" - */ - public function testPropertyMinimumAroundRadius() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "insideBoundingBox" - */ - public function testPropertyInsideBoundingBox() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "insidePolygon" - */ - public function testPropertyInsidePolygon() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "naturalLanguages" - */ - public function testPropertyNaturalLanguages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ruleContexts" - */ - public function testPropertyRuleContexts() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "personalizationImpact" - */ - public function testPropertyPersonalizationImpact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userToken" - */ - public function testPropertyUserToken() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "getRankingInfo" - */ - public function testPropertyGetRankingInfo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "clickAnalytics" - */ - public function testPropertyClickAnalytics() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "analytics" - */ - public function testPropertyAnalytics() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "analyticsTags" - */ - public function testPropertyAnalyticsTags() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "percentileComputation" - */ - public function testPropertyPercentileComputation() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enableABTest" - */ - public function testPropertyEnableABTest() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enableReRanking" - */ - public function testPropertyEnableReRanking() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/BaseSearchResponseFacetsStatsTest.php b/clients/algoliasearch-client-php/test/Model/BaseSearchResponseFacetsStatsTest.php deleted file mode 100644 index a56e93f68c..0000000000 --- a/clients/algoliasearch-client-php/test/Model/BaseSearchResponseFacetsStatsTest.php +++ /dev/null @@ -1,117 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "min" - */ - public function testPropertyMin() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "max" - */ - public function testPropertyMax() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "avg" - */ - public function testPropertyAvg() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sum" - */ - public function testPropertySum() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/BaseSearchResponseTest.php b/clients/algoliasearch-client-php/test/Model/BaseSearchResponseTest.php deleted file mode 100644 index f9cc9768cc..0000000000 --- a/clients/algoliasearch-client-php/test/Model/BaseSearchResponseTest.php +++ /dev/null @@ -1,297 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "abTestID" - */ - public function testPropertyAbTestID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "abTestVariantID" - */ - public function testPropertyAbTestVariantID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundLatLng" - */ - public function testPropertyAroundLatLng() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "automaticRadius" - */ - public function testPropertyAutomaticRadius() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "exhaustiveFacetsCount" - */ - public function testPropertyExhaustiveFacetsCount() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "exhaustiveNbHits" - */ - public function testPropertyExhaustiveNbHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "exhaustiveTypo" - */ - public function testPropertyExhaustiveTypo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facets" - */ - public function testPropertyFacets() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facetsStats" - */ - public function testPropertyFacetsStats() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hitsPerPage" - */ - public function testPropertyHitsPerPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "index" - */ - public function testPropertyIndex() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "indexUsed" - */ - public function testPropertyIndexUsed() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "message" - */ - public function testPropertyMessage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbHits" - */ - public function testPropertyNbHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbPages" - */ - public function testPropertyNbPages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbSortedHits" - */ - public function testPropertyNbSortedHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "page" - */ - public function testPropertyPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "params" - */ - public function testPropertyParams() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "parsedQuery" - */ - public function testPropertyParsedQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "processingTimeMS" - */ - public function testPropertyProcessingTimeMS() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "query" - */ - public function testPropertyQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryAfterRemoval" - */ - public function testPropertyQueryAfterRemoval() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "serverUsed" - */ - public function testPropertyServerUsed() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userData" - */ - public function testPropertyUserData() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/BatchAssignUserIdsObjectTest.php b/clients/algoliasearch-client-php/test/Model/BatchAssignUserIdsObjectTest.php deleted file mode 100644 index 26a44b9729..0000000000 --- a/clients/algoliasearch-client-php/test/Model/BatchAssignUserIdsObjectTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "cluster" - */ - public function testPropertyCluster() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "users" - */ - public function testPropertyUsers() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesRequestTest.php b/clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesRequestTest.php deleted file mode 100644 index 983cde69d8..0000000000 --- a/clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesRequestTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "action" - */ - public function testPropertyAction() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "body" - */ - public function testPropertyBody() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesTest.php b/clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesTest.php deleted file mode 100644 index 942666188c..0000000000 --- a/clients/algoliasearch-client-php/test/Model/BatchDictionaryEntriesTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "clearExistingDictionaryEntries" - */ - public function testPropertyClearExistingDictionaryEntries() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "requests" - */ - public function testPropertyRequests() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/BatchObjectTest.php b/clients/algoliasearch-client-php/test/Model/BatchObjectTest.php deleted file mode 100644 index a4330dcb73..0000000000 --- a/clients/algoliasearch-client-php/test/Model/BatchObjectTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "requests" - */ - public function testPropertyRequests() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/BatchResponseTest.php b/clients/algoliasearch-client-php/test/Model/BatchResponseTest.php deleted file mode 100644 index 95be8ed79d..0000000000 --- a/clients/algoliasearch-client-php/test/Model/BatchResponseTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "taskID" - */ - public function testPropertyTaskID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "objectIDs" - */ - public function testPropertyObjectIDs() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/BatchWriteObjectTest.php b/clients/algoliasearch-client-php/test/Model/BatchWriteObjectTest.php deleted file mode 100644 index 706560b1e8..0000000000 --- a/clients/algoliasearch-client-php/test/Model/BatchWriteObjectTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "requests" - */ - public function testPropertyRequests() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/BrowseRequestTest.php b/clients/algoliasearch-client-php/test/Model/BrowseRequestTest.php deleted file mode 100644 index f1d362b1c3..0000000000 --- a/clients/algoliasearch-client-php/test/Model/BrowseRequestTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "params" - */ - public function testPropertyParams() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "cursor" - */ - public function testPropertyCursor() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/BrowseResponseTest.php b/clients/algoliasearch-client-php/test/Model/BrowseResponseTest.php deleted file mode 100644 index e5c611f65c..0000000000 --- a/clients/algoliasearch-client-php/test/Model/BrowseResponseTest.php +++ /dev/null @@ -1,315 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "abTestID" - */ - public function testPropertyAbTestID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "abTestVariantID" - */ - public function testPropertyAbTestVariantID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundLatLng" - */ - public function testPropertyAroundLatLng() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "automaticRadius" - */ - public function testPropertyAutomaticRadius() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "exhaustiveFacetsCount" - */ - public function testPropertyExhaustiveFacetsCount() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "exhaustiveNbHits" - */ - public function testPropertyExhaustiveNbHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "exhaustiveTypo" - */ - public function testPropertyExhaustiveTypo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facets" - */ - public function testPropertyFacets() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facetsStats" - */ - public function testPropertyFacetsStats() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hitsPerPage" - */ - public function testPropertyHitsPerPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "index" - */ - public function testPropertyIndex() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "indexUsed" - */ - public function testPropertyIndexUsed() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "message" - */ - public function testPropertyMessage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbHits" - */ - public function testPropertyNbHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbPages" - */ - public function testPropertyNbPages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbSortedHits" - */ - public function testPropertyNbSortedHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "page" - */ - public function testPropertyPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "params" - */ - public function testPropertyParams() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "parsedQuery" - */ - public function testPropertyParsedQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "processingTimeMS" - */ - public function testPropertyProcessingTimeMS() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "query" - */ - public function testPropertyQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryAfterRemoval" - */ - public function testPropertyQueryAfterRemoval() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "serverUsed" - */ - public function testPropertyServerUsed() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userData" - */ - public function testPropertyUserData() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hits" - */ - public function testPropertyHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "cursor" - */ - public function testPropertyCursor() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/BuildInOperationTest.php b/clients/algoliasearch-client-php/test/Model/BuildInOperationTest.php deleted file mode 100644 index e8e304ff58..0000000000 --- a/clients/algoliasearch-client-php/test/Model/BuildInOperationTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "operation" - */ - public function testPropertyOperation() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "value" - */ - public function testPropertyValue() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/ConditionTest.php b/clients/algoliasearch-client-php/test/Model/ConditionTest.php deleted file mode 100644 index 4a883e5b76..0000000000 --- a/clients/algoliasearch-client-php/test/Model/ConditionTest.php +++ /dev/null @@ -1,117 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "pattern" - */ - public function testPropertyPattern() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "anchoring" - */ - public function testPropertyAnchoring() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "alternatives" - */ - public function testPropertyAlternatives() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "context" - */ - public function testPropertyContext() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/ConsequenceHideTest.php b/clients/algoliasearch-client-php/test/Model/ConsequenceHideTest.php deleted file mode 100644 index f117ad829e..0000000000 --- a/clients/algoliasearch-client-php/test/Model/ConsequenceHideTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "objectID" - */ - public function testPropertyObjectID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/ConsequenceParamsTest.php b/clients/algoliasearch-client-php/test/Model/ConsequenceParamsTest.php deleted file mode 100644 index bfd011dd40..0000000000 --- a/clients/algoliasearch-client-php/test/Model/ConsequenceParamsTest.php +++ /dev/null @@ -1,792 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "query" - */ - public function testPropertyQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "automaticFacetFilters" - */ - public function testPropertyAutomaticFacetFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "automaticOptionalFacetFilters" - */ - public function testPropertyAutomaticOptionalFacetFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "similarQuery" - */ - public function testPropertySimilarQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "filters" - */ - public function testPropertyFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facetFilters" - */ - public function testPropertyFacetFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "optionalFilters" - */ - public function testPropertyOptionalFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "numericFilters" - */ - public function testPropertyNumericFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "tagFilters" - */ - public function testPropertyTagFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sumOrFiltersScores" - */ - public function testPropertySumOrFiltersScores() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facets" - */ - public function testPropertyFacets() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "maxValuesPerFacet" - */ - public function testPropertyMaxValuesPerFacet() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facetingAfterDistinct" - */ - public function testPropertyFacetingAfterDistinct() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sortFacetValuesBy" - */ - public function testPropertySortFacetValuesBy() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "page" - */ - public function testPropertyPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "offset" - */ - public function testPropertyOffset() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "length" - */ - public function testPropertyLength() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundLatLng" - */ - public function testPropertyAroundLatLng() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundLatLngViaIP" - */ - public function testPropertyAroundLatLngViaIP() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundRadius" - */ - public function testPropertyAroundRadius() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundPrecision" - */ - public function testPropertyAroundPrecision() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minimumAroundRadius" - */ - public function testPropertyMinimumAroundRadius() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "insideBoundingBox" - */ - public function testPropertyInsideBoundingBox() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "insidePolygon" - */ - public function testPropertyInsidePolygon() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "naturalLanguages" - */ - public function testPropertyNaturalLanguages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ruleContexts" - */ - public function testPropertyRuleContexts() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "personalizationImpact" - */ - public function testPropertyPersonalizationImpact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userToken" - */ - public function testPropertyUserToken() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "getRankingInfo" - */ - public function testPropertyGetRankingInfo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "clickAnalytics" - */ - public function testPropertyClickAnalytics() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "analytics" - */ - public function testPropertyAnalytics() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "analyticsTags" - */ - public function testPropertyAnalyticsTags() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "percentileComputation" - */ - public function testPropertyPercentileComputation() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enableABTest" - */ - public function testPropertyEnableABTest() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enableReRanking" - */ - public function testPropertyEnableReRanking() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "searchableAttributes" - */ - public function testPropertySearchableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesForFaceting" - */ - public function testPropertyAttributesForFaceting() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "unretrievableAttributes" - */ - public function testPropertyUnretrievableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToRetrieve" - */ - public function testPropertyAttributesToRetrieve() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "restrictSearchableAttributes" - */ - public function testPropertyRestrictSearchableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ranking" - */ - public function testPropertyRanking() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "customRanking" - */ - public function testPropertyCustomRanking() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "relevancyStrictness" - */ - public function testPropertyRelevancyStrictness() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToHighlight" - */ - public function testPropertyAttributesToHighlight() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToSnippet" - */ - public function testPropertyAttributesToSnippet() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "highlightPreTag" - */ - public function testPropertyHighlightPreTag() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "highlightPostTag" - */ - public function testPropertyHighlightPostTag() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "snippetEllipsisText" - */ - public function testPropertySnippetEllipsisText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "restrictHighlightAndSnippetArrays" - */ - public function testPropertyRestrictHighlightAndSnippetArrays() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hitsPerPage" - */ - public function testPropertyHitsPerPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minWordSizefor1Typo" - */ - public function testPropertyMinWordSizefor1Typo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minWordSizefor2Typos" - */ - public function testPropertyMinWordSizefor2Typos() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "typoTolerance" - */ - public function testPropertyTypoTolerance() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "allowTyposOnNumericTokens" - */ - public function testPropertyAllowTyposOnNumericTokens() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disableTypoToleranceOnAttributes" - */ - public function testPropertyDisableTypoToleranceOnAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "separatorsToIndex" - */ - public function testPropertySeparatorsToIndex() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ignorePlurals" - */ - public function testPropertyIgnorePlurals() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "removeStopWords" - */ - public function testPropertyRemoveStopWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "keepDiacriticsOnCharacters" - */ - public function testPropertyKeepDiacriticsOnCharacters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryLanguages" - */ - public function testPropertyQueryLanguages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "decompoundQuery" - */ - public function testPropertyDecompoundQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enableRules" - */ - public function testPropertyEnableRules() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enablePersonalization" - */ - public function testPropertyEnablePersonalization() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryType" - */ - public function testPropertyQueryType() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "removeWordsIfNoResults" - */ - public function testPropertyRemoveWordsIfNoResults() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "advancedSyntax" - */ - public function testPropertyAdvancedSyntax() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "optionalWords" - */ - public function testPropertyOptionalWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disableExactOnAttributes" - */ - public function testPropertyDisableExactOnAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "exactOnSingleWordQuery" - */ - public function testPropertyExactOnSingleWordQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "alternativesAsExact" - */ - public function testPropertyAlternativesAsExact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "advancedSyntaxFeatures" - */ - public function testPropertyAdvancedSyntaxFeatures() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "distinct" - */ - public function testPropertyDistinct() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "synonyms" - */ - public function testPropertySynonyms() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "replaceSynonymsInHighlight" - */ - public function testPropertyReplaceSynonymsInHighlight() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minProximity" - */ - public function testPropertyMinProximity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "responseFields" - */ - public function testPropertyResponseFields() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "maxFacetHits" - */ - public function testPropertyMaxFacetHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributeCriteriaComputedByMinProximity" - */ - public function testPropertyAttributeCriteriaComputedByMinProximity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "renderingContent" - */ - public function testPropertyRenderingContent() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/ConsequenceTest.php b/clients/algoliasearch-client-php/test/Model/ConsequenceTest.php deleted file mode 100644 index 1658657d6a..0000000000 --- a/clients/algoliasearch-client-php/test/Model/ConsequenceTest.php +++ /dev/null @@ -1,126 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "params" - */ - public function testPropertyParams() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "promote" - */ - public function testPropertyPromote() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "filterPromotes" - */ - public function testPropertyFilterPromotes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hide" - */ - public function testPropertyHide() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userData" - */ - public function testPropertyUserData() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/CreatedAtObjectTest.php b/clients/algoliasearch-client-php/test/Model/CreatedAtObjectTest.php deleted file mode 100644 index 7eab966280..0000000000 --- a/clients/algoliasearch-client-php/test/Model/CreatedAtObjectTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "createdAt" - */ - public function testPropertyCreatedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/CreatedAtResponseTest.php b/clients/algoliasearch-client-php/test/Model/CreatedAtResponseTest.php deleted file mode 100644 index 0610f83020..0000000000 --- a/clients/algoliasearch-client-php/test/Model/CreatedAtResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "createdAt" - */ - public function testPropertyCreatedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/DeleteApiKeyResponseTest.php b/clients/algoliasearch-client-php/test/Model/DeleteApiKeyResponseTest.php deleted file mode 100644 index 011b0bb637..0000000000 --- a/clients/algoliasearch-client-php/test/Model/DeleteApiKeyResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "deletedAt" - */ - public function testPropertyDeletedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/DeleteSourceResponseTest.php b/clients/algoliasearch-client-php/test/Model/DeleteSourceResponseTest.php deleted file mode 100644 index 930ae06c6f..0000000000 --- a/clients/algoliasearch-client-php/test/Model/DeleteSourceResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "deletedAt" - */ - public function testPropertyDeletedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/DeletedAtResponseTest.php b/clients/algoliasearch-client-php/test/Model/DeletedAtResponseTest.php deleted file mode 100644 index 13e6e8c3a3..0000000000 --- a/clients/algoliasearch-client-php/test/Model/DeletedAtResponseTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "taskID" - */ - public function testPropertyTaskID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "deletedAt" - */ - public function testPropertyDeletedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/DictionaryEntryTest.php b/clients/algoliasearch-client-php/test/Model/DictionaryEntryTest.php deleted file mode 100644 index ff8610ee29..0000000000 --- a/clients/algoliasearch-client-php/test/Model/DictionaryEntryTest.php +++ /dev/null @@ -1,135 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "objectID" - */ - public function testPropertyObjectID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "language" - */ - public function testPropertyLanguage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "word" - */ - public function testPropertyWord() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "words" - */ - public function testPropertyWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "decomposition" - */ - public function testPropertyDecomposition() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "state" - */ - public function testPropertyState() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/DictionaryLanguageTest.php b/clients/algoliasearch-client-php/test/Model/DictionaryLanguageTest.php deleted file mode 100644 index 751c3e7281..0000000000 --- a/clients/algoliasearch-client-php/test/Model/DictionaryLanguageTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbCustomEntires" - */ - public function testPropertyNbCustomEntires() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/DictionarySettingsRequestTest.php b/clients/algoliasearch-client-php/test/Model/DictionarySettingsRequestTest.php deleted file mode 100644 index 1575fceab7..0000000000 --- a/clients/algoliasearch-client-php/test/Model/DictionarySettingsRequestTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disableStandardEntries" - */ - public function testPropertyDisableStandardEntries() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/ErrorBaseTest.php b/clients/algoliasearch-client-php/test/Model/ErrorBaseTest.php deleted file mode 100644 index b7eb46d7d2..0000000000 --- a/clients/algoliasearch-client-php/test/Model/ErrorBaseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "message" - */ - public function testPropertyMessage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/GetDictionarySettingsResponseTest.php b/clients/algoliasearch-client-php/test/Model/GetDictionarySettingsResponseTest.php deleted file mode 100644 index 4058bd2603..0000000000 --- a/clients/algoliasearch-client-php/test/Model/GetDictionarySettingsResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disableStandardEntries" - */ - public function testPropertyDisableStandardEntries() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/GetLogsResponseInnerQueriesTest.php b/clients/algoliasearch-client-php/test/Model/GetLogsResponseInnerQueriesTest.php deleted file mode 100644 index 1c4605d08d..0000000000 --- a/clients/algoliasearch-client-php/test/Model/GetLogsResponseInnerQueriesTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "indexName" - */ - public function testPropertyIndexName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userToken" - */ - public function testPropertyUserToken() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryId" - */ - public function testPropertyQueryId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/GetLogsResponseLogsTest.php b/clients/algoliasearch-client-php/test/Model/GetLogsResponseLogsTest.php deleted file mode 100644 index 3a216d1b9a..0000000000 --- a/clients/algoliasearch-client-php/test/Model/GetLogsResponseLogsTest.php +++ /dev/null @@ -1,216 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "timestamp" - */ - public function testPropertyTimestamp() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "method" - */ - public function testPropertyMethod() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "answerCode" - */ - public function testPropertyAnswerCode() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryBody" - */ - public function testPropertyQueryBody() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "answer" - */ - public function testPropertyAnswer() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "url" - */ - public function testPropertyUrl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ip" - */ - public function testPropertyIp() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryHeaders" - */ - public function testPropertyQueryHeaders() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sha1" - */ - public function testPropertySha1() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbApiCalls" - */ - public function testPropertyNbApiCalls() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "processingTimeMs" - */ - public function testPropertyProcessingTimeMs() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "index" - */ - public function testPropertyIndex() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryParams" - */ - public function testPropertyQueryParams() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryNbHits" - */ - public function testPropertyQueryNbHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "innerQueries" - */ - public function testPropertyInnerQueries() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/GetLogsResponseTest.php b/clients/algoliasearch-client-php/test/Model/GetLogsResponseTest.php deleted file mode 100644 index 27ce12a519..0000000000 --- a/clients/algoliasearch-client-php/test/Model/GetLogsResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "logs" - */ - public function testPropertyLogs() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/GetObjectsObjectTest.php b/clients/algoliasearch-client-php/test/Model/GetObjectsObjectTest.php deleted file mode 100644 index 9a8e9d0db1..0000000000 --- a/clients/algoliasearch-client-php/test/Model/GetObjectsObjectTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "requests" - */ - public function testPropertyRequests() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/GetObjectsResponseTest.php b/clients/algoliasearch-client-php/test/Model/GetObjectsResponseTest.php deleted file mode 100644 index 6f54c31b12..0000000000 --- a/clients/algoliasearch-client-php/test/Model/GetObjectsResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "results" - */ - public function testPropertyResults() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/GetTaskResponseTest.php b/clients/algoliasearch-client-php/test/Model/GetTaskResponseTest.php deleted file mode 100644 index 5442a862da..0000000000 --- a/clients/algoliasearch-client-php/test/Model/GetTaskResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "status" - */ - public function testPropertyStatus() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/GetTopUserIdsResponseTest.php b/clients/algoliasearch-client-php/test/Model/GetTopUserIdsResponseTest.php deleted file mode 100644 index ae31970b27..0000000000 --- a/clients/algoliasearch-client-php/test/Model/GetTopUserIdsResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "topUsers" - */ - public function testPropertyTopUsers() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/HighlightResultTest.php b/clients/algoliasearch-client-php/test/Model/HighlightResultTest.php deleted file mode 100644 index 260a26a6c1..0000000000 --- a/clients/algoliasearch-client-php/test/Model/HighlightResultTest.php +++ /dev/null @@ -1,117 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "value" - */ - public function testPropertyValue() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "matchLevel" - */ - public function testPropertyMatchLevel() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "matchedWords" - */ - public function testPropertyMatchedWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "fullyHighlighted" - */ - public function testPropertyFullyHighlighted() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/IndexSettingsAsSearchParamsTest.php b/clients/algoliasearch-client-php/test/Model/IndexSettingsAsSearchParamsTest.php deleted file mode 100644 index 6ddfc8cd11..0000000000 --- a/clients/algoliasearch-client-php/test/Model/IndexSettingsAsSearchParamsTest.php +++ /dev/null @@ -1,477 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "searchableAttributes" - */ - public function testPropertySearchableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesForFaceting" - */ - public function testPropertyAttributesForFaceting() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "unretrievableAttributes" - */ - public function testPropertyUnretrievableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToRetrieve" - */ - public function testPropertyAttributesToRetrieve() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "restrictSearchableAttributes" - */ - public function testPropertyRestrictSearchableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ranking" - */ - public function testPropertyRanking() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "customRanking" - */ - public function testPropertyCustomRanking() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "relevancyStrictness" - */ - public function testPropertyRelevancyStrictness() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToHighlight" - */ - public function testPropertyAttributesToHighlight() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToSnippet" - */ - public function testPropertyAttributesToSnippet() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "highlightPreTag" - */ - public function testPropertyHighlightPreTag() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "highlightPostTag" - */ - public function testPropertyHighlightPostTag() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "snippetEllipsisText" - */ - public function testPropertySnippetEllipsisText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "restrictHighlightAndSnippetArrays" - */ - public function testPropertyRestrictHighlightAndSnippetArrays() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hitsPerPage" - */ - public function testPropertyHitsPerPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minWordSizefor1Typo" - */ - public function testPropertyMinWordSizefor1Typo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minWordSizefor2Typos" - */ - public function testPropertyMinWordSizefor2Typos() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "typoTolerance" - */ - public function testPropertyTypoTolerance() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "allowTyposOnNumericTokens" - */ - public function testPropertyAllowTyposOnNumericTokens() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disableTypoToleranceOnAttributes" - */ - public function testPropertyDisableTypoToleranceOnAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "separatorsToIndex" - */ - public function testPropertySeparatorsToIndex() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ignorePlurals" - */ - public function testPropertyIgnorePlurals() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "removeStopWords" - */ - public function testPropertyRemoveStopWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "keepDiacriticsOnCharacters" - */ - public function testPropertyKeepDiacriticsOnCharacters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryLanguages" - */ - public function testPropertyQueryLanguages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "decompoundQuery" - */ - public function testPropertyDecompoundQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enableRules" - */ - public function testPropertyEnableRules() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enablePersonalization" - */ - public function testPropertyEnablePersonalization() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryType" - */ - public function testPropertyQueryType() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "removeWordsIfNoResults" - */ - public function testPropertyRemoveWordsIfNoResults() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "advancedSyntax" - */ - public function testPropertyAdvancedSyntax() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "optionalWords" - */ - public function testPropertyOptionalWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disableExactOnAttributes" - */ - public function testPropertyDisableExactOnAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "exactOnSingleWordQuery" - */ - public function testPropertyExactOnSingleWordQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "alternativesAsExact" - */ - public function testPropertyAlternativesAsExact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "advancedSyntaxFeatures" - */ - public function testPropertyAdvancedSyntaxFeatures() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "distinct" - */ - public function testPropertyDistinct() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "synonyms" - */ - public function testPropertySynonyms() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "replaceSynonymsInHighlight" - */ - public function testPropertyReplaceSynonymsInHighlight() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minProximity" - */ - public function testPropertyMinProximity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "responseFields" - */ - public function testPropertyResponseFields() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "maxFacetHits" - */ - public function testPropertyMaxFacetHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributeCriteriaComputedByMinProximity" - */ - public function testPropertyAttributeCriteriaComputedByMinProximity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "renderingContent" - */ - public function testPropertyRenderingContent() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/IndexSettingsTest.php b/clients/algoliasearch-client-php/test/Model/IndexSettingsTest.php deleted file mode 100644 index 212b07549e..0000000000 --- a/clients/algoliasearch-client-php/test/Model/IndexSettingsTest.php +++ /dev/null @@ -1,585 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "replicas" - */ - public function testPropertyReplicas() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "paginationLimitedTo" - */ - public function testPropertyPaginationLimitedTo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disableTypoToleranceOnWords" - */ - public function testPropertyDisableTypoToleranceOnWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToTransliterate" - */ - public function testPropertyAttributesToTransliterate() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "camelCaseAttributes" - */ - public function testPropertyCamelCaseAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "decompoundedAttributes" - */ - public function testPropertyDecompoundedAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "indexLanguages" - */ - public function testPropertyIndexLanguages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "filterPromotes" - */ - public function testPropertyFilterPromotes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disablePrefixOnAttributes" - */ - public function testPropertyDisablePrefixOnAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "allowCompressionOfIntegerArray" - */ - public function testPropertyAllowCompressionOfIntegerArray() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "numericAttributesForFiltering" - */ - public function testPropertyNumericAttributesForFiltering() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userData" - */ - public function testPropertyUserData() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "searchableAttributes" - */ - public function testPropertySearchableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesForFaceting" - */ - public function testPropertyAttributesForFaceting() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "unretrievableAttributes" - */ - public function testPropertyUnretrievableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToRetrieve" - */ - public function testPropertyAttributesToRetrieve() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "restrictSearchableAttributes" - */ - public function testPropertyRestrictSearchableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ranking" - */ - public function testPropertyRanking() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "customRanking" - */ - public function testPropertyCustomRanking() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "relevancyStrictness" - */ - public function testPropertyRelevancyStrictness() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToHighlight" - */ - public function testPropertyAttributesToHighlight() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToSnippet" - */ - public function testPropertyAttributesToSnippet() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "highlightPreTag" - */ - public function testPropertyHighlightPreTag() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "highlightPostTag" - */ - public function testPropertyHighlightPostTag() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "snippetEllipsisText" - */ - public function testPropertySnippetEllipsisText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "restrictHighlightAndSnippetArrays" - */ - public function testPropertyRestrictHighlightAndSnippetArrays() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hitsPerPage" - */ - public function testPropertyHitsPerPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minWordSizefor1Typo" - */ - public function testPropertyMinWordSizefor1Typo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minWordSizefor2Typos" - */ - public function testPropertyMinWordSizefor2Typos() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "typoTolerance" - */ - public function testPropertyTypoTolerance() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "allowTyposOnNumericTokens" - */ - public function testPropertyAllowTyposOnNumericTokens() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disableTypoToleranceOnAttributes" - */ - public function testPropertyDisableTypoToleranceOnAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "separatorsToIndex" - */ - public function testPropertySeparatorsToIndex() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ignorePlurals" - */ - public function testPropertyIgnorePlurals() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "removeStopWords" - */ - public function testPropertyRemoveStopWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "keepDiacriticsOnCharacters" - */ - public function testPropertyKeepDiacriticsOnCharacters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryLanguages" - */ - public function testPropertyQueryLanguages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "decompoundQuery" - */ - public function testPropertyDecompoundQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enableRules" - */ - public function testPropertyEnableRules() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enablePersonalization" - */ - public function testPropertyEnablePersonalization() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryType" - */ - public function testPropertyQueryType() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "removeWordsIfNoResults" - */ - public function testPropertyRemoveWordsIfNoResults() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "advancedSyntax" - */ - public function testPropertyAdvancedSyntax() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "optionalWords" - */ - public function testPropertyOptionalWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disableExactOnAttributes" - */ - public function testPropertyDisableExactOnAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "exactOnSingleWordQuery" - */ - public function testPropertyExactOnSingleWordQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "alternativesAsExact" - */ - public function testPropertyAlternativesAsExact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "advancedSyntaxFeatures" - */ - public function testPropertyAdvancedSyntaxFeatures() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "distinct" - */ - public function testPropertyDistinct() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "synonyms" - */ - public function testPropertySynonyms() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "replaceSynonymsInHighlight" - */ - public function testPropertyReplaceSynonymsInHighlight() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minProximity" - */ - public function testPropertyMinProximity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "responseFields" - */ - public function testPropertyResponseFields() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "maxFacetHits" - */ - public function testPropertyMaxFacetHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributeCriteriaComputedByMinProximity" - */ - public function testPropertyAttributeCriteriaComputedByMinProximity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "renderingContent" - */ - public function testPropertyRenderingContent() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/IndexTest.php b/clients/algoliasearch-client-php/test/Model/IndexTest.php deleted file mode 100644 index 8cf50ca632..0000000000 --- a/clients/algoliasearch-client-php/test/Model/IndexTest.php +++ /dev/null @@ -1,180 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "name" - */ - public function testPropertyName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "createdAt" - */ - public function testPropertyCreatedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "updatedAt" - */ - public function testPropertyUpdatedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "entries" - */ - public function testPropertyEntries() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "dataSize" - */ - public function testPropertyDataSize() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "fileSize" - */ - public function testPropertyFileSize() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "lastBuildTimeS" - */ - public function testPropertyLastBuildTimeS() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "numberOfPendingTask" - */ - public function testPropertyNumberOfPendingTask() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "pendingTask" - */ - public function testPropertyPendingTask() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "primary" - */ - public function testPropertyPrimary() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "replicas" - */ - public function testPropertyReplicas() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/KeyObjectTest.php b/clients/algoliasearch-client-php/test/Model/KeyObjectTest.php deleted file mode 100644 index 3682eb0654..0000000000 --- a/clients/algoliasearch-client-php/test/Model/KeyObjectTest.php +++ /dev/null @@ -1,162 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "acl" - */ - public function testPropertyAcl() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "description" - */ - public function testPropertyDescription() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "indexes" - */ - public function testPropertyIndexes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "maxHitsPerQuery" - */ - public function testPropertyMaxHitsPerQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "maxQueriesPerIPPerHour" - */ - public function testPropertyMaxQueriesPerIPPerHour() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryParameters" - */ - public function testPropertyQueryParameters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "referers" - */ - public function testPropertyReferers() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "validity" - */ - public function testPropertyValidity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "createdAt" - */ - public function testPropertyCreatedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/LanguagesTest.php b/clients/algoliasearch-client-php/test/Model/LanguagesTest.php deleted file mode 100644 index 645649797f..0000000000 --- a/clients/algoliasearch-client-php/test/Model/LanguagesTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "plurals" - */ - public function testPropertyPlurals() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "stopwords" - */ - public function testPropertyStopwords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "compounds" - */ - public function testPropertyCompounds() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/ListApiKeysResponseTest.php b/clients/algoliasearch-client-php/test/Model/ListApiKeysResponseTest.php deleted file mode 100644 index db3cba6d6e..0000000000 --- a/clients/algoliasearch-client-php/test/Model/ListApiKeysResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "keys" - */ - public function testPropertyKeys() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/ListClustersResponseTest.php b/clients/algoliasearch-client-php/test/Model/ListClustersResponseTest.php deleted file mode 100644 index 6ee4822861..0000000000 --- a/clients/algoliasearch-client-php/test/Model/ListClustersResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "topUsers" - */ - public function testPropertyTopUsers() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/ListIndicesResponseTest.php b/clients/algoliasearch-client-php/test/Model/ListIndicesResponseTest.php deleted file mode 100644 index 2ab209f5a5..0000000000 --- a/clients/algoliasearch-client-php/test/Model/ListIndicesResponseTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "items" - */ - public function testPropertyItems() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbPages" - */ - public function testPropertyNbPages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/ListUserIdsResponseTest.php b/clients/algoliasearch-client-php/test/Model/ListUserIdsResponseTest.php deleted file mode 100644 index 418e0f6e86..0000000000 --- a/clients/algoliasearch-client-php/test/Model/ListUserIdsResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userIDs" - */ - public function testPropertyUserIDs() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/MultipleBatchResponseTest.php b/clients/algoliasearch-client-php/test/Model/MultipleBatchResponseTest.php deleted file mode 100644 index 9efc6f5b6f..0000000000 --- a/clients/algoliasearch-client-php/test/Model/MultipleBatchResponseTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "taskID" - */ - public function testPropertyTaskID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "objectIDs" - */ - public function testPropertyObjectIDs() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/MultipleGetObjectsObjectTest.php b/clients/algoliasearch-client-php/test/Model/MultipleGetObjectsObjectTest.php deleted file mode 100644 index c0933a5acb..0000000000 --- a/clients/algoliasearch-client-php/test/Model/MultipleGetObjectsObjectTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToRetrieve" - */ - public function testPropertyAttributesToRetrieve() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "objectID" - */ - public function testPropertyObjectID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "indexName" - */ - public function testPropertyIndexName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/MultipleQueriesObjectTest.php b/clients/algoliasearch-client-php/test/Model/MultipleQueriesObjectTest.php deleted file mode 100644 index 132faa342b..0000000000 --- a/clients/algoliasearch-client-php/test/Model/MultipleQueriesObjectTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "requests" - */ - public function testPropertyRequests() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "strategy" - */ - public function testPropertyStrategy() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/MultipleQueriesResponseTest.php b/clients/algoliasearch-client-php/test/Model/MultipleQueriesResponseTest.php deleted file mode 100644 index c0b3f550fd..0000000000 --- a/clients/algoliasearch-client-php/test/Model/MultipleQueriesResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "results" - */ - public function testPropertyResults() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/MultipleQueriesTest.php b/clients/algoliasearch-client-php/test/Model/MultipleQueriesTest.php deleted file mode 100644 index 1f9d54f31d..0000000000 --- a/clients/algoliasearch-client-php/test/Model/MultipleQueriesTest.php +++ /dev/null @@ -1,126 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "indexName" - */ - public function testPropertyIndexName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "query" - */ - public function testPropertyQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "type" - */ - public function testPropertyType() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facet" - */ - public function testPropertyFacet() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "params" - */ - public function testPropertyParams() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/OperationIndexObjectTest.php b/clients/algoliasearch-client-php/test/Model/OperationIndexObjectTest.php deleted file mode 100644 index ff0da8f1ff..0000000000 --- a/clients/algoliasearch-client-php/test/Model/OperationIndexObjectTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "operation" - */ - public function testPropertyOperation() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "destination" - */ - public function testPropertyDestination() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "scope" - */ - public function testPropertyScope() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/OperationTest.php b/clients/algoliasearch-client-php/test/Model/OperationTest.php deleted file mode 100644 index a452652b6f..0000000000 --- a/clients/algoliasearch-client-php/test/Model/OperationTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "action" - */ - public function testPropertyAction() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "body" - */ - public function testPropertyBody() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "indexName" - */ - public function testPropertyIndexName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/ParamsTest.php b/clients/algoliasearch-client-php/test/Model/ParamsTest.php deleted file mode 100644 index 5f8524f2de..0000000000 --- a/clients/algoliasearch-client-php/test/Model/ParamsTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "query" - */ - public function testPropertyQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "automaticFacetFilters" - */ - public function testPropertyAutomaticFacetFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "automaticOptionalFacetFilters" - */ - public function testPropertyAutomaticOptionalFacetFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/PromoteTest.php b/clients/algoliasearch-client-php/test/Model/PromoteTest.php deleted file mode 100644 index 3020e84ef5..0000000000 --- a/clients/algoliasearch-client-php/test/Model/PromoteTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "objectID" - */ - public function testPropertyObjectID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "objectIDs" - */ - public function testPropertyObjectIDs() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "position" - */ - public function testPropertyPosition() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/RankingInfoMatchedGeoLocationTest.php b/clients/algoliasearch-client-php/test/Model/RankingInfoMatchedGeoLocationTest.php deleted file mode 100644 index af57c0fbb5..0000000000 --- a/clients/algoliasearch-client-php/test/Model/RankingInfoMatchedGeoLocationTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "lat" - */ - public function testPropertyLat() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "lng" - */ - public function testPropertyLng() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "distance" - */ - public function testPropertyDistance() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/RankingInfoTest.php b/clients/algoliasearch-client-php/test/Model/RankingInfoTest.php deleted file mode 100644 index 78ee973784..0000000000 --- a/clients/algoliasearch-client-php/test/Model/RankingInfoTest.php +++ /dev/null @@ -1,180 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "filters" - */ - public function testPropertyFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "firstMatchedWord" - */ - public function testPropertyFirstMatchedWord() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "geoDistance" - */ - public function testPropertyGeoDistance() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "geoPrecision" - */ - public function testPropertyGeoPrecision() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "matchedGeoLocation" - */ - public function testPropertyMatchedGeoLocation() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbExactWords" - */ - public function testPropertyNbExactWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbTypos" - */ - public function testPropertyNbTypos() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "promoted" - */ - public function testPropertyPromoted() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "proximityDistance" - */ - public function testPropertyProximityDistance() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userScore" - */ - public function testPropertyUserScore() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "word" - */ - public function testPropertyWord() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/RecordTest.php b/clients/algoliasearch-client-php/test/Model/RecordTest.php deleted file mode 100644 index 7175eed98c..0000000000 --- a/clients/algoliasearch-client-php/test/Model/RecordTest.php +++ /dev/null @@ -1,126 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "objectID" - */ - public function testPropertyObjectID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "highlightResult" - */ - public function testPropertyHighlightResult() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "snippetResult" - */ - public function testPropertySnippetResult() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "rankingInfo" - */ - public function testPropertyRankingInfo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "distinctSeqID" - */ - public function testPropertyDistinctSeqID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/RemoveUserIdResponseTest.php b/clients/algoliasearch-client-php/test/Model/RemoveUserIdResponseTest.php deleted file mode 100644 index 57d1ab1f91..0000000000 --- a/clients/algoliasearch-client-php/test/Model/RemoveUserIdResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "deletedAt" - */ - public function testPropertyDeletedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/ReplaceSourceResponseTest.php b/clients/algoliasearch-client-php/test/Model/ReplaceSourceResponseTest.php deleted file mode 100644 index 6fa3f74acf..0000000000 --- a/clients/algoliasearch-client-php/test/Model/ReplaceSourceResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "updatedAt" - */ - public function testPropertyUpdatedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/RequiredSearchParamsTest.php b/clients/algoliasearch-client-php/test/Model/RequiredSearchParamsTest.php deleted file mode 100644 index a49251c12a..0000000000 --- a/clients/algoliasearch-client-php/test/Model/RequiredSearchParamsTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "query" - */ - public function testPropertyQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/RuleTest.php b/clients/algoliasearch-client-php/test/Model/RuleTest.php deleted file mode 100644 index 8454bc4904..0000000000 --- a/clients/algoliasearch-client-php/test/Model/RuleTest.php +++ /dev/null @@ -1,135 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "objectID" - */ - public function testPropertyObjectID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "conditions" - */ - public function testPropertyConditions() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "consequence" - */ - public function testPropertyConsequence() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "description" - */ - public function testPropertyDescription() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enabled" - */ - public function testPropertyEnabled() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "validity" - */ - public function testPropertyValidity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SaveObjectResponseTest.php b/clients/algoliasearch-client-php/test/Model/SaveObjectResponseTest.php deleted file mode 100644 index eda9d14481..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SaveObjectResponseTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "createdAt" - */ - public function testPropertyCreatedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "taskID" - */ - public function testPropertyTaskID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "objectID" - */ - public function testPropertyObjectID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SaveSynonymResponseTest.php b/clients/algoliasearch-client-php/test/Model/SaveSynonymResponseTest.php deleted file mode 100644 index ab1f8b0fa6..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SaveSynonymResponseTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "taskID" - */ - public function testPropertyTaskID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "updatedAt" - */ - public function testPropertyUpdatedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "id" - */ - public function testPropertyId() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchDictionaryEntriesTest.php b/clients/algoliasearch-client-php/test/Model/SearchDictionaryEntriesTest.php deleted file mode 100644 index f5b151f538..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchDictionaryEntriesTest.php +++ /dev/null @@ -1,117 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "query" - */ - public function testPropertyQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "page" - */ - public function testPropertyPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hitsPerPage" - */ - public function testPropertyHitsPerPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "language" - */ - public function testPropertyLanguage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesRequestTest.php b/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesRequestTest.php deleted file mode 100644 index 0295f90041..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesRequestTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "params" - */ - public function testPropertyParams() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facetQuery" - */ - public function testPropertyFacetQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "maxFacetHits" - */ - public function testPropertyMaxFacetHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseFacetHitsTest.php b/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseFacetHitsTest.php deleted file mode 100644 index 058c95de01..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseFacetHitsTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "value" - */ - public function testPropertyValue() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "highlighted" - */ - public function testPropertyHighlighted() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "count" - */ - public function testPropertyCount() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseTest.php b/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseTest.php deleted file mode 100644 index faffdce40b..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchForFacetValuesResponseTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facetHits" - */ - public function testPropertyFacetHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchHitsTest.php b/clients/algoliasearch-client-php/test/Model/SearchHitsTest.php deleted file mode 100644 index 011351229a..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchHitsTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hits" - */ - public function testPropertyHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchParamsObjectTest.php b/clients/algoliasearch-client-php/test/Model/SearchParamsObjectTest.php deleted file mode 100644 index dd0b23f8eb..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchParamsObjectTest.php +++ /dev/null @@ -1,774 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "similarQuery" - */ - public function testPropertySimilarQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "filters" - */ - public function testPropertyFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facetFilters" - */ - public function testPropertyFacetFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "optionalFilters" - */ - public function testPropertyOptionalFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "numericFilters" - */ - public function testPropertyNumericFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "tagFilters" - */ - public function testPropertyTagFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sumOrFiltersScores" - */ - public function testPropertySumOrFiltersScores() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facets" - */ - public function testPropertyFacets() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "maxValuesPerFacet" - */ - public function testPropertyMaxValuesPerFacet() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facetingAfterDistinct" - */ - public function testPropertyFacetingAfterDistinct() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sortFacetValuesBy" - */ - public function testPropertySortFacetValuesBy() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "page" - */ - public function testPropertyPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "offset" - */ - public function testPropertyOffset() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "length" - */ - public function testPropertyLength() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundLatLng" - */ - public function testPropertyAroundLatLng() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundLatLngViaIP" - */ - public function testPropertyAroundLatLngViaIP() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundRadius" - */ - public function testPropertyAroundRadius() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundPrecision" - */ - public function testPropertyAroundPrecision() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minimumAroundRadius" - */ - public function testPropertyMinimumAroundRadius() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "insideBoundingBox" - */ - public function testPropertyInsideBoundingBox() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "insidePolygon" - */ - public function testPropertyInsidePolygon() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "naturalLanguages" - */ - public function testPropertyNaturalLanguages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ruleContexts" - */ - public function testPropertyRuleContexts() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "personalizationImpact" - */ - public function testPropertyPersonalizationImpact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userToken" - */ - public function testPropertyUserToken() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "getRankingInfo" - */ - public function testPropertyGetRankingInfo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "clickAnalytics" - */ - public function testPropertyClickAnalytics() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "analytics" - */ - public function testPropertyAnalytics() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "analyticsTags" - */ - public function testPropertyAnalyticsTags() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "percentileComputation" - */ - public function testPropertyPercentileComputation() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enableABTest" - */ - public function testPropertyEnableABTest() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enableReRanking" - */ - public function testPropertyEnableReRanking() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "query" - */ - public function testPropertyQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "searchableAttributes" - */ - public function testPropertySearchableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesForFaceting" - */ - public function testPropertyAttributesForFaceting() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "unretrievableAttributes" - */ - public function testPropertyUnretrievableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToRetrieve" - */ - public function testPropertyAttributesToRetrieve() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "restrictSearchableAttributes" - */ - public function testPropertyRestrictSearchableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ranking" - */ - public function testPropertyRanking() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "customRanking" - */ - public function testPropertyCustomRanking() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "relevancyStrictness" - */ - public function testPropertyRelevancyStrictness() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToHighlight" - */ - public function testPropertyAttributesToHighlight() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToSnippet" - */ - public function testPropertyAttributesToSnippet() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "highlightPreTag" - */ - public function testPropertyHighlightPreTag() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "highlightPostTag" - */ - public function testPropertyHighlightPostTag() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "snippetEllipsisText" - */ - public function testPropertySnippetEllipsisText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "restrictHighlightAndSnippetArrays" - */ - public function testPropertyRestrictHighlightAndSnippetArrays() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hitsPerPage" - */ - public function testPropertyHitsPerPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minWordSizefor1Typo" - */ - public function testPropertyMinWordSizefor1Typo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minWordSizefor2Typos" - */ - public function testPropertyMinWordSizefor2Typos() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "typoTolerance" - */ - public function testPropertyTypoTolerance() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "allowTyposOnNumericTokens" - */ - public function testPropertyAllowTyposOnNumericTokens() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disableTypoToleranceOnAttributes" - */ - public function testPropertyDisableTypoToleranceOnAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "separatorsToIndex" - */ - public function testPropertySeparatorsToIndex() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ignorePlurals" - */ - public function testPropertyIgnorePlurals() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "removeStopWords" - */ - public function testPropertyRemoveStopWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "keepDiacriticsOnCharacters" - */ - public function testPropertyKeepDiacriticsOnCharacters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryLanguages" - */ - public function testPropertyQueryLanguages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "decompoundQuery" - */ - public function testPropertyDecompoundQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enableRules" - */ - public function testPropertyEnableRules() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enablePersonalization" - */ - public function testPropertyEnablePersonalization() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryType" - */ - public function testPropertyQueryType() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "removeWordsIfNoResults" - */ - public function testPropertyRemoveWordsIfNoResults() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "advancedSyntax" - */ - public function testPropertyAdvancedSyntax() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "optionalWords" - */ - public function testPropertyOptionalWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disableExactOnAttributes" - */ - public function testPropertyDisableExactOnAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "exactOnSingleWordQuery" - */ - public function testPropertyExactOnSingleWordQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "alternativesAsExact" - */ - public function testPropertyAlternativesAsExact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "advancedSyntaxFeatures" - */ - public function testPropertyAdvancedSyntaxFeatures() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "distinct" - */ - public function testPropertyDistinct() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "synonyms" - */ - public function testPropertySynonyms() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "replaceSynonymsInHighlight" - */ - public function testPropertyReplaceSynonymsInHighlight() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minProximity" - */ - public function testPropertyMinProximity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "responseFields" - */ - public function testPropertyResponseFields() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "maxFacetHits" - */ - public function testPropertyMaxFacetHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributeCriteriaComputedByMinProximity" - */ - public function testPropertyAttributeCriteriaComputedByMinProximity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "renderingContent" - */ - public function testPropertyRenderingContent() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchParamsStringTest.php b/clients/algoliasearch-client-php/test/Model/SearchParamsStringTest.php deleted file mode 100644 index 64eff88fe2..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchParamsStringTest.php +++ /dev/null @@ -1,90 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "params" - */ - public function testPropertyParams() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchParamsTest.php b/clients/algoliasearch-client-php/test/Model/SearchParamsTest.php deleted file mode 100644 index d91122fc85..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchParamsTest.php +++ /dev/null @@ -1,783 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "params" - */ - public function testPropertyParams() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "similarQuery" - */ - public function testPropertySimilarQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "filters" - */ - public function testPropertyFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facetFilters" - */ - public function testPropertyFacetFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "optionalFilters" - */ - public function testPropertyOptionalFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "numericFilters" - */ - public function testPropertyNumericFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "tagFilters" - */ - public function testPropertyTagFilters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sumOrFiltersScores" - */ - public function testPropertySumOrFiltersScores() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facets" - */ - public function testPropertyFacets() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "maxValuesPerFacet" - */ - public function testPropertyMaxValuesPerFacet() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facetingAfterDistinct" - */ - public function testPropertyFacetingAfterDistinct() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "sortFacetValuesBy" - */ - public function testPropertySortFacetValuesBy() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "page" - */ - public function testPropertyPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "offset" - */ - public function testPropertyOffset() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "length" - */ - public function testPropertyLength() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundLatLng" - */ - public function testPropertyAroundLatLng() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundLatLngViaIP" - */ - public function testPropertyAroundLatLngViaIP() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundRadius" - */ - public function testPropertyAroundRadius() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundPrecision" - */ - public function testPropertyAroundPrecision() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minimumAroundRadius" - */ - public function testPropertyMinimumAroundRadius() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "insideBoundingBox" - */ - public function testPropertyInsideBoundingBox() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "insidePolygon" - */ - public function testPropertyInsidePolygon() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "naturalLanguages" - */ - public function testPropertyNaturalLanguages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ruleContexts" - */ - public function testPropertyRuleContexts() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "personalizationImpact" - */ - public function testPropertyPersonalizationImpact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userToken" - */ - public function testPropertyUserToken() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "getRankingInfo" - */ - public function testPropertyGetRankingInfo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "clickAnalytics" - */ - public function testPropertyClickAnalytics() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "analytics" - */ - public function testPropertyAnalytics() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "analyticsTags" - */ - public function testPropertyAnalyticsTags() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "percentileComputation" - */ - public function testPropertyPercentileComputation() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enableABTest" - */ - public function testPropertyEnableABTest() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enableReRanking" - */ - public function testPropertyEnableReRanking() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "query" - */ - public function testPropertyQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "searchableAttributes" - */ - public function testPropertySearchableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesForFaceting" - */ - public function testPropertyAttributesForFaceting() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "unretrievableAttributes" - */ - public function testPropertyUnretrievableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToRetrieve" - */ - public function testPropertyAttributesToRetrieve() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "restrictSearchableAttributes" - */ - public function testPropertyRestrictSearchableAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ranking" - */ - public function testPropertyRanking() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "customRanking" - */ - public function testPropertyCustomRanking() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "relevancyStrictness" - */ - public function testPropertyRelevancyStrictness() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToHighlight" - */ - public function testPropertyAttributesToHighlight() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributesToSnippet" - */ - public function testPropertyAttributesToSnippet() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "highlightPreTag" - */ - public function testPropertyHighlightPreTag() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "highlightPostTag" - */ - public function testPropertyHighlightPostTag() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "snippetEllipsisText" - */ - public function testPropertySnippetEllipsisText() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "restrictHighlightAndSnippetArrays" - */ - public function testPropertyRestrictHighlightAndSnippetArrays() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hitsPerPage" - */ - public function testPropertyHitsPerPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minWordSizefor1Typo" - */ - public function testPropertyMinWordSizefor1Typo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minWordSizefor2Typos" - */ - public function testPropertyMinWordSizefor2Typos() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "typoTolerance" - */ - public function testPropertyTypoTolerance() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "allowTyposOnNumericTokens" - */ - public function testPropertyAllowTyposOnNumericTokens() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disableTypoToleranceOnAttributes" - */ - public function testPropertyDisableTypoToleranceOnAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "separatorsToIndex" - */ - public function testPropertySeparatorsToIndex() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "ignorePlurals" - */ - public function testPropertyIgnorePlurals() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "removeStopWords" - */ - public function testPropertyRemoveStopWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "keepDiacriticsOnCharacters" - */ - public function testPropertyKeepDiacriticsOnCharacters() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryLanguages" - */ - public function testPropertyQueryLanguages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "decompoundQuery" - */ - public function testPropertyDecompoundQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enableRules" - */ - public function testPropertyEnableRules() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enablePersonalization" - */ - public function testPropertyEnablePersonalization() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryType" - */ - public function testPropertyQueryType() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "removeWordsIfNoResults" - */ - public function testPropertyRemoveWordsIfNoResults() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "advancedSyntax" - */ - public function testPropertyAdvancedSyntax() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "optionalWords" - */ - public function testPropertyOptionalWords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "disableExactOnAttributes" - */ - public function testPropertyDisableExactOnAttributes() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "exactOnSingleWordQuery" - */ - public function testPropertyExactOnSingleWordQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "alternativesAsExact" - */ - public function testPropertyAlternativesAsExact() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "advancedSyntaxFeatures" - */ - public function testPropertyAdvancedSyntaxFeatures() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "distinct" - */ - public function testPropertyDistinct() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "synonyms" - */ - public function testPropertySynonyms() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "replaceSynonymsInHighlight" - */ - public function testPropertyReplaceSynonymsInHighlight() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "minProximity" - */ - public function testPropertyMinProximity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "responseFields" - */ - public function testPropertyResponseFields() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "maxFacetHits" - */ - public function testPropertyMaxFacetHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "attributeCriteriaComputedByMinProximity" - */ - public function testPropertyAttributeCriteriaComputedByMinProximity() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "renderingContent" - */ - public function testPropertyRenderingContent() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchResponseTest.php b/clients/algoliasearch-client-php/test/Model/SearchResponseTest.php deleted file mode 100644 index 0a321de06a..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchResponseTest.php +++ /dev/null @@ -1,306 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "abTestID" - */ - public function testPropertyAbTestID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "abTestVariantID" - */ - public function testPropertyAbTestVariantID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "aroundLatLng" - */ - public function testPropertyAroundLatLng() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "automaticRadius" - */ - public function testPropertyAutomaticRadius() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "exhaustiveFacetsCount" - */ - public function testPropertyExhaustiveFacetsCount() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "exhaustiveNbHits" - */ - public function testPropertyExhaustiveNbHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "exhaustiveTypo" - */ - public function testPropertyExhaustiveTypo() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facets" - */ - public function testPropertyFacets() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "facetsStats" - */ - public function testPropertyFacetsStats() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hitsPerPage" - */ - public function testPropertyHitsPerPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "index" - */ - public function testPropertyIndex() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "indexUsed" - */ - public function testPropertyIndexUsed() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "message" - */ - public function testPropertyMessage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbHits" - */ - public function testPropertyNbHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbPages" - */ - public function testPropertyNbPages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbSortedHits" - */ - public function testPropertyNbSortedHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "page" - */ - public function testPropertyPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "params" - */ - public function testPropertyParams() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "parsedQuery" - */ - public function testPropertyParsedQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "processingTimeMS" - */ - public function testPropertyProcessingTimeMS() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "query" - */ - public function testPropertyQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "queryAfterRemoval" - */ - public function testPropertyQueryAfterRemoval() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "serverUsed" - */ - public function testPropertyServerUsed() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userData" - */ - public function testPropertyUserData() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hits" - */ - public function testPropertyHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchRulesParamsTest.php b/clients/algoliasearch-client-php/test/Model/SearchRulesParamsTest.php deleted file mode 100644 index 2f520848ec..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchRulesParamsTest.php +++ /dev/null @@ -1,144 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "query" - */ - public function testPropertyQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "anchoring" - */ - public function testPropertyAnchoring() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "context" - */ - public function testPropertyContext() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "page" - */ - public function testPropertyPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hitsPerPage" - */ - public function testPropertyHitsPerPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "enabled" - */ - public function testPropertyEnabled() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "requestOptions" - */ - public function testPropertyRequestOptions() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchRulesResponseTest.php b/clients/algoliasearch-client-php/test/Model/SearchRulesResponseTest.php deleted file mode 100644 index 0502222350..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchRulesResponseTest.php +++ /dev/null @@ -1,117 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hits" - */ - public function testPropertyHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbHits" - */ - public function testPropertyNbHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "page" - */ - public function testPropertyPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbPages" - */ - public function testPropertyNbPages() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchSynonymsResponseTest.php b/clients/algoliasearch-client-php/test/Model/SearchSynonymsResponseTest.php deleted file mode 100644 index 7455339a91..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchSynonymsResponseTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hits" - */ - public function testPropertyHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbHits" - */ - public function testPropertyNbHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchUserIdsObjectTest.php b/clients/algoliasearch-client-php/test/Model/SearchUserIdsObjectTest.php deleted file mode 100644 index 94dfb9251b..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchUserIdsObjectTest.php +++ /dev/null @@ -1,117 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "query" - */ - public function testPropertyQuery() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "clusterName" - */ - public function testPropertyClusterName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "page" - */ - public function testPropertyPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hitsPerPage" - */ - public function testPropertyHitsPerPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHighlightResultTest.php b/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHighlightResultTest.php deleted file mode 100644 index f87d6c0030..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHighlightResultTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userID" - */ - public function testPropertyUserID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "clusterName" - */ - public function testPropertyClusterName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHitsTest.php b/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHitsTest.php deleted file mode 100644 index 342971dfd0..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseHitsTest.php +++ /dev/null @@ -1,135 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userID" - */ - public function testPropertyUserID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "clusterName" - */ - public function testPropertyClusterName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbRecords" - */ - public function testPropertyNbRecords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "dataSize" - */ - public function testPropertyDataSize() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "objectID" - */ - public function testPropertyObjectID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "highlightResult" - */ - public function testPropertyHighlightResult() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseTest.php b/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseTest.php deleted file mode 100644 index 41d3af7425..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SearchUserIdsResponseTest.php +++ /dev/null @@ -1,126 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hits" - */ - public function testPropertyHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbHits" - */ - public function testPropertyNbHits() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "page" - */ - public function testPropertyPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "hitsPerPage" - */ - public function testPropertyHitsPerPage() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "updatedAt" - */ - public function testPropertyUpdatedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SnippetResultTest.php b/clients/algoliasearch-client-php/test/Model/SnippetResultTest.php deleted file mode 100644 index d3d7def9d5..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SnippetResultTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "value" - */ - public function testPropertyValue() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "matchLevel" - */ - public function testPropertyMatchLevel() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SourceTest.php b/clients/algoliasearch-client-php/test/Model/SourceTest.php deleted file mode 100644 index 54d065f546..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SourceTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "source" - */ - public function testPropertySource() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "description" - */ - public function testPropertyDescription() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/StandardEntriesTest.php b/clients/algoliasearch-client-php/test/Model/StandardEntriesTest.php deleted file mode 100644 index c5ec51b0e4..0000000000 --- a/clients/algoliasearch-client-php/test/Model/StandardEntriesTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "plurals" - */ - public function testPropertyPlurals() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "stopwords" - */ - public function testPropertyStopwords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "compounds" - */ - public function testPropertyCompounds() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SynonymHitHighlightResultTest.php b/clients/algoliasearch-client-php/test/Model/SynonymHitHighlightResultTest.php deleted file mode 100644 index 1807f5643c..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SynonymHitHighlightResultTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "type" - */ - public function testPropertyType() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "synonyms" - */ - public function testPropertySynonyms() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/SynonymHitTest.php b/clients/algoliasearch-client-php/test/Model/SynonymHitTest.php deleted file mode 100644 index c7cee5df9b..0000000000 --- a/clients/algoliasearch-client-php/test/Model/SynonymHitTest.php +++ /dev/null @@ -1,162 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "objectID" - */ - public function testPropertyObjectID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "type" - */ - public function testPropertyType() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "synonyms" - */ - public function testPropertySynonyms() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "input" - */ - public function testPropertyInput() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "word" - */ - public function testPropertyWord() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "corrections" - */ - public function testPropertyCorrections() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "placeholder" - */ - public function testPropertyPlaceholder() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "replacements" - */ - public function testPropertyReplacements() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "highlightResult" - */ - public function testPropertyHighlightResult() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/TimeRangeTest.php b/clients/algoliasearch-client-php/test/Model/TimeRangeTest.php deleted file mode 100644 index fc0a3b8006..0000000000 --- a/clients/algoliasearch-client-php/test/Model/TimeRangeTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "from" - */ - public function testPropertyFrom() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "until" - */ - public function testPropertyUntil() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/UpdateApiKeyResponseTest.php b/clients/algoliasearch-client-php/test/Model/UpdateApiKeyResponseTest.php deleted file mode 100644 index 8e6f3fd056..0000000000 --- a/clients/algoliasearch-client-php/test/Model/UpdateApiKeyResponseTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "key" - */ - public function testPropertyKey() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "updatedAt" - */ - public function testPropertyUpdatedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/UpdatedAtResponseTest.php b/clients/algoliasearch-client-php/test/Model/UpdatedAtResponseTest.php deleted file mode 100644 index 8ffc6387c4..0000000000 --- a/clients/algoliasearch-client-php/test/Model/UpdatedAtResponseTest.php +++ /dev/null @@ -1,99 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "taskID" - */ - public function testPropertyTaskID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "updatedAt" - */ - public function testPropertyUpdatedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/UpdatedAtWithObjectIdResponseTest.php b/clients/algoliasearch-client-php/test/Model/UpdatedAtWithObjectIdResponseTest.php deleted file mode 100644 index e7278f7dff..0000000000 --- a/clients/algoliasearch-client-php/test/Model/UpdatedAtWithObjectIdResponseTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "taskID" - */ - public function testPropertyTaskID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "updatedAt" - */ - public function testPropertyUpdatedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "objectID" - */ - public function testPropertyObjectID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/UpdatedRuleResponseTest.php b/clients/algoliasearch-client-php/test/Model/UpdatedRuleResponseTest.php deleted file mode 100644 index 2229eff588..0000000000 --- a/clients/algoliasearch-client-php/test/Model/UpdatedRuleResponseTest.php +++ /dev/null @@ -1,108 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "objectID" - */ - public function testPropertyObjectID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "updatedAt" - */ - public function testPropertyUpdatedAt() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "taskID" - */ - public function testPropertyTaskID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/clients/algoliasearch-client-php/test/Model/UserIdTest.php b/clients/algoliasearch-client-php/test/Model/UserIdTest.php deleted file mode 100644 index 8178cd3a16..0000000000 --- a/clients/algoliasearch-client-php/test/Model/UserIdTest.php +++ /dev/null @@ -1,117 +0,0 @@ -markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "userID" - */ - public function testPropertyUserID() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "clusterName" - */ - public function testPropertyClusterName() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "nbRecords" - */ - public function testPropertyNbRecords() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } - - /** - * Test attribute "dataSize" - */ - public function testPropertyDataSize() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -} diff --git a/templates/php/ApiException.mustache b/templates/php/ApiException.mustache index ade19b2653..dbcb1c3fde 100644 --- a/templates/php/ApiException.mustache +++ b/templates/php/ApiException.mustache @@ -1,20 +1,4 @@ partial_header}} -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ namespace {{invokerPackage}}; @@ -25,8 +9,6 @@ use \Exception; * * @category Class * @package {{invokerPackage}} - * @author OpenAPI Generator team - * @link https://openapi-generator.tech */ class ApiException extends Exception { diff --git a/templates/php/Configuration.mustache b/templates/php/Configuration.mustache index 563ac5f9b4..4850801977 100644 --- a/templates/php/Configuration.mustache +++ b/templates/php/Configuration.mustache @@ -1,20 +1,4 @@ partial_header}} -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ namespace {{invokerPackage}}; @@ -24,8 +8,6 @@ namespace {{invokerPackage}}; * * @category Class * @package {{invokerPackage}} - * @author OpenAPI Generator team - * @link https://openapi-generator.tech */ class Configuration { diff --git a/templates/php/HeaderSelector.mustache b/templates/php/HeaderSelector.mustache index aece2d69c0..8645ef25ff 100644 --- a/templates/php/HeaderSelector.mustache +++ b/templates/php/HeaderSelector.mustache @@ -1,20 +1,4 @@ partial_header}} -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ namespace {{invokerPackage}}; @@ -25,8 +9,6 @@ use \Exception; * * @category Class * @package {{invokerPackage}} - * @author OpenAPI Generator team - * @link https://openapi-generator.tech */ class HeaderSelector { diff --git a/templates/php/ModelInterface.mustache b/templates/php/ModelInterface.mustache index 417ca5d56e..e69228a020 100644 --- a/templates/php/ModelInterface.mustache +++ b/templates/php/ModelInterface.mustache @@ -1,21 +1,4 @@ partial_header}} -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ namespace {{modelPackage}}; @@ -23,7 +6,6 @@ namespace {{modelPackage}}; * Interface abstracting model access. * * @package {{modelPackage}} - * @author OpenAPI Generator team */ interface ModelInterface { diff --git a/templates/php/ObjectSerializer.mustache b/templates/php/ObjectSerializer.mustache index 2d5c2c9113..0152319016 100644 --- a/templates/php/ObjectSerializer.mustache +++ b/templates/php/ObjectSerializer.mustache @@ -1,21 +1,4 @@ partial_header}} -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ namespace {{invokerPackage}}; @@ -26,8 +9,6 @@ use {{modelPackage}}\ModelInterface; * * @category Class * @package {{invokerPackage}} - * @author OpenAPI Generator team - * @link https://openapi-generator.tech */ class ObjectSerializer { diff --git a/templates/php/api.mustache b/templates/php/api.mustache index a611881659..cfe2d4a09d 100644 --- a/templates/php/api.mustache +++ b/templates/php/api.mustache @@ -1,20 +1,4 @@ partial_header}} -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ namespace {{apiPackage}}; @@ -35,8 +19,6 @@ use {{invokerPackage}}\ObjectSerializer; * * @category Class * @package {{invokerPackage}} - * @author OpenAPI Generator team - * @link https://openapi-generator.tech */ {{#operations}}class {{classname}} { diff --git a/templates/php/api_test.mustache b/templates/php/api_test.mustache index 6685fe5d5e..7912c06405 100644 --- a/templates/php/api_test.mustache +++ b/templates/php/api_test.mustache @@ -1,20 +1,4 @@ partial_header}} -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Please update the test case below to test the endpoint. - */ namespace {{invokerPackage}}\Test\Api; @@ -28,8 +12,6 @@ use PHPUnit\Framework\TestCase; * * @category Class * @package {{invokerPackage}} - * @author OpenAPI Generator team - * @link https://openapi-generator.tech */ {{#operations}}class {{classname}}Test extends TestCase { diff --git a/templates/php/model.mustache b/templates/php/model.mustache index c100009e5f..a6afd1683d 100644 --- a/templates/php/model.mustache +++ b/templates/php/model.mustache @@ -1,23 +1,6 @@ partial_header}} -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ namespace {{modelPackage}}; {{^isEnum}} @@ -36,8 +19,6 @@ use \{{invokerPackage}}\ObjectSerializer; * @description {{.}} {{/description}} * @package {{invokerPackage}} - * @author OpenAPI Generator team - * @link https://openapi-generator.tech {{^isEnum}} * @implements \ArrayAccess * @template TKey int|null diff --git a/templates/php/model_test.mustache b/templates/php/model_test.mustache index c2fffedde4..ad38765d94 100644 --- a/templates/php/model_test.mustache +++ b/templates/php/model_test.mustache @@ -1,23 +1,6 @@ partial_header}} -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Please update the test case below to test the model. - */ namespace {{invokerPackage}}\Test\Model; @@ -29,8 +12,6 @@ use PHPUnit\Framework\TestCase; * @category Class * @description {{description}}{{^description}}{{classname}}{{/description}} * @package {{invokerPackage}} - * @author OpenAPI Generator team - * @link https://openapi-generator.tech */ class {{classname}}Test extends TestCase { From 000f0a49ebaade90de193b7d4641e8baacdbf29a Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Wed, 12 Jan 2022 11:38:39 +0100 Subject: [PATCH 06/26] fix: cleanup some files --- clients/algoliasearch-client-php/.gitignore | 6 +- templates/php/.travis.yml | 9 --- templates/php/api_doc.mustache | 78 --------------------- templates/php/api_test.mustache | 61 ---------------- templates/php/git_push.sh.mustache | 57 --------------- templates/php/gitignore | 6 +- templates/php/model_doc.mustache | 10 --- templates/php/model_test.mustache | 68 ------------------ templates/php/partial_header.mustache | 18 ----- templates/php/phpunit.xml.mustache | 18 ----- 10 files changed, 4 insertions(+), 327 deletions(-) delete mode 100644 templates/php/.travis.yml delete mode 100644 templates/php/api_doc.mustache delete mode 100644 templates/php/api_test.mustache delete mode 100644 templates/php/git_push.sh.mustache delete mode 100644 templates/php/model_doc.mustache delete mode 100644 templates/php/model_test.mustache delete mode 100644 templates/php/partial_header.mustache delete mode 100644 templates/php/phpunit.xml.mustache diff --git a/clients/algoliasearch-client-php/.gitignore b/clients/algoliasearch-client-php/.gitignore index 92f7fdeff5..3d513912a6 100644 --- a/clients/algoliasearch-client-php/.gitignore +++ b/clients/algoliasearch-client-php/.gitignore @@ -3,12 +3,10 @@ composer.phar /vendor/ -# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control -# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -# composer.lock - # php-cs-fixer cache .php_cs.cache # PHPUnit cache .phpunit.result.cache + +.openapi-generator/ diff --git a/templates/php/.travis.yml b/templates/php/.travis.yml deleted file mode 100644 index 714772ee93..0000000000 --- a/templates/php/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: php -# Bionic environment has preinstalled PHP from 7.1 to 7.4 -# https://docs.travis-ci.com/user/reference/bionic/#php-support -dist: bionic -php: - - 7.3 - - 7.4 -before_install: "composer install" -script: "vendor/bin/phpunit" diff --git a/templates/php/api_doc.mustache b/templates/php/api_doc.mustache deleted file mode 100644 index 7c8460fe48..0000000000 --- a/templates/php/api_doc.mustache +++ /dev/null @@ -1,78 +0,0 @@ -# {{invokerPackage}}\{{classname}}{{#description}} - -{{.}}{{/description}} - -All URIs are relative to {{basePath}}. - -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}()**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}}{{#operations}}{{#operation}} - -## `{{{operationId}}}()` - -```php -{{{operationId}}}({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}: {{{.}}}{{/returnType}} -``` - -{{{summary}}}{{#notes}} - -{{{.}}}{{/notes}} - -### Example - -```php - php_doc_auth_partial}} -$apiInstance = new {{invokerPackage}}\Api\{{classname}}( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(){{#hasAuthMethods}}, - $config{{/hasAuthMethods}} -); -{{^vendorExtensions.x-group-parameters}} -{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}}{{#description}} | {{{.}}}{{/description}} -{{/allParams}} -{{/vendorExtensions.x-group-parameters}} -{{#vendorExtensions.x-group-parameters}} -{{#allParams}}$associate_array['{{paramName}}'] = {{{example}}}; // {{{dataType}}}{{#description}} | {{{.}}}{{/description}} -{{/allParams}} -{{/vendorExtensions.x-group-parameters}} - -try { - {{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{^vendorExtensions.x-group-parameters}}{{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}$associate_array{{/vendorExtensions.x-group-parameters}});{{#returnType}} - print_r($result);{{/returnType}} -} catch (Exception $e) { - echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; -} -``` - -### Parameters - -{{#vendorExtensions.x-group-parameters}} -Note: the input parameter is an associative array with the keys listed as the parameter name below. - -{{/vendorExtensions.x-group-parameters}} -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{{dataType}}}**](../Model/{{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}} -{{/allParams}} - -### Return type - -{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**](../Model/{{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} - -### Authorization - -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} - -### HTTP request headers - -- **Content-Type**: {{#consumes}}`{{{mediaType}}}`{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} -- **Accept**: {{#produces}}`{{{mediaType}}}`{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} - -[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) -[[Back to Model list]](../../README.md#models) -[[Back to README]](../../README.md){{/operation}}{{/operations}} diff --git a/templates/php/api_test.mustache b/templates/php/api_test.mustache deleted file mode 100644 index 7912c06405..0000000000 --- a/templates/php/api_test.mustache +++ /dev/null @@ -1,61 +0,0 @@ -markTestIncomplete('Not implemented'); - } - {{/operation}} -} -{{/operations}} diff --git a/templates/php/git_push.sh.mustache b/templates/php/git_push.sh.mustache deleted file mode 100644 index 0e3776ae6d..0000000000 --- a/templates/php/git_push.sh.mustache +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="{{{gitHost}}}" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="{{{gitUserId}}}" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="{{{gitRepoId}}}" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="{{{releaseNote}}}" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/templates/php/gitignore b/templates/php/gitignore index 92f7fdeff5..3d513912a6 100644 --- a/templates/php/gitignore +++ b/templates/php/gitignore @@ -3,12 +3,10 @@ composer.phar /vendor/ -# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control -# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -# composer.lock - # php-cs-fixer cache .php_cs.cache # PHPUnit cache .phpunit.result.cache + +.openapi-generator/ diff --git a/templates/php/model_doc.mustache b/templates/php/model_doc.mustache deleted file mode 100644 index 43b0ab6e13..0000000000 --- a/templates/php/model_doc.mustache +++ /dev/null @@ -1,10 +0,0 @@ -# {{#models}}{{#model}}# {{classname}} - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} |{{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}}{{#defaultValue}} [default to {{{.}}}]{{/defaultValue}} -{{/vars}} - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md){{/model}}{{/models}} diff --git a/templates/php/model_test.mustache b/templates/php/model_test.mustache deleted file mode 100644 index ad38765d94..0000000000 --- a/templates/php/model_test.mustache +++ /dev/null @@ -1,68 +0,0 @@ -markTestIncomplete('Not implemented'); - } -{{#vars}} - - /** - * Test attribute "{{name}}" - */ - public function testProperty{{nameInCamelCase}}() - { - // TODO: implement - $this->markTestIncomplete('Not implemented'); - } -{{/vars}} -} -{{/model}} -{{/models}} diff --git a/templates/php/partial_header.mustache b/templates/php/partial_header.mustache deleted file mode 100644 index ef3530aaee..0000000000 --- a/templates/php/partial_header.mustache +++ /dev/null @@ -1,18 +0,0 @@ -/** - {{#appName}} - * {{{.}}} - * - {{/appName}} - {{#appDescription}} - * {{{.}}} - * - {{/appDescription}} - {{#version}} - * The version of the OpenAPI document: {{{.}}} - {{/version}} - {{#infoEmail}} - * Contact: {{{.}}} - {{/infoEmail}} - * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: {{{generatorVersion}}} - */ diff --git a/templates/php/phpunit.xml.mustache b/templates/php/phpunit.xml.mustache deleted file mode 100644 index b72fb7c6e7..0000000000 --- a/templates/php/phpunit.xml.mustache +++ /dev/null @@ -1,18 +0,0 @@ - - - - - {{apiSrcPath}} - {{modelSrcPath}} - - - - - {{apiTestPath}} - {{modelTestPath}} - - - - - - From 20e10e5df717ada38e6d62deef71f898400ff506 Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Fri, 14 Jan 2022 16:55:23 +0100 Subject: [PATCH 07/26] chore(php): Add PHP linting and CI workflow (#81) --- .github/actions/cache/action.yml | 7 + .github/actions/setup/action.yml | 28 ++ .github/workflows/check.yml | 36 ++ clients/algoliasearch-client-php/.gitignore | 1 + .../.openapi-generator-ignore | 2 +- .../.openapi-generator/FILES | 104 ------ .../.openapi-generator/VERSION | 1 - .../.php-cs-fixer.php | 63 ++++ .../lib/Api/SearchApi.php | 350 ++++++++++-------- .../lib/ApiException.php | 3 +- .../lib/Configuration.php | 32 +- .../lib/HeaderSelector.php | 15 +- .../lib/Model/Action.php | 6 +- .../lib/Model/AddApiKeyResponse.php | 35 +- .../lib/Model/Anchoring.php | 6 +- .../lib/Model/ApiKey.php | 35 +- .../lib/Model/AssignUserIdObject.php | 34 +- .../lib/Model/AutomaticFacetFilter.php | 34 +- .../lib/Model/BaseBrowseResponse.php | 31 +- .../lib/Model/BaseIndexSettings.php | 54 ++- .../lib/Model/BaseSearchParams.php | 94 +++-- .../lib/Model/BaseSearchResponse.php | 72 ++-- .../Model/BaseSearchResponseFacetsStats.php | 38 +- .../lib/Model/BatchAssignUserIdsObject.php | 34 +- .../lib/Model/BatchDictionaryEntries.php | 34 +- .../Model/BatchDictionaryEntriesRequest.php | 32 +- .../lib/Model/BatchObject.php | 31 +- .../lib/Model/BatchResponse.php | 34 +- .../lib/Model/BatchWriteObject.php | 31 +- .../lib/Model/BrowseRequest.php | 32 +- .../lib/Model/BrowseResponse.php | 72 ++-- .../lib/Model/BuildInOperation.php | 35 +- .../lib/Model/Condition.php | 34 +- .../lib/Model/Consequence.php | 33 +- .../lib/Model/ConsequenceHide.php | 34 +- .../lib/Model/ConsequenceParams.php | 184 +++++---- .../lib/Model/CreatedAtObject.php | 33 +- .../lib/Model/CreatedAtResponse.php | 34 +- .../lib/Model/DeleteApiKeyResponse.php | 33 +- .../lib/Model/DeleteSourceResponse.php | 33 +- .../lib/Model/DeletedAtResponse.php | 36 +- .../lib/Model/DictionaryEntry.php | 40 +- .../lib/Model/DictionaryLanguage.php | 31 +- .../lib/Model/DictionarySettingsRequest.php | 32 +- .../lib/Model/ErrorBase.php | 31 +- .../Model/GetDictionarySettingsResponse.php | 31 +- .../lib/Model/GetLogsResponse.php | 31 +- .../lib/Model/GetLogsResponseInnerQueries.php | 36 +- .../lib/Model/GetLogsResponseLogs.php | 55 ++- .../lib/Model/GetObjectsObject.php | 31 +- .../lib/Model/GetObjectsResponse.php | 32 +- .../lib/Model/GetTaskResponse.php | 29 +- .../lib/Model/GetTopUserIdsResponse.php | 34 +- .../lib/Model/HighlightResult.php | 38 +- .../lib/Model/Index.php | 41 +- .../lib/Model/IndexSettings.php | 139 ++++--- .../lib/Model/IndexSettingsAsSearchParams.php | 114 +++--- .../lib/Model/KeyObject.php | 36 +- .../lib/Model/Languages.php | 32 +- .../lib/Model/ListApiKeysResponse.php | 33 +- .../lib/Model/ListClustersResponse.php | 34 +- .../lib/Model/ListIndicesResponse.php | 34 +- .../lib/Model/ListUserIdsResponse.php | 34 +- .../lib/Model/MultipleBatchResponse.php | 34 +- .../lib/Model/MultipleGetObjectsObject.php | 36 +- .../lib/Model/MultipleQueries.php | 39 +- .../lib/Model/MultipleQueriesObject.php | 29 +- .../lib/Model/MultipleQueriesResponse.php | 30 +- .../lib/Model/Operation.php | 34 +- .../lib/Model/OperationIndexObject.php | 34 +- .../lib/Model/Params.php | 37 +- .../lib/Model/Promote.php | 36 +- .../lib/Model/RankingInfo.php | 50 ++- .../Model/RankingInfoMatchedGeoLocation.php | 40 +- .../lib/Model/Record.php | 34 +- .../lib/Model/RemoveUserIdResponse.php | 33 +- .../lib/Model/ReplaceSourceResponse.php | 33 +- .../lib/Model/RequiredSearchParams.php | 33 +- .../lib/Model/Rule.php | 34 +- .../lib/Model/SaveObjectResponse.php | 34 +- .../lib/Model/SaveSynonymResponse.php | 37 +- .../lib/Model/SearchDictionaryEntries.php | 38 +- .../lib/Model/SearchForFacetValuesRequest.php | 35 +- .../Model/SearchForFacetValuesResponse.php | 31 +- .../SearchForFacetValuesResponseFacetHits.php | 35 +- .../lib/Model/SearchHits.php | 30 +- .../lib/Model/SearchParams.php | 182 +++++---- .../lib/Model/SearchParamsObject.php | 180 +++++---- .../lib/Model/SearchParamsString.php | 32 +- .../lib/Model/SearchResponse.php | 72 ++-- .../lib/Model/SearchRulesParams.php | 39 +- .../lib/Model/SearchRulesResponse.php | 39 +- .../lib/Model/SearchSynonymsResponse.php | 35 +- .../lib/Model/SearchUserIdsObject.php | 38 +- .../lib/Model/SearchUserIdsResponse.php | 40 +- .../SearchUserIdsResponseHighlightResult.php | 31 +- .../lib/Model/SearchUserIdsResponseHits.php | 37 +- .../lib/Model/SnippetResult.php | 33 +- .../lib/Model/Source.php | 36 +- .../lib/Model/StandardEntries.php | 37 +- .../lib/Model/SynonymHit.php | 46 +-- .../lib/Model/SynonymHitHighlightResult.php | 31 +- .../lib/Model/TimeRange.php | 35 +- .../lib/Model/UpdateApiKeyResponse.php | 35 +- .../lib/Model/UpdatedAtResponse.php | 36 +- .../Model/UpdatedAtWithObjectIdResponse.php | 37 +- .../lib/Model/UpdatedRuleResponse.php | 37 +- .../lib/Model/UserId.php | 40 +- .../lib/ObjectSerializer.php | 86 +++-- openapitools.json | 3 +- scripts/post-gen/php.sh | 15 + templates/php/.php-cs-fixer.php | 63 ++++ templates/php/.php_cs | 23 -- templates/php/gitignore | 1 + 114 files changed, 2498 insertions(+), 2445 deletions(-) delete mode 100644 clients/algoliasearch-client-php/.openapi-generator/FILES delete mode 100644 clients/algoliasearch-client-php/.openapi-generator/VERSION create mode 100644 clients/algoliasearch-client-php/.php-cs-fixer.php create mode 100755 scripts/post-gen/php.sh create mode 100644 templates/php/.php-cs-fixer.php delete mode 100644 templates/php/.php_cs diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index ca661593a0..4920e4a31e 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -67,6 +67,13 @@ runs: path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-java-2/target key: ${{ runner.os }}-java-client-${{ hashFiles('clients/algoliasearch-client-java-2/**') }} + - name: Restore built PHP search client + if: ${{ inputs.job == 'cts' }} + uses: actions/cache@v2 + with: + path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-php/dist + key: ${{ runner.os }}-php-client-${{ hashFiles('clients/algoliasearch-client-php/**') }} + # setup yarn - name: Get yarn cache directory path shell: bash diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 5d0c437c85..1398e38277 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -40,6 +40,9 @@ runs: echo "::set-output name=JAVA_CLIENT_CHANGED::$(git diff --shortstat origin/${{ github.base_ref }}..HEAD -- clients/algoliasearch-client-java-2 | wc -l)" echo "::set-output name=JAVA_TEMPLATE_CHANGED::$(git diff --shortstat origin/${{ github.base_ref }}..HEAD -- templates/java | wc -l)" + echo "::set-output name=PHP_CLIENT_CHANGED::$(git diff --shortstat origin/${{ github.base_ref }}..HEAD -- clients/algoliasearch-client-php | wc -l)" + echo "::set-output name=PHP_TEMPLATE_CHANGED::$(git diff --shortstat origin/${{ github.base_ref }}..HEAD -- templates/php | wc -l)" + - name: Compute specs matrix id: spec-matrix shell: bash @@ -91,6 +94,23 @@ runs: echo "::set-output name=MATRIX::$matrix" echo "::set-output name=RUN_CLIENT::$run" + - name: Compute the PHP client build matrix + id: php-matrix + shell: bash + run: | + base_changed=${{ github.ref == 'refs/heads/main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.COMMON_SPECS_CHANGED > 0 || steps.diff.outputs.SCRIPTS_CHANGED > 0 || steps.diff.outputs.PHP_TEMPLATE_CHANGED > 0 }} + + matrix=$(./scripts/ci/create-client-matrix.sh php $base_changed ${{ github.base_ref }}) + + if [[ $matrix == '{"client":["no-run"]}' ]]; then + run="false" + else + run="true" + fi + + echo "::set-output name=MATRIX::$matrix" + echo "::set-output name=RUN_CLIENT::$run" + outputs: RUN_SPECS: description: Whether to run specs or not @@ -116,6 +136,14 @@ outputs: description: Generate the matrix for the Java client value: ${{ steps.java-matrix.outputs.MATRIX }} + RUN_PHP: + description: Whether to run php client or not + value: ${{ steps.php-matrix.outputs.RUN_CLIENT }} + + PHP_MATRIX: + description: Generate the matrix for the PHP client + value: ${{ steps.php-matrix.outputs.MATRIX }} + RUN_CTS: description: Determine if the `cts` job should run value: ${{ github.ref_name == 'main' || steps.diff.outputs.GITHUB_ACTIONS_CHANGED > 0 || steps.diff.outputs.SCRIPTS_CHANGED > 0 || steps.diff.outputs.SPECS_CHANGED > 0 || steps.diff.outputs.TESTS_CHANGED > 0 || steps.diff.outputs.JS_CLIENT_CHANGED > 0 || steps.diff.outputs.JS_TEMPLATE_CHANGED > 0 || steps.diff.outputs.JAVA_CLIENT_CHANGED > 0 || steps.diff.outputs.JAVA_TEMPLATE_CHANGED > 0 }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index e417cb0d5c..9b0d1b2e80 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -36,6 +36,9 @@ jobs: RUN_JAVA: ${{ steps.setup.outputs.RUN_JAVA }} JAVA_MATRIX: ${{ steps.setup.outputs.JAVA_MATRIX }} + RUN_PHP: ${{ steps.setup.outputs.RUN_PHP }} + PHP_MATRIX: ${{ steps.setup.outputs.PHP_MATRIX }} + RUN_CTS: ${{ steps.setup.outputs.RUN_CTS }} specs: @@ -116,11 +119,44 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: yarn build:clients java ${{ matrix.client.name }} + client_php: + runs-on: ubuntu-20.04 + needs: + - setup + - specs + if: ${{ always() && needs.setup.outputs.RUN_PHP == 'true' }} + strategy: + matrix: ${{ fromJSON(needs.setup.outputs.PHP_MATRIX) }} + steps: + - uses: actions/checkout@v2 + + - name: Restore cache + uses: ./.github/actions/cache + with: + job: php + + - name: Cache ${{ matrix.client.name }} client + id: cache + uses: actions/cache@v2 + with: + path: '/home/runner/work/api-clients-automation/api-clients-automation/${{ matrix.client.folder }}/dist' + key: ${{ runner.os }}-php-client-${{ matrix.client.name }}-${{ hashFiles(format('{0}/**', matrix.client.folder)) }} + + - name: Generate ${{ matrix.client.name }} client + if: steps.cache.outputs.cache-hit != 'true' + run: yarn generate php ${{ matrix.client.name }} + + - name: Build ${{ matrix.client.name }} client + if: steps.cache.outputs.cache-hit != 'true' + run: yarn build:clients php ${{ matrix.client.name }} + cts: runs-on: ubuntu-20.04 needs: - client_javascript - client_java + - client_php + if: ${{ always() && needs.setup.outputs.RUN_CTS == 'true' }} steps: - uses: actions/checkout@v2 diff --git a/clients/algoliasearch-client-php/.gitignore b/clients/algoliasearch-client-php/.gitignore index 3d513912a6..aa44c17b5e 100644 --- a/clients/algoliasearch-client-php/.gitignore +++ b/clients/algoliasearch-client-php/.gitignore @@ -10,3 +10,4 @@ composer.phar .phpunit.result.cache .openapi-generator/ +composer.lock diff --git a/clients/algoliasearch-client-php/.openapi-generator-ignore b/clients/algoliasearch-client-php/.openapi-generator-ignore index d8c3ddaef1..e0b35c13b6 100644 --- a/clients/algoliasearch-client-php/.openapi-generator-ignore +++ b/clients/algoliasearch-client-php/.openapi-generator-ignore @@ -8,7 +8,7 @@ docs/** test/** .travis.yml -.php_cs phpunit.xml.dist README.md git_push.sh +.php_cs diff --git a/clients/algoliasearch-client-php/.openapi-generator/FILES b/clients/algoliasearch-client-php/.openapi-generator/FILES deleted file mode 100644 index 83e22b9826..0000000000 --- a/clients/algoliasearch-client-php/.openapi-generator/FILES +++ /dev/null @@ -1,104 +0,0 @@ -.gitignore -composer.json -lib/Api/SearchApi.php -lib/ApiException.php -lib/Configuration.php -lib/HeaderSelector.php -lib/Model/Action.php -lib/Model/AddApiKeyResponse.php -lib/Model/Anchoring.php -lib/Model/ApiKey.php -lib/Model/AssignUserIdObject.php -lib/Model/AutomaticFacetFilter.php -lib/Model/BaseBrowseResponse.php -lib/Model/BaseIndexSettings.php -lib/Model/BaseSearchParams.php -lib/Model/BaseSearchResponse.php -lib/Model/BaseSearchResponseFacetsStats.php -lib/Model/BatchAssignUserIdsObject.php -lib/Model/BatchDictionaryEntries.php -lib/Model/BatchDictionaryEntriesRequest.php -lib/Model/BatchObject.php -lib/Model/BatchResponse.php -lib/Model/BatchWriteObject.php -lib/Model/BrowseRequest.php -lib/Model/BrowseResponse.php -lib/Model/BuildInOperation.php -lib/Model/Condition.php -lib/Model/Consequence.php -lib/Model/ConsequenceHide.php -lib/Model/ConsequenceParams.php -lib/Model/CreatedAtObject.php -lib/Model/CreatedAtResponse.php -lib/Model/DeleteApiKeyResponse.php -lib/Model/DeleteSourceResponse.php -lib/Model/DeletedAtResponse.php -lib/Model/DictionaryEntry.php -lib/Model/DictionaryLanguage.php -lib/Model/DictionarySettingsRequest.php -lib/Model/ErrorBase.php -lib/Model/GetDictionarySettingsResponse.php -lib/Model/GetLogsResponse.php -lib/Model/GetLogsResponseInnerQueries.php -lib/Model/GetLogsResponseLogs.php -lib/Model/GetObjectsObject.php -lib/Model/GetObjectsResponse.php -lib/Model/GetTaskResponse.php -lib/Model/GetTopUserIdsResponse.php -lib/Model/HighlightResult.php -lib/Model/Index.php -lib/Model/IndexSettings.php -lib/Model/IndexSettingsAsSearchParams.php -lib/Model/KeyObject.php -lib/Model/Languages.php -lib/Model/ListApiKeysResponse.php -lib/Model/ListClustersResponse.php -lib/Model/ListIndicesResponse.php -lib/Model/ListUserIdsResponse.php -lib/Model/ModelInterface.php -lib/Model/MultipleBatchResponse.php -lib/Model/MultipleGetObjectsObject.php -lib/Model/MultipleQueries.php -lib/Model/MultipleQueriesObject.php -lib/Model/MultipleQueriesResponse.php -lib/Model/Operation.php -lib/Model/OperationIndexObject.php -lib/Model/Params.php -lib/Model/Promote.php -lib/Model/RankingInfo.php -lib/Model/RankingInfoMatchedGeoLocation.php -lib/Model/Record.php -lib/Model/RemoveUserIdResponse.php -lib/Model/ReplaceSourceResponse.php -lib/Model/RequiredSearchParams.php -lib/Model/Rule.php -lib/Model/SaveObjectResponse.php -lib/Model/SaveSynonymResponse.php -lib/Model/SearchDictionaryEntries.php -lib/Model/SearchForFacetValuesRequest.php -lib/Model/SearchForFacetValuesResponse.php -lib/Model/SearchForFacetValuesResponseFacetHits.php -lib/Model/SearchHits.php -lib/Model/SearchParams.php -lib/Model/SearchParamsObject.php -lib/Model/SearchParamsString.php -lib/Model/SearchResponse.php -lib/Model/SearchRulesParams.php -lib/Model/SearchRulesResponse.php -lib/Model/SearchSynonymsResponse.php -lib/Model/SearchUserIdsObject.php -lib/Model/SearchUserIdsResponse.php -lib/Model/SearchUserIdsResponseHighlightResult.php -lib/Model/SearchUserIdsResponseHits.php -lib/Model/SnippetResult.php -lib/Model/Source.php -lib/Model/StandardEntries.php -lib/Model/SynonymHit.php -lib/Model/SynonymHitHighlightResult.php -lib/Model/TimeRange.php -lib/Model/UpdateApiKeyResponse.php -lib/Model/UpdatedAtResponse.php -lib/Model/UpdatedAtWithObjectIdResponse.php -lib/Model/UpdatedRuleResponse.php -lib/Model/UserId.php -lib/ObjectSerializer.php diff --git a/clients/algoliasearch-client-php/.openapi-generator/VERSION b/clients/algoliasearch-client-php/.openapi-generator/VERSION deleted file mode 100644 index e230c8396d..0000000000 --- a/clients/algoliasearch-client-php/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.3.0 \ No newline at end of file diff --git a/clients/algoliasearch-client-php/.php-cs-fixer.php b/clients/algoliasearch-client-php/.php-cs-fixer.php new file mode 100644 index 0000000000..96dde31c05 --- /dev/null +++ b/clients/algoliasearch-client-php/.php-cs-fixer.php @@ -0,0 +1,63 @@ +setUsingCache(true) + ->setRules([ + 'array_syntax' => [ 'syntax' => 'short' ], + 'blank_line_after_namespace' => false, + 'blank_line_after_opening_tag' => true, + 'blank_line_before_statement' => true, + 'braces' => false, + 'cast_spaces' => true, + 'combine_consecutive_unsets' => true, + 'echo_tag_syntax' => true, + 'general_phpdoc_tag_rename' => true, + 'mb_str_functions' => true, + 'no_blank_lines_after_class_opening' => true, + 'no_empty_phpdoc' => true, + 'no_empty_statement' => true, + 'no_extra_blank_lines' => true, + 'no_multiline_whitespace_around_double_arrow' => true, + 'no_short_bool_cast' => true, + 'no_trailing_whitespace' => true, + 'no_trailing_whitespace_in_comment' => false, + 'no_unneeded_control_parentheses' => true, + 'no_unreachable_default_argument_value' => true, + 'no_unused_imports' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, + 'no_whitespace_before_comma_in_array' => true, + 'no_whitespace_in_blank_line' => true, + 'normalize_index_brace' => true, + 'not_operator_with_space' => false, + 'object_operator_without_whitespace' => true, + 'ordered_imports' => true, + 'phpdoc_annotation_without_dot' => true, + 'phpdoc_inline_tag_normalizer' => true, + 'phpdoc_order' => true, + 'phpdoc_scalar' => true, + 'phpdoc_separation' => true, + 'phpdoc_single_line_var_spacing' => true, + 'phpdoc_tag_type' => true, + 'protected_to_private' => true, + '@PSR2' => true, + 'short_scalar_cast' => true, + 'single_blank_line_at_eof' => false, + 'single_blank_line_before_namespace' => true, + 'single_quote' => true, + 'space_after_semicolon' => true, + 'standardize_not_equals' => true, + 'strict_comparison' => true, + 'strict_param' => true, + 'ternary_operator_spaces' => true, + 'trailing_comma_in_multiline' => true, + 'trim_array_spaces' => true, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->exclude('test') + ->exclude('tests') + ->in(__DIR__) + ); diff --git a/clients/algoliasearch-client-php/lib/Api/SearchApi.php b/clients/algoliasearch-client-php/lib/Api/SearchApi.php index 9491959484..690b95da0a 100644 --- a/clients/algoliasearch-client-php/lib/Api/SearchApi.php +++ b/clients/algoliasearch-client-php/lib/Api/SearchApi.php @@ -2,17 +2,16 @@ namespace Algolia\AlgoliaSearch\Api; +use Algolia\AlgoliaSearch\ApiException; +use Algolia\AlgoliaSearch\Configuration; +use Algolia\AlgoliaSearch\HeaderSelector; +use Algolia\AlgoliaSearch\ObjectSerializer; use GuzzleHttp\Client; use GuzzleHttp\ClientInterface; -use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Exception\ConnectException; -use GuzzleHttp\Psr7\MultipartStream; +use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; -use Algolia\AlgoliaSearch\ApiException; -use Algolia\AlgoliaSearch\Configuration; -use Algolia\AlgoliaSearch\HeaderSelector; -use Algolia\AlgoliaSearch\ObjectSerializer; /** * SearchApi Class Doc Comment @@ -45,7 +44,7 @@ class SearchApi /** * @param Configuration $config */ - public function __construct(Configuration $config = null) + public function __construct(Configuration $config = null) { $this->config = $config ?: new Configuration(); @@ -91,6 +90,7 @@ public function getConfig() * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\AddApiKeyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function addApiKey($apiKey) @@ -110,9 +110,9 @@ public function addApiKey($apiKey) ['application/json'], ['application/json'] ); - if (isset($apiKey)) { + if (isset($apiKey)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($apiKey)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -142,7 +142,7 @@ public function addApiKey($apiKey) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\AddApiKeyResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -160,6 +160,7 @@ public function addApiKey($apiKey) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function addOrUpdateObject($indexName, $objectID, $body) @@ -207,9 +208,9 @@ public function addOrUpdateObject($indexName, $objectID, $body) ['application/json'], ['application/json'] ); - if (isset($body)) { + if (isset($body)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -239,7 +240,7 @@ public function addOrUpdateObject($indexName, $objectID, $body) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -253,6 +254,7 @@ public function addOrUpdateObject($indexName, $objectID, $body) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse */ public function appendSource($source) @@ -272,9 +274,9 @@ public function appendSource($source) ['application/json'], ['application/json'] ); - if (isset($source)) { + if (isset($source)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($source)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -304,7 +306,7 @@ public function appendSource($source) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\CreatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -321,6 +323,7 @@ public function appendSource($source) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function assignUserId($xAlgoliaUserID, $assignUserIdObject) @@ -331,8 +334,8 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdObject) 'Missing the required parameter $xAlgoliaUserID when calling assignUserId' ); } - if (!preg_match("/^[a-zA-Z0-9 \\-*.]+$/", $xAlgoliaUserID)) { - throw new \InvalidArgumentException("invalid value for \"xAlgoliaUserID\" when calling SearchApi.assignUserId, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."); + if (!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $xAlgoliaUserID)) { + throw new \InvalidArgumentException('invalid value for "xAlgoliaUserID" when calling SearchApi.assignUserId, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/.'); } // verify the required parameter 'assignUserIdObject' is set @@ -357,9 +360,9 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdObject) ['application/json'], ['application/json'] ); - if (isset($assignUserIdObject)) { + if (isset($assignUserIdObject)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($assignUserIdObject)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -389,7 +392,7 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdObject) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\CreatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -404,6 +407,7 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdObject) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\BatchResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function batch($indexName, $batchWriteObject) @@ -437,9 +441,9 @@ public function batch($indexName, $batchWriteObject) ['application/json'], ['application/json'] ); - if (isset($batchWriteObject)) { + if (isset($batchWriteObject)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($batchWriteObject)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -469,7 +473,7 @@ public function batch($indexName, $batchWriteObject) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\BatchResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -486,6 +490,7 @@ public function batch($indexName, $batchWriteObject) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject) @@ -496,8 +501,8 @@ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject) 'Missing the required parameter $xAlgoliaUserID when calling batchAssignUserIds' ); } - if (!preg_match("/^[a-zA-Z0-9 \\-*.]+$/", $xAlgoliaUserID)) { - throw new \InvalidArgumentException("invalid value for \"xAlgoliaUserID\" when calling SearchApi.batchAssignUserIds, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."); + if (!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $xAlgoliaUserID)) { + throw new \InvalidArgumentException('invalid value for "xAlgoliaUserID" when calling SearchApi.batchAssignUserIds, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/.'); } // verify the required parameter 'batchAssignUserIdsObject' is set @@ -522,9 +527,9 @@ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject) ['application/json'], ['application/json'] ); - if (isset($batchAssignUserIdsObject)) { + if (isset($batchAssignUserIdsObject)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($batchAssignUserIdsObject)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -554,7 +559,7 @@ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\CreatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -571,6 +576,7 @@ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntries) @@ -604,9 +610,9 @@ public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntries) ['application/json'], ['application/json'] ); - if (isset($batchDictionaryEntries)) { + if (isset($batchDictionaryEntries)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($batchDictionaryEntries)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -636,7 +642,7 @@ public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntries) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -655,6 +661,7 @@ public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntries) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearExistingRules = null) @@ -702,9 +709,9 @@ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearE ['application/json'], ['application/json'] ); - if (isset($rule)) { + if (isset($rule)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($rule)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -734,7 +741,7 @@ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearE $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -751,6 +758,7 @@ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearE * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\BrowseResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function browse($indexName, $browseRequest = null) @@ -778,9 +786,9 @@ public function browse($indexName, $browseRequest = null) ['application/json'], ['application/json'] ); - if (isset($browseRequest)) { + if (isset($browseRequest)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($browseRequest)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -810,7 +818,7 @@ public function browse($indexName, $browseRequest = null) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\BrowseResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -827,6 +835,7 @@ public function browse($indexName, $browseRequest = null) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function clearAllSynonyms($indexName, $forwardToReplicas = null) @@ -890,7 +899,7 @@ public function clearAllSynonyms($indexName, $forwardToReplicas = null) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -906,6 +915,7 @@ public function clearAllSynonyms($indexName, $forwardToReplicas = null) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function clearObjects($indexName) @@ -962,7 +972,7 @@ public function clearObjects($indexName) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -979,6 +989,7 @@ public function clearObjects($indexName) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function clearRules($indexName, $forwardToReplicas = null) @@ -1042,7 +1053,7 @@ public function clearRules($indexName, $forwardToReplicas = null) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -1058,6 +1069,7 @@ public function clearRules($indexName, $forwardToReplicas = null) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\DeleteApiKeyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function deleteApiKey($key) @@ -1114,7 +1126,7 @@ public function deleteApiKey($key) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeleteApiKeyResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -1131,6 +1143,7 @@ public function deleteApiKey($key) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function deleteBy($indexName, $searchParams) @@ -1164,9 +1177,9 @@ public function deleteBy($indexName, $searchParams) ['application/json'], ['application/json'] ); - if (isset($searchParams)) { + if (isset($searchParams)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchParams)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -1196,7 +1209,7 @@ public function deleteBy($indexName, $searchParams) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeletedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -1212,6 +1225,7 @@ public function deleteBy($indexName, $searchParams) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function deleteIndex($indexName) @@ -1268,7 +1282,7 @@ public function deleteIndex($indexName) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeletedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -1285,6 +1299,7 @@ public function deleteIndex($indexName) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function deleteObject($indexName, $objectID) @@ -1355,7 +1370,7 @@ public function deleteObject($indexName, $objectID) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeletedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -1373,6 +1388,7 @@ public function deleteObject($indexName, $objectID) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) @@ -1450,7 +1466,7 @@ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -1464,6 +1480,7 @@ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\DeleteSourceResponse */ public function deleteSource($source) @@ -1520,7 +1537,7 @@ public function deleteSource($source) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeleteSourceResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -1538,6 +1555,7 @@ public function deleteSource($source) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) @@ -1615,7 +1633,7 @@ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeletedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -1631,6 +1649,7 @@ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\KeyObject|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getApiKey($key) @@ -1687,7 +1706,7 @@ public function getApiKey($key) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\KeyObject'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -1702,11 +1721,11 @@ public function getApiKey($key) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return array|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getDictionaryLanguages() { - $resourcePath = '/1/dictionaries/*/languages'; $queryParams = []; $headerParams = []; @@ -1744,7 +1763,7 @@ public function getDictionaryLanguages() $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = 'array<string,\Algolia\AlgoliaSearch\Model\Languages>'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -1759,11 +1778,11 @@ public function getDictionaryLanguages() * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\GetDictionarySettingsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getDictionarySettings() { - $resourcePath = '/1/dictionaries/*/settings'; $queryParams = []; $headerParams = []; @@ -1801,7 +1820,7 @@ public function getDictionarySettings() $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetDictionarySettingsResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -1818,6 +1837,7 @@ public function getDictionarySettings() * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\GetLogsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getLogs($offset = 0, $length = 10, $indexName = null, $type = 'all') @@ -1826,7 +1846,6 @@ public function getLogs($offset = 0, $length = 10, $indexName = null, $type = 'a throw new \InvalidArgumentException('invalid value for "$length" when calling SearchApi.getLogs, must be smaller than or equal to 1000.'); } - $resourcePath = '/1/logs'; $queryParams = []; $headerParams = []; @@ -1892,7 +1911,7 @@ public function getLogs($offset = 0, $length = 10, $indexName = null, $type = 'a $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetLogsResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -1910,6 +1929,7 @@ public function getLogs($offset = 0, $length = 10, $indexName = null, $type = 'a * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return array|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getObject($indexName, $objectID, $attributesToRetrieve = null) @@ -1987,7 +2007,7 @@ public function getObject($indexName, $objectID, $attributesToRetrieve = null) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = 'array<string,string>'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2003,6 +2023,7 @@ public function getObject($indexName, $objectID, $attributesToRetrieve = null) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\GetObjectsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getObjects($getObjectsObject) @@ -2022,9 +2043,9 @@ public function getObjects($getObjectsObject) ['application/json'], ['application/json'] ); - if (isset($getObjectsObject)) { + if (isset($getObjectsObject)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($getObjectsObject)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -2054,7 +2075,7 @@ public function getObjects($getObjectsObject) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetObjectsResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2071,6 +2092,7 @@ public function getObjects($getObjectsObject) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\Rule|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getRule($indexName, $objectID) @@ -2141,7 +2163,7 @@ public function getRule($indexName, $objectID) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\Rule'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2155,6 +2177,7 @@ public function getRule($indexName, $objectID) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\IndexSettings|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getSettings($indexName) @@ -2211,7 +2234,7 @@ public function getSettings($indexName) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\IndexSettings'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2224,11 +2247,11 @@ public function getSettings($indexName) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\Source[] */ public function getSources() { - $resourcePath = '/1/security/sources'; $queryParams = []; $headerParams = []; @@ -2266,7 +2289,7 @@ public function getSources() $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\Source[]'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2283,6 +2306,7 @@ public function getSources() * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\SynonymHit|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getSynonym($indexName, $objectID) @@ -2353,7 +2377,7 @@ public function getSynonym($indexName, $objectID) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\SynonymHit'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2368,6 +2392,7 @@ public function getSynonym($indexName, $objectID) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\GetTaskResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getTask($indexName, $taskID) @@ -2438,7 +2463,7 @@ public function getTask($indexName, $taskID) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetTaskResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2453,11 +2478,11 @@ public function getTask($indexName, $taskID) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\GetTopUserIdsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getTopUserIds() { - $resourcePath = '/1/clusters/mapping/top'; $queryParams = []; $headerParams = []; @@ -2495,7 +2520,7 @@ public function getTopUserIds() $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetTopUserIdsResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2511,6 +2536,7 @@ public function getTopUserIds() * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UserId|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getUserId($userID) @@ -2521,11 +2547,10 @@ public function getUserId($userID) 'Missing the required parameter $userID when calling getUserId' ); } - if (!preg_match("/^[a-zA-Z0-9 \\-*.]+$/", $userID)) { - throw new \InvalidArgumentException("invalid value for \"userID\" when calling SearchApi.getUserId, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."); + if (!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $userID)) { + throw new \InvalidArgumentException('invalid value for "userID" when calling SearchApi.getUserId, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/.'); } - $resourcePath = '/1/clusters/mapping/{userID}'; $queryParams = []; $headerParams = []; @@ -2571,7 +2596,7 @@ public function getUserId($userID) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UserId'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2587,11 +2612,11 @@ public function getUserId($userID) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function hasPendingMappings($getClusters = null) { - $resourcePath = '/1/clusters/mapping/pending'; $queryParams = []; $headerParams = []; @@ -2636,7 +2661,7 @@ public function hasPendingMappings($getClusters = null) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\CreatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2651,11 +2676,11 @@ public function hasPendingMappings($getClusters = null) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\ListApiKeysResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function listApiKeys() { - $resourcePath = '/1/keys'; $queryParams = []; $headerParams = []; @@ -2693,7 +2718,7 @@ public function listApiKeys() $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\ListApiKeysResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2708,11 +2733,11 @@ public function listApiKeys() * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\ListClustersResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function listClusters() { - $resourcePath = '/1/clusters'; $queryParams = []; $headerParams = []; @@ -2750,7 +2775,7 @@ public function listClusters() $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\ListClustersResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2766,11 +2791,11 @@ public function listClusters() * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\ListIndicesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function listIndices($page = null) { - $resourcePath = '/1/indexes'; $queryParams = []; $headerParams = []; @@ -2815,7 +2840,7 @@ public function listIndices($page = null) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\ListIndicesResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2832,11 +2857,11 @@ public function listIndices($page = null) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\ListUserIdsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function listUserIds($page = null, $hitsPerPage = 100) { - $resourcePath = '/1/clusters/mapping'; $queryParams = []; $headerParams = []; @@ -2888,7 +2913,7 @@ public function listUserIds($page = null, $hitsPerPage = 100) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\ListUserIdsResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2902,6 +2927,7 @@ public function listUserIds($page = null, $hitsPerPage = 100) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\MultipleBatchResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function multipleBatch($batchObject) @@ -2921,9 +2947,9 @@ public function multipleBatch($batchObject) ['application/json'], ['application/json'] ); - if (isset($batchObject)) { + if (isset($batchObject)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($batchObject)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -2953,7 +2979,7 @@ public function multipleBatch($batchObject) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\MultipleBatchResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -2967,6 +2993,7 @@ public function multipleBatch($batchObject) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\MultipleQueriesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function multipleQueries($multipleQueriesObject) @@ -2986,9 +3013,9 @@ public function multipleQueries($multipleQueriesObject) ['application/json'], ['application/json'] ); - if (isset($multipleQueriesObject)) { + if (isset($multipleQueriesObject)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($multipleQueriesObject)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -3018,7 +3045,7 @@ public function multipleQueries($multipleQueriesObject) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\MultipleQueriesResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -3035,6 +3062,7 @@ public function multipleQueries($multipleQueriesObject) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function operationIndex($indexName, $operationIndexObject) @@ -3068,9 +3096,9 @@ public function operationIndex($indexName, $operationIndexObject) ['application/json'], ['application/json'] ); - if (isset($operationIndexObject)) { + if (isset($operationIndexObject)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($operationIndexObject)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -3100,7 +3128,7 @@ public function operationIndex($indexName, $operationIndexObject) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -3119,6 +3147,7 @@ public function operationIndex($indexName, $operationIndexObject) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOperation, $createIfNotExists = true) @@ -3173,9 +3202,9 @@ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOp ['application/json'], ['application/json'] ); - if (isset($oneOfStringBuildInOperation)) { + if (isset($oneOfStringBuildInOperation)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($oneOfStringBuildInOperation)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -3205,7 +3234,7 @@ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOp $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -3221,6 +3250,7 @@ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOp * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\RemoveUserIdResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function removeUserId($userID) @@ -3231,11 +3261,10 @@ public function removeUserId($userID) 'Missing the required parameter $userID when calling removeUserId' ); } - if (!preg_match("/^[a-zA-Z0-9 \\-*.]+$/", $userID)) { - throw new \InvalidArgumentException("invalid value for \"userID\" when calling SearchApi.removeUserId, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."); + if (!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $userID)) { + throw new \InvalidArgumentException('invalid value for "userID" when calling SearchApi.removeUserId, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/.'); } - $resourcePath = '/1/clusters/mapping/{userID}'; $queryParams = []; $headerParams = []; @@ -3281,7 +3310,7 @@ public function removeUserId($userID) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\RemoveUserIdResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -3295,6 +3324,7 @@ public function removeUserId($userID) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\ReplaceSourceResponse */ public function replaceSources($source) @@ -3314,9 +3344,9 @@ public function replaceSources($source) ['application/json'], ['application/json'] ); - if (isset($source)) { + if (isset($source)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($source)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -3346,7 +3376,7 @@ public function replaceSources($source) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\ReplaceSourceResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -3362,6 +3392,7 @@ public function replaceSources($source) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\AddApiKeyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function restoreApiKey($key) @@ -3418,7 +3449,7 @@ public function restoreApiKey($key) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\AddApiKeyResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -3433,6 +3464,7 @@ public function restoreApiKey($key) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\SaveObjectResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function saveObject($indexName, $body) @@ -3466,9 +3498,9 @@ public function saveObject($indexName, $body) ['application/json'], ['application/json'] ); - if (isset($body)) { + if (isset($body)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -3498,7 +3530,7 @@ public function saveObject($indexName, $body) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\SaveObjectResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -3517,6 +3549,7 @@ public function saveObject($indexName, $body) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdatedRuleResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null) @@ -3571,9 +3604,9 @@ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null ['application/json'], ['application/json'] ); - if (isset($rule)) { + if (isset($rule)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($rule)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -3603,7 +3636,7 @@ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedRuleResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -3622,6 +3655,7 @@ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\SaveSynonymResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplicas = null) @@ -3676,9 +3710,9 @@ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplic ['application/json'], ['application/json'] ); - if (isset($synonymHit)) { + if (isset($synonymHit)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($synonymHit)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -3708,7 +3742,7 @@ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplic $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\SaveSynonymResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -3727,6 +3761,7 @@ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplic * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, $replaceExistingSynonyms = null) @@ -3774,9 +3809,9 @@ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, ['application/json'], ['application/json'] ); - if (isset($synonymHit)) { + if (isset($synonymHit)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($synonymHit)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -3806,7 +3841,7 @@ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -3821,6 +3856,7 @@ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\SearchResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function search($indexName, $searchParams) @@ -3854,9 +3890,9 @@ public function search($indexName, $searchParams) ['application/json'], ['application/json'] ); - if (isset($searchParams)) { + if (isset($searchParams)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchParams)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -3886,7 +3922,7 @@ public function search($indexName, $searchParams) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -3903,6 +3939,7 @@ public function search($indexName, $searchParams) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntries) @@ -3936,9 +3973,9 @@ public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntrie ['application/json'], ['application/json'] ); - if (isset($searchDictionaryEntries)) { + if (isset($searchDictionaryEntries)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchDictionaryEntries)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -3968,7 +4005,7 @@ public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntrie $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -3986,6 +4023,7 @@ public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntrie * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function searchForFacetValues($indexName, $facetName, $searchForFacetValuesRequest = null) @@ -4027,9 +4065,9 @@ public function searchForFacetValues($indexName, $facetName, $searchForFacetValu ['application/json'], ['application/json'] ); - if (isset($searchForFacetValuesRequest)) { + if (isset($searchForFacetValuesRequest)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchForFacetValuesRequest)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -4059,7 +4097,7 @@ public function searchForFacetValues($indexName, $facetName, $searchForFacetValu $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -4076,6 +4114,7 @@ public function searchForFacetValues($indexName, $facetName, $searchForFacetValu * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\SearchRulesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function searchRules($indexName, $searchRulesParams) @@ -4109,9 +4148,9 @@ public function searchRules($indexName, $searchRulesParams) ['application/json'], ['application/json'] ); - if (isset($searchRulesParams)) { + if (isset($searchRulesParams)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchRulesParams)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -4141,7 +4180,7 @@ public function searchRules($indexName, $searchRulesParams) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchRulesResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -4161,6 +4200,7 @@ public function searchRules($indexName, $searchRulesParams) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\SearchSynonymsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $hitsPerPage = 100) @@ -4245,7 +4285,7 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchSynonymsResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -4261,6 +4301,7 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\SearchUserIdsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function searchUserIds($searchUserIdsObject) @@ -4280,9 +4321,9 @@ public function searchUserIds($searchUserIdsObject) ['application/json'], ['application/json'] ); - if (isset($searchUserIdsObject)) { + if (isset($searchUserIdsObject)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchUserIdsObject)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -4312,7 +4353,7 @@ public function searchUserIds($searchUserIdsObject) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchUserIdsResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -4328,6 +4369,7 @@ public function searchUserIds($searchUserIdsObject) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function setDictionarySettings($dictionarySettingsRequest) @@ -4347,9 +4389,9 @@ public function setDictionarySettings($dictionarySettingsRequest) ['application/json'], ['application/json'] ); - if (isset($dictionarySettingsRequest)) { + if (isset($dictionarySettingsRequest)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($dictionarySettingsRequest)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -4379,7 +4421,7 @@ public function setDictionarySettings($dictionarySettingsRequest) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -4395,6 +4437,7 @@ public function setDictionarySettings($dictionarySettingsRequest) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function setSettings($indexName, $indexSettings, $forwardToReplicas = null) @@ -4435,9 +4478,9 @@ public function setSettings($indexName, $indexSettings, $forwardToReplicas = nul ['application/json'], ['application/json'] ); - if (isset($indexSettings)) { + if (isset($indexSettings)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($indexSettings)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -4467,7 +4510,7 @@ public function setSettings($indexName, $indexSettings, $forwardToReplicas = nul $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -4484,6 +4527,7 @@ public function setSettings($indexName, $indexSettings, $forwardToReplicas = nul * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException + * * @return \Algolia\AlgoliaSearch\Model\UpdateApiKeyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function updateApiKey($key, $apiKey) @@ -4517,9 +4561,9 @@ public function updateApiKey($key, $apiKey) ['application/json'], ['application/json'] ); - if (isset($apiKey)) { + if (isset($apiKey)) { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($apiKey)); - } + } // this endpoint requires API key authentication $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); if ($apiKey !== null) { @@ -4549,7 +4593,7 @@ public function updateApiKey($key, $apiKey) $headers, $httpBody ); - + $expectedResponse = null; $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdateApiKeyResponse'; list($response) = $this->sendRequest($request, $expectedResponse); @@ -4560,6 +4604,7 @@ public function updateApiKey($key, $apiKey) * Create http client option * * @throws \RuntimeException on file opening failure + * * @return array of http client options */ protected function createHttpClientOption() @@ -4579,12 +4624,14 @@ protected function createHttpClientOption() * Send the request and handle the response * * @throws \RuntimeException on file opening failure - * @return array + * + * @return array */ protected function sendRequest($request, $expectedResponse) { try { $options = $this->createHttpClientOption(); + try { $response = $this->client->send($request, $options); } catch (RequestException $e) { @@ -4618,7 +4665,7 @@ protected function sendRequest($request, $expectedResponse) ); } - switch($statusCode) { + switch ($statusCode) { case 200: if ($expectedResponse === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -4629,7 +4676,7 @@ protected function sendRequest($request, $expectedResponse) return [ ObjectSerializer::deserialize($content, $expectedResponse, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; case 400: if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { @@ -4641,7 +4688,7 @@ protected function sendRequest($request, $expectedResponse) return [ ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; case 402: if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { @@ -4653,7 +4700,7 @@ protected function sendRequest($request, $expectedResponse) return [ ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; case 403: if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { @@ -4665,7 +4712,7 @@ protected function sendRequest($request, $expectedResponse) return [ ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; case 404: if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { @@ -4677,7 +4724,7 @@ protected function sendRequest($request, $expectedResponse) return [ ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; } @@ -4692,9 +4739,8 @@ protected function sendRequest($request, $expectedResponse) return [ ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), - $response->getHeaders() + $response->getHeaders(), ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4704,6 +4750,7 @@ protected function sendRequest($request, $expectedResponse) $e->getResponseHeaders() ); $e->setResponseObject($data); + break; case 400: $data = ObjectSerializer::deserialize( @@ -4712,6 +4759,7 @@ protected function sendRequest($request, $expectedResponse) $e->getResponseHeaders() ); $e->setResponseObject($data); + break; case 402: $data = ObjectSerializer::deserialize( @@ -4720,6 +4768,7 @@ protected function sendRequest($request, $expectedResponse) $e->getResponseHeaders() ); $e->setResponseObject($data); + break; case 403: $data = ObjectSerializer::deserialize( @@ -4728,6 +4777,7 @@ protected function sendRequest($request, $expectedResponse) $e->getResponseHeaders() ); $e->setResponseObject($data); + break; case 404: $data = ObjectSerializer::deserialize( @@ -4736,8 +4786,10 @@ protected function sendRequest($request, $expectedResponse) $e->getResponseHeaders() ); $e->setResponseObject($data); + break; } + throw $e; } } diff --git a/clients/algoliasearch-client-php/lib/ApiException.php b/clients/algoliasearch-client-php/lib/ApiException.php index 0f80549494..d484a88eb5 100644 --- a/clients/algoliasearch-client-php/lib/ApiException.php +++ b/clients/algoliasearch-client-php/lib/ApiException.php @@ -12,7 +12,6 @@ */ class ApiException extends Exception { - /** * The HTTP body of the server response either as Json or string. * @@ -42,7 +41,7 @@ class ApiException extends Exception * @param string[]|null $responseHeaders HTTP response header * @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string */ - public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) + public function __construct($message = '', $code = 0, $responseHeaders = [], $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; diff --git a/clients/algoliasearch-client-php/lib/Configuration.php b/clients/algoliasearch-client-php/lib/Configuration.php index 30f2a5e7aa..3027efaecd 100644 --- a/clients/algoliasearch-client-php/lib/Configuration.php +++ b/clients/algoliasearch-client-php/lib/Configuration.php @@ -113,6 +113,7 @@ public function __construct(string $appId, string $algoliaApiKey = null) public function setApiKey($apiKeyIdentifier, $key) { $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; } @@ -139,6 +140,7 @@ public function getApiKey($apiKeyIdentifier) public function setApiKeyPrefix($apiKeyIdentifier, $prefix) { $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; } @@ -164,6 +166,7 @@ public function getApiKeyPrefix($apiKeyIdentifier) public function setAccessToken($accessToken) { $this->accessToken = $accessToken; + return $this; } @@ -192,7 +195,7 @@ public function setAppId($appId = '') /** * Gets the Algolia application ID * - * @return string + * @return string */ public function getAppId() { @@ -214,7 +217,7 @@ public function setAlgoliaApiKey($algoliaApiKey = '') /** * Gets the Algolia API Key * - * @return string + * @return string */ public function getAlgoliaApiKey() { @@ -231,6 +234,7 @@ public function getAlgoliaApiKey() public function setHost($host) { $this->host = $host; + return $this; } @@ -250,6 +254,7 @@ public function getHost() * @param string $userAgent the user agent of the api client * * @throws \InvalidArgumentException + * * @return $this */ public function setUserAgent($userAgent) @@ -259,6 +264,7 @@ public function setUserAgent($userAgent) } $this->userAgent = $userAgent; + return $this; } @@ -282,6 +288,7 @@ public function getUserAgent() public function setDebug($debug) { $this->debug = $debug; + return $this; } @@ -305,6 +312,7 @@ public function getDebug() public function setDebugFile($debugFile) { $this->debugFile = $debugFile; + return $this; } @@ -328,6 +336,7 @@ public function getDebugFile() public function setTempFolderPath($tempFolderPath) { $this->tempFolderPath = $tempFolderPath; + return $this; } @@ -417,9 +426,9 @@ public function getHostSettings() { return [ [ - "url" => "", - "description" => "No description provided", - ] + 'url' => '', + 'description' => 'No description provided', + ], ]; } @@ -428,6 +437,7 @@ public function getHostSettings() * * @param int $index index of the host settings * @param array|null $variables hash of variable and the corresponding value (optional) + * * @return string URL based on host settings */ public function getHostFromSettings($index, $variables = null) @@ -444,19 +454,19 @@ public function getHostFromSettings($index, $variables = null) } $host = $hosts[$index]; - $url = $host["url"]; + $url = $host['url']; // go through variable and assign a value - foreach ($host["variables"] ?? [] as $name => $variable) { + foreach ($host['variables'] ?? [] as $name => $variable) { if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user - if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum - $url = str_replace("{".$name."}", $variables[$name], $url); + if (in_array($variables[$name], $variable['enum_values'], true)) { // check to see if the value is in the enum + $url = str_replace('{'.$name.'}', $variables[$name], $url); } else { - throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); + throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].'. Must be '.join(',', $variable['enum_values']).'.'); } } else { // use default value - $url = str_replace("{".$name."}", $variable["default_value"], $url); + $url = str_replace('{'.$name.'}', $variable['default_value'], $url); } } diff --git a/clients/algoliasearch-client-php/lib/HeaderSelector.php b/clients/algoliasearch-client-php/lib/HeaderSelector.php index 7d68b37a53..c8cdd57128 100644 --- a/clients/algoliasearch-client-php/lib/HeaderSelector.php +++ b/clients/algoliasearch-client-php/lib/HeaderSelector.php @@ -2,8 +2,6 @@ namespace Algolia\AlgoliaSearch; -use \Exception; - /** * ApiException Class Doc Comment * @@ -12,10 +10,10 @@ */ class HeaderSelector { - /** * @param string[] $accept * @param string[] $contentTypes + * * @return array */ public function selectHeaders($accept, $contentTypes) @@ -28,11 +26,13 @@ public function selectHeaders($accept, $contentTypes) } $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); + return $headers; } /** * @param string[] $accept + * * @return array */ public function selectHeadersForMultipart($accept) @@ -40,6 +40,7 @@ public function selectHeadersForMultipart($accept) $headers = $this->selectHeaders($accept, []); unset($headers['Content-Type']); + return $headers; } @@ -56,9 +57,9 @@ private function selectAcceptHeader($accept) return null; } elseif ($jsonAccept = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept)) { return implode(',', $jsonAccept); - } else { - return implode(',', $accept); } + + return implode(',', $accept); } /** @@ -74,8 +75,8 @@ private function selectContentTypeHeader($contentType) return 'application/json'; } elseif (preg_grep("/application\/json/i", $contentType)) { return 'application/json'; - } else { - return implode(',', $contentType); } + + return implode(',', $contentType); } } diff --git a/clients/algoliasearch-client-php/lib/Model/Action.php b/clients/algoliasearch-client-php/lib/Model/Action.php index 8781092a8c..0296001727 100644 --- a/clients/algoliasearch-client-php/lib/Model/Action.php +++ b/clients/algoliasearch-client-php/lib/Model/Action.php @@ -1,13 +1,13 @@ 'string', - 'createdAt' => '\DateTime' + 'createdAt' => '\DateTime', ]; /** @@ -44,7 +44,7 @@ class AddApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPIFormats = [ 'key' => null, - 'createdAt' => 'date-time' + 'createdAt' => 'date-time', ]; /** @@ -75,7 +75,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'key' => 'key', - 'createdAt' => 'createdAt' + 'createdAt' => 'createdAt', ]; /** @@ -85,7 +85,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'key' => 'setKey', - 'createdAt' => 'setCreatedAt' + 'createdAt' => 'setCreatedAt', ]; /** @@ -95,7 +95,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'key' => 'getKey', - 'createdAt' => 'getCreatedAt' + 'createdAt' => 'getCreatedAt', ]; /** @@ -139,7 +139,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -174,6 +173,7 @@ public function listInvalidProperties() if ($this->container['createdAt'] === null) { $invalidProperties[] = "'createdAt' can't be null"; } + return $invalidProperties; } @@ -188,7 +188,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets key * @@ -202,7 +201,7 @@ public function getKey() /** * Sets key * - * @param string $key Key string. + * @param string $key key string * * @return self */ @@ -226,7 +225,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param \DateTime $createdAt Date of creation (ISO-8601 format). + * @param \DateTime $createdAt date of creation (ISO-8601 format) * * @return self */ @@ -239,9 +238,9 @@ public function setCreatedAt($createdAt) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -251,7 +250,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -280,7 +279,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -291,14 +290,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -325,4 +325,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/Anchoring.php b/clients/algoliasearch-client-php/lib/Model/Anchoring.php index 7760ddb377..031df08b5e 100644 --- a/clients/algoliasearch-client-php/lib/Model/Anchoring.php +++ b/clients/algoliasearch-client-php/lib/Model/Anchoring.php @@ -1,13 +1,13 @@ * @template TKey int|null @@ -39,7 +40,7 @@ class ApiKey implements ModelInterface, ArrayAccess, \JsonSerializable 'maxQueriesPerIPPerHour' => 'int', 'queryParameters' => 'string', 'referers' => 'string[]', - 'validity' => 'int' + 'validity' => 'int', ]; /** @@ -57,7 +58,7 @@ class ApiKey implements ModelInterface, ArrayAccess, \JsonSerializable 'maxQueriesPerIPPerHour' => null, 'queryParameters' => null, 'referers' => null, - 'validity' => null + 'validity' => null, ]; /** @@ -94,7 +95,7 @@ public static function openAPIFormats() 'maxQueriesPerIPPerHour' => 'maxQueriesPerIPPerHour', 'queryParameters' => 'queryParameters', 'referers' => 'referers', - 'validity' => 'validity' + 'validity' => 'validity', ]; /** @@ -110,7 +111,7 @@ public static function openAPIFormats() 'maxQueriesPerIPPerHour' => 'setMaxQueriesPerIPPerHour', 'queryParameters' => 'setQueryParameters', 'referers' => 'setReferers', - 'validity' => 'setValidity' + 'validity' => 'setValidity', ]; /** @@ -126,7 +127,7 @@ public static function openAPIFormats() 'maxQueriesPerIPPerHour' => 'getMaxQueriesPerIPPerHour', 'queryParameters' => 'getQueryParameters', 'referers' => 'getReferers', - 'validity' => 'getValidity' + 'validity' => 'getValidity', ]; /** @@ -247,6 +248,7 @@ public function listInvalidProperties() if ($this->container['acl'] === null) { $invalidProperties[] = "'acl' can't be null"; } + return $invalidProperties; } @@ -261,7 +263,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets acl * @@ -275,7 +276,7 @@ public function getAcl() /** * Sets acl * - * @param string[] $acl Set of permissions associated with the key. + * @param string[] $acl set of permissions associated with the key * * @return self */ @@ -380,7 +381,7 @@ public function getMaxQueriesPerIPPerHour() /** * Sets maxQueriesPerIPPerHour * - * @param int|null $maxQueriesPerIPPerHour Maximum number of API calls per hour allowed from a given IP address or a user token. + * @param int|null $maxQueriesPerIPPerHour maximum number of API calls per hour allowed from a given IP address or a user token * * @return self */ @@ -465,9 +466,9 @@ public function setValidity($validity) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -477,7 +478,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -506,7 +507,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -517,14 +518,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -551,4 +553,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php b/clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php index d46ef38fc3..258696246c 100644 --- a/clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php +++ b/clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * AssignUserIdObject Class Doc Comment * * @category Class * @description Assign userID object. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -32,7 +33,7 @@ class AssignUserIdObject implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'cluster' => 'string' + 'cluster' => 'string', ]; /** @@ -43,7 +44,7 @@ class AssignUserIdObject implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'cluster' => null + 'cluster' => null, ]; /** @@ -73,7 +74,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'cluster' => 'cluster' + 'cluster' => 'cluster', ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'cluster' => 'setCluster' + 'cluster' => 'setCluster', ]; /** @@ -91,7 +92,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'cluster' => 'getCluster' + 'cluster' => 'getCluster', ]; /** @@ -135,7 +136,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -166,6 +166,7 @@ public function listInvalidProperties() if ($this->container['cluster'] === null) { $invalidProperties[] = "'cluster' can't be null"; } + return $invalidProperties; } @@ -180,7 +181,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets cluster * @@ -194,7 +194,7 @@ public function getCluster() /** * Sets cluster * - * @param string $cluster Name of the cluster. + * @param string $cluster name of the cluster * * @return self */ @@ -207,9 +207,9 @@ public function setCluster($cluster) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -219,7 +219,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -248,7 +248,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -259,14 +259,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -293,4 +294,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/AutomaticFacetFilter.php b/clients/algoliasearch-client-php/lib/Model/AutomaticFacetFilter.php index 9f4acf5062..e95f3c1f58 100644 --- a/clients/algoliasearch-client-php/lib/Model/AutomaticFacetFilter.php +++ b/clients/algoliasearch-client-php/lib/Model/AutomaticFacetFilter.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * AutomaticFacetFilter Class Doc Comment * * @category Class * @description Automatic facet Filter. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -34,7 +35,7 @@ class AutomaticFacetFilter implements ModelInterface, ArrayAccess, \JsonSerializ protected static $openAPITypes = [ 'facet' => 'string', 'score' => 'int', - 'disjunctive' => 'bool' + 'disjunctive' => 'bool', ]; /** @@ -47,7 +48,7 @@ class AutomaticFacetFilter implements ModelInterface, ArrayAccess, \JsonSerializ protected static $openAPIFormats = [ 'facet' => null, 'score' => null, - 'disjunctive' => null + 'disjunctive' => null, ]; /** @@ -79,7 +80,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'facet' => 'facet', 'score' => 'score', - 'disjunctive' => 'disjunctive' + 'disjunctive' => 'disjunctive', ]; /** @@ -90,7 +91,7 @@ public static function openAPIFormats() protected static $setters = [ 'facet' => 'setFacet', 'score' => 'setScore', - 'disjunctive' => 'setDisjunctive' + 'disjunctive' => 'setDisjunctive', ]; /** @@ -101,7 +102,7 @@ public static function openAPIFormats() protected static $getters = [ 'facet' => 'getFacet', 'score' => 'getScore', - 'disjunctive' => 'getDisjunctive' + 'disjunctive' => 'getDisjunctive', ]; /** @@ -145,7 +146,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -178,6 +178,7 @@ public function listInvalidProperties() if ($this->container['facet'] === null) { $invalidProperties[] = "'facet' can't be null"; } + return $invalidProperties; } @@ -192,7 +193,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets facet * @@ -254,7 +254,7 @@ public function getDisjunctive() /** * Sets disjunctive * - * @param bool|null $disjunctive Whether the filter is disjunctive (true) or conjunctive (false). + * @param bool|null $disjunctive whether the filter is disjunctive (true) or conjunctive (false) * * @return self */ @@ -267,9 +267,9 @@ public function setDisjunctive($disjunctive) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -279,7 +279,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -308,7 +308,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -319,14 +319,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -353,4 +354,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/BaseBrowseResponse.php b/clients/algoliasearch-client-php/lib/Model/BaseBrowseResponse.php index fead53a789..39283cf771 100644 --- a/clients/algoliasearch-client-php/lib/Model/BaseBrowseResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/BaseBrowseResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * BaseBrowseResponse Class Doc Comment @@ -31,7 +31,7 @@ class BaseBrowseResponse implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'cursor' => 'string' + 'cursor' => 'string', ]; /** @@ -42,7 +42,7 @@ class BaseBrowseResponse implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'cursor' => null + 'cursor' => null, ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'cursor' => 'cursor' + 'cursor' => 'cursor', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'cursor' => 'setCursor' + 'cursor' => 'setCursor', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'cursor' => 'getCursor' + 'cursor' => 'getCursor', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -165,6 +164,7 @@ public function listInvalidProperties() if ($this->container['cursor'] === null) { $invalidProperties[] = "'cursor' can't be null"; } + return $invalidProperties; } @@ -179,7 +179,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets cursor * @@ -206,9 +205,9 @@ public function setCursor($cursor) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -218,7 +217,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -247,7 +246,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -258,14 +257,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -292,4 +292,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/BaseIndexSettings.php b/clients/algoliasearch-client-php/lib/Model/BaseIndexSettings.php index 80195a5625..4d67edd158 100644 --- a/clients/algoliasearch-client-php/lib/Model/BaseIndexSettings.php +++ b/clients/algoliasearch-client-php/lib/Model/BaseIndexSettings.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * BaseIndexSettings Class Doc Comment @@ -42,7 +42,7 @@ class BaseIndexSettings implements ModelInterface, ArrayAccess, \JsonSerializabl 'disablePrefixOnAttributes' => 'string[]', 'allowCompressionOfIntegerArray' => 'bool', 'numericAttributesForFiltering' => 'string[]', - 'userData' => 'object' + 'userData' => 'object', ]; /** @@ -64,7 +64,7 @@ class BaseIndexSettings implements ModelInterface, ArrayAccess, \JsonSerializabl 'disablePrefixOnAttributes' => null, 'allowCompressionOfIntegerArray' => null, 'numericAttributesForFiltering' => null, - 'userData' => null + 'userData' => null, ]; /** @@ -105,7 +105,7 @@ public static function openAPIFormats() 'disablePrefixOnAttributes' => 'disablePrefixOnAttributes', 'allowCompressionOfIntegerArray' => 'allowCompressionOfIntegerArray', 'numericAttributesForFiltering' => 'numericAttributesForFiltering', - 'userData' => 'userData' + 'userData' => 'userData', ]; /** @@ -125,7 +125,7 @@ public static function openAPIFormats() 'disablePrefixOnAttributes' => 'setDisablePrefixOnAttributes', 'allowCompressionOfIntegerArray' => 'setAllowCompressionOfIntegerArray', 'numericAttributesForFiltering' => 'setNumericAttributesForFiltering', - 'userData' => 'setUserData' + 'userData' => 'setUserData', ]; /** @@ -145,7 +145,7 @@ public static function openAPIFormats() 'disablePrefixOnAttributes' => 'getDisablePrefixOnAttributes', 'allowCompressionOfIntegerArray' => 'getAllowCompressionOfIntegerArray', 'numericAttributesForFiltering' => 'getNumericAttributesForFiltering', - 'userData' => 'getUserData' + 'userData' => 'getUserData', ]; /** @@ -189,7 +189,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -242,7 +241,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets replicas * @@ -256,7 +254,7 @@ public function getReplicas() /** * Sets replicas * - * @param string[]|null $replicas Creates replicas, exact copies of an index. + * @param string[]|null $replicas creates replicas, exact copies of an index * * @return self */ @@ -280,7 +278,7 @@ public function getPaginationLimitedTo() /** * Sets paginationLimitedTo * - * @param int|null $paginationLimitedTo Set the maximum number of hits accessible via pagination. + * @param int|null $paginationLimitedTo set the maximum number of hits accessible via pagination * * @return self */ @@ -304,7 +302,7 @@ public function getDisableTypoToleranceOnWords() /** * Sets disableTypoToleranceOnWords * - * @param string[]|null $disableTypoToleranceOnWords A list of words for which you want to turn off typo tolerance. + * @param string[]|null $disableTypoToleranceOnWords a list of words for which you want to turn off typo tolerance * * @return self */ @@ -328,7 +326,7 @@ public function getAttributesToTransliterate() /** * Sets attributesToTransliterate * - * @param string[]|null $attributesToTransliterate Specify on which attributes to apply transliteration. + * @param string[]|null $attributesToTransliterate specify on which attributes to apply transliteration * * @return self */ @@ -352,7 +350,7 @@ public function getCamelCaseAttributes() /** * Sets camelCaseAttributes * - * @param string[]|null $camelCaseAttributes List of attributes on which to do a decomposition of camel case words. + * @param string[]|null $camelCaseAttributes list of attributes on which to do a decomposition of camel case words * * @return self */ @@ -376,7 +374,7 @@ public function getDecompoundedAttributes() /** * Sets decompoundedAttributes * - * @param object|null $decompoundedAttributes Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding. + * @param object|null $decompoundedAttributes specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding * * @return self */ @@ -400,7 +398,7 @@ public function getIndexLanguages() /** * Sets indexLanguages * - * @param string[]|null $indexLanguages Sets the languages at the index level for language-specific processing such as tokenization and normalization. + * @param string[]|null $indexLanguages sets the languages at the index level for language-specific processing such as tokenization and normalization * * @return self */ @@ -424,7 +422,7 @@ public function getFilterPromotes() /** * Sets filterPromotes * - * @param bool|null $filterPromotes Whether promoted results should match the filters of the current search, except for geographic filters. + * @param bool|null $filterPromotes whether promoted results should match the filters of the current search, except for geographic filters * * @return self */ @@ -448,7 +446,7 @@ public function getDisablePrefixOnAttributes() /** * Sets disablePrefixOnAttributes * - * @param string[]|null $disablePrefixOnAttributes List of attributes on which you want to disable prefix matching. + * @param string[]|null $disablePrefixOnAttributes list of attributes on which you want to disable prefix matching * * @return self */ @@ -472,7 +470,7 @@ public function getAllowCompressionOfIntegerArray() /** * Sets allowCompressionOfIntegerArray * - * @param bool|null $allowCompressionOfIntegerArray Enables compression of large integer arrays. + * @param bool|null $allowCompressionOfIntegerArray enables compression of large integer arrays * * @return self */ @@ -496,7 +494,7 @@ public function getNumericAttributesForFiltering() /** * Sets numericAttributesForFiltering * - * @param string[]|null $numericAttributesForFiltering List of numeric attributes that can be used as numerical filters. + * @param string[]|null $numericAttributesForFiltering list of numeric attributes that can be used as numerical filters * * @return self */ @@ -520,7 +518,7 @@ public function getUserData() /** * Sets userData * - * @param object|null $userData Lets you store custom data in your indices. + * @param object|null $userData lets you store custom data in your indices * * @return self */ @@ -533,9 +531,9 @@ public function setUserData($userData) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -545,7 +543,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -574,7 +572,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -585,14 +583,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -619,4 +618,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/BaseSearchParams.php b/clients/algoliasearch-client-php/lib/Model/BaseSearchParams.php index bf573dc75a..93b1dd7be6 100644 --- a/clients/algoliasearch-client-php/lib/Model/BaseSearchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/BaseSearchParams.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * BaseSearchParams Class Doc Comment @@ -62,7 +62,7 @@ class BaseSearchParams implements ModelInterface, ArrayAccess, \JsonSerializable 'analyticsTags' => 'string[]', 'percentileComputation' => 'bool', 'enableABTest' => 'bool', - 'enableReRanking' => 'bool' + 'enableReRanking' => 'bool', ]; /** @@ -104,7 +104,7 @@ class BaseSearchParams implements ModelInterface, ArrayAccess, \JsonSerializable 'analyticsTags' => null, 'percentileComputation' => null, 'enableABTest' => null, - 'enableReRanking' => null + 'enableReRanking' => null, ]; /** @@ -165,7 +165,7 @@ public static function openAPIFormats() 'analyticsTags' => 'analyticsTags', 'percentileComputation' => 'percentileComputation', 'enableABTest' => 'enableABTest', - 'enableReRanking' => 'enableReRanking' + 'enableReRanking' => 'enableReRanking', ]; /** @@ -205,7 +205,7 @@ public static function openAPIFormats() 'analyticsTags' => 'setAnalyticsTags', 'percentileComputation' => 'setPercentileComputation', 'enableABTest' => 'setEnableABTest', - 'enableReRanking' => 'setEnableReRanking' + 'enableReRanking' => 'setEnableReRanking', ]; /** @@ -245,7 +245,7 @@ public static function openAPIFormats() 'analyticsTags' => 'getAnalyticsTags', 'percentileComputation' => 'getPercentileComputation', 'enableABTest' => 'getEnableABTest', - 'enableReRanking' => 'getEnableReRanking' + 'enableReRanking' => 'getEnableReRanking', ]; /** @@ -289,7 +289,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -374,7 +373,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets similarQuery * @@ -388,7 +386,7 @@ public function getSimilarQuery() /** * Sets similarQuery * - * @param string|null $similarQuery Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. + * @param string|null $similarQuery overrides the query parameter and performs a more generic search that can be used to find \"similar\" results * * @return self */ @@ -412,7 +410,7 @@ public function getFilters() /** * Sets filters * - * @param string|null $filters Filter the query with numeric, facet and/or tag filters. + * @param string|null $filters filter the query with numeric, facet and/or tag filters * * @return self */ @@ -436,7 +434,7 @@ public function getFacetFilters() /** * Sets facetFilters * - * @param string[]|null $facetFilters Filter hits by facet value. + * @param string[]|null $facetFilters filter hits by facet value * * @return self */ @@ -460,7 +458,7 @@ public function getOptionalFilters() /** * Sets optionalFilters * - * @param string[]|null $optionalFilters Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. + * @param string[]|null $optionalFilters create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter * * @return self */ @@ -484,7 +482,7 @@ public function getNumericFilters() /** * Sets numericFilters * - * @param string[]|null $numericFilters Filter on numeric attributes. + * @param string[]|null $numericFilters filter on numeric attributes * * @return self */ @@ -508,7 +506,7 @@ public function getTagFilters() /** * Sets tagFilters * - * @param string[]|null $tagFilters Filter hits by tags. + * @param string[]|null $tagFilters filter hits by tags * * @return self */ @@ -532,7 +530,7 @@ public function getSumOrFiltersScores() /** * Sets sumOrFiltersScores * - * @param bool|null $sumOrFiltersScores Determines how to calculate the total score for filtering. + * @param bool|null $sumOrFiltersScores determines how to calculate the total score for filtering * * @return self */ @@ -556,7 +554,7 @@ public function getFacets() /** * Sets facets * - * @param string[]|null $facets Retrieve facets and their facet values. + * @param string[]|null $facets retrieve facets and their facet values * * @return self */ @@ -580,7 +578,7 @@ public function getMaxValuesPerFacet() /** * Sets maxValuesPerFacet * - * @param int|null $maxValuesPerFacet Maximum number of facet values to return for each facet during a regular search. + * @param int|null $maxValuesPerFacet maximum number of facet values to return for each facet during a regular search * * @return self */ @@ -604,7 +602,7 @@ public function getFacetingAfterDistinct() /** * Sets facetingAfterDistinct * - * @param bool|null $facetingAfterDistinct Force faceting to be applied after de-duplication (via the Distinct setting). + * @param bool|null $facetingAfterDistinct force faceting to be applied after de-duplication (via the Distinct setting) * * @return self */ @@ -628,7 +626,7 @@ public function getSortFacetValuesBy() /** * Sets sortFacetValuesBy * - * @param string|null $sortFacetValuesBy Controls how facet values are fetched. + * @param string|null $sortFacetValuesBy controls how facet values are fetched * * @return self */ @@ -652,7 +650,7 @@ public function getPage() /** * Sets page * - * @param int|null $page Specify the page to retrieve. + * @param int|null $page specify the page to retrieve * * @return self */ @@ -676,7 +674,7 @@ public function getOffset() /** * Sets offset * - * @param int|null $offset Specify the offset of the first hit to return. + * @param int|null $offset specify the offset of the first hit to return * * @return self */ @@ -700,13 +698,12 @@ public function getLength() /** * Sets length * - * @param int|null $length Set the number of hits to retrieve (used only with offset). + * @param int|null $length set the number of hits to retrieve (used only with offset) * * @return self */ public function setLength($length) { - if (!is_null($length) && ($length > 1000)) { throw new \InvalidArgumentException('invalid value for $length when calling BaseSearchParams., must be smaller than or equal to 1000.'); } @@ -732,7 +729,7 @@ public function getAroundLatLng() /** * Sets aroundLatLng * - * @param string|null $aroundLatLng Search for entries around a central geolocation, enabling a geo search within a circular area. + * @param string|null $aroundLatLng search for entries around a central geolocation, enabling a geo search within a circular area * * @return self */ @@ -756,7 +753,7 @@ public function getAroundLatLngViaIP() /** * Sets aroundLatLngViaIP * - * @param bool|null $aroundLatLngViaIP Search for entries around a given location automatically computed from the requester's IP address. + * @param bool|null $aroundLatLngViaIP search for entries around a given location automatically computed from the requester's IP address * * @return self */ @@ -780,7 +777,7 @@ public function getAroundRadius() /** * Sets aroundRadius * - * @param OneOfIntegerString|null $aroundRadius Define the maximum radius for a geo search (in meters). + * @param OneOfIntegerString|null $aroundRadius define the maximum radius for a geo search (in meters) * * @return self */ @@ -804,7 +801,7 @@ public function getAroundPrecision() /** * Sets aroundPrecision * - * @param int|null $aroundPrecision Precision of geo search (in meters), to add grouping by geo location to the ranking formula. + * @param int|null $aroundPrecision precision of geo search (in meters), to add grouping by geo location to the ranking formula * * @return self */ @@ -828,13 +825,12 @@ public function getMinimumAroundRadius() /** * Sets minimumAroundRadius * - * @param int|null $minimumAroundRadius Minimum radius (in meters) used for a geo search when aroundRadius is not set. + * @param int|null $minimumAroundRadius minimum radius (in meters) used for a geo search when aroundRadius is not set * * @return self */ public function setMinimumAroundRadius($minimumAroundRadius) { - if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling BaseSearchParams., must be bigger than or equal to 1.'); } @@ -857,7 +853,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox * - * @param float[]|null $insideBoundingBox Search inside a rectangular area (in geo coordinates). + * @param float[]|null $insideBoundingBox search inside a rectangular area (in geo coordinates) * * @return self */ @@ -881,7 +877,7 @@ public function getInsidePolygon() /** * Sets insidePolygon * - * @param float[]|null $insidePolygon Search inside a polygon (in geo coordinates). + * @param float[]|null $insidePolygon search inside a polygon (in geo coordinates) * * @return self */ @@ -929,7 +925,7 @@ public function getRuleContexts() /** * Sets ruleContexts * - * @param string[]|null $ruleContexts Enables contextual rules. + * @param string[]|null $ruleContexts enables contextual rules * * @return self */ @@ -953,7 +949,7 @@ public function getPersonalizationImpact() /** * Sets personalizationImpact * - * @param int|null $personalizationImpact Define the impact of the Personalization feature. + * @param int|null $personalizationImpact define the impact of the Personalization feature * * @return self */ @@ -977,7 +973,7 @@ public function getUserToken() /** * Sets userToken * - * @param string|null $userToken Associates a certain user token with the current search. + * @param string|null $userToken associates a certain user token with the current search * * @return self */ @@ -1001,7 +997,7 @@ public function getGetRankingInfo() /** * Sets getRankingInfo * - * @param bool|null $getRankingInfo Retrieve detailed ranking information. + * @param bool|null $getRankingInfo retrieve detailed ranking information * * @return self */ @@ -1025,7 +1021,7 @@ public function getClickAnalytics() /** * Sets clickAnalytics * - * @param bool|null $clickAnalytics Enable the Click Analytics feature. + * @param bool|null $clickAnalytics enable the Click Analytics feature * * @return self */ @@ -1049,7 +1045,7 @@ public function getAnalytics() /** * Sets analytics * - * @param bool|null $analytics Whether the current query will be taken into account in the Analytics. + * @param bool|null $analytics whether the current query will be taken into account in the Analytics * * @return self */ @@ -1073,7 +1069,7 @@ public function getAnalyticsTags() /** * Sets analyticsTags * - * @param string[]|null $analyticsTags List of tags to apply to the query for analytics purposes. + * @param string[]|null $analyticsTags list of tags to apply to the query for analytics purposes * * @return self */ @@ -1097,7 +1093,7 @@ public function getPercentileComputation() /** * Sets percentileComputation * - * @param bool|null $percentileComputation Whether to include or exclude a query from the processing-time percentile computation. + * @param bool|null $percentileComputation whether to include or exclude a query from the processing-time percentile computation * * @return self */ @@ -1121,7 +1117,7 @@ public function getEnableABTest() /** * Sets enableABTest * - * @param bool|null $enableABTest Whether this search should participate in running AB tests. + * @param bool|null $enableABTest whether this search should participate in running AB tests * * @return self */ @@ -1145,7 +1141,7 @@ public function getEnableReRanking() /** * Sets enableReRanking * - * @param bool|null $enableReRanking Whether this search should use AI Re-Ranking. + * @param bool|null $enableReRanking whether this search should use AI Re-Ranking * * @return self */ @@ -1158,9 +1154,9 @@ public function setEnableReRanking($enableReRanking) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -1170,7 +1166,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -1199,7 +1195,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -1210,14 +1206,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -1244,4 +1241,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/BaseSearchResponse.php b/clients/algoliasearch-client-php/lib/Model/BaseSearchResponse.php index 37b4705831..9c0e3eb811 100644 --- a/clients/algoliasearch-client-php/lib/Model/BaseSearchResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/BaseSearchResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * BaseSearchResponse Class Doc Comment @@ -54,7 +54,7 @@ class BaseSearchResponse implements ModelInterface, ArrayAccess, \JsonSerializab 'query' => 'string', 'queryAfterRemoval' => 'string', 'serverUsed' => 'string', - 'userData' => 'object' + 'userData' => 'object', ]; /** @@ -88,7 +88,7 @@ class BaseSearchResponse implements ModelInterface, ArrayAccess, \JsonSerializab 'query' => null, 'queryAfterRemoval' => null, 'serverUsed' => null, - 'userData' => null + 'userData' => null, ]; /** @@ -141,7 +141,7 @@ public static function openAPIFormats() 'query' => 'query', 'queryAfterRemoval' => 'queryAfterRemoval', 'serverUsed' => 'serverUsed', - 'userData' => 'userData' + 'userData' => 'userData', ]; /** @@ -173,7 +173,7 @@ public static function openAPIFormats() 'query' => 'setQuery', 'queryAfterRemoval' => 'setQueryAfterRemoval', 'serverUsed' => 'setServerUsed', - 'userData' => 'setUserData' + 'userData' => 'setUserData', ]; /** @@ -205,7 +205,7 @@ public static function openAPIFormats() 'query' => 'getQuery', 'queryAfterRemoval' => 'getQueryAfterRemoval', 'serverUsed' => 'getServerUsed', - 'userData' => 'getUserData' + 'userData' => 'getUserData', ]; /** @@ -249,7 +249,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -300,7 +299,7 @@ public function listInvalidProperties() { $invalidProperties = []; - if (!is_null($this->container['aroundLatLng']) && !preg_match("/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/", $this->container['aroundLatLng'])) { + if (!is_null($this->container['aroundLatLng']) && !preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $this->container['aroundLatLng'])) { $invalidProperties[] = "invalid value for 'aroundLatLng', must be conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."; } @@ -331,6 +330,7 @@ public function listInvalidProperties() if ($this->container['query'] === null) { $invalidProperties[] = "'query' can't be null"; } + return $invalidProperties; } @@ -345,7 +345,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets abTestID * @@ -359,7 +358,7 @@ public function getAbTestID() /** * Sets abTestID * - * @param int|null $abTestID If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID. + * @param int|null $abTestID if a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID * * @return self */ @@ -383,7 +382,7 @@ public function getAbTestVariantID() /** * Sets abTestVariantID * - * @param int|null $abTestVariantID If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used. + * @param int|null $abTestVariantID if a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used * * @return self */ @@ -407,14 +406,13 @@ public function getAroundLatLng() /** * Sets aroundLatLng * - * @param string|null $aroundLatLng The computed geo location. + * @param string|null $aroundLatLng the computed geo location * * @return self */ public function setAroundLatLng($aroundLatLng) { - - if (!is_null($aroundLatLng) && (!preg_match("/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/", $aroundLatLng))) { + if (!is_null($aroundLatLng) && (!preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $aroundLatLng))) { throw new \InvalidArgumentException("invalid value for $aroundLatLng when calling BaseSearchResponse., must conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."); } @@ -460,7 +458,7 @@ public function getExhaustiveFacetsCount() /** * Sets exhaustiveFacetsCount * - * @param bool|null $exhaustiveFacetsCount Whether the facet count is exhaustive or approximate. + * @param bool|null $exhaustiveFacetsCount whether the facet count is exhaustive or approximate * * @return self */ @@ -532,7 +530,7 @@ public function getFacets() /** * Sets facets * - * @param array>|null $facets A mapping of each facet name to the corresponding facet counts. + * @param array>|null $facets a mapping of each facet name to the corresponding facet counts * * @return self */ @@ -556,7 +554,7 @@ public function getFacetsStats() /** * Sets facetsStats * - * @param array|null $facetsStats Statistics for numerical facets. + * @param array|null $facetsStats statistics for numerical facets * * @return self */ @@ -580,7 +578,7 @@ public function getHitsPerPage() /** * Sets hitsPerPage * - * @param int $hitsPerPage Set the number of hits per page. + * @param int $hitsPerPage set the number of hits per page * * @return self */ @@ -604,7 +602,7 @@ public function getIndex() /** * Sets index * - * @param string|null $index Index name used for the query. + * @param string|null $index index name used for the query * * @return self */ @@ -652,7 +650,7 @@ public function getMessage() /** * Sets message * - * @param string|null $message Used to return warnings about the query. + * @param string|null $message used to return warnings about the query * * @return self */ @@ -676,7 +674,7 @@ public function getNbHits() /** * Sets nbHits * - * @param int $nbHits Number of hits that the search query matched. + * @param int $nbHits number of hits that the search query matched * * @return self */ @@ -748,7 +746,7 @@ public function getPage() /** * Sets page * - * @param int $page Specify the page to retrieve. + * @param int $page specify the page to retrieve * * @return self */ @@ -772,7 +770,7 @@ public function getParams() /** * Sets params * - * @param string $params A url-encoded string of all search parameters. + * @param string $params a url-encoded string of all search parameters * * @return self */ @@ -796,7 +794,7 @@ public function getParsedQuery() /** * Sets parsedQuery * - * @param string|null $parsedQuery The query string that will be searched, after normalization. + * @param string|null $parsedQuery the query string that will be searched, after normalization * * @return self */ @@ -820,7 +818,7 @@ public function getProcessingTimeMS() /** * Sets processingTimeMS * - * @param int $processingTimeMS Time the server took to process the request, in milliseconds. + * @param int $processingTimeMS time the server took to process the request, in milliseconds * * @return self */ @@ -844,7 +842,7 @@ public function getQuery() /** * Sets query * - * @param string $query The text to search in the index. + * @param string $query the text to search in the index * * @return self */ @@ -868,7 +866,7 @@ public function getQueryAfterRemoval() /** * Sets queryAfterRemoval * - * @param string|null $queryAfterRemoval A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. + * @param string|null $queryAfterRemoval a markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set * * @return self */ @@ -892,7 +890,7 @@ public function getServerUsed() /** * Sets serverUsed * - * @param string|null $serverUsed Actual host name of the server that processed the request. + * @param string|null $serverUsed actual host name of the server that processed the request * * @return self */ @@ -916,7 +914,7 @@ public function getUserData() /** * Sets userData * - * @param object|null $userData Lets you store custom data in your indices. + * @param object|null $userData lets you store custom data in your indices * * @return self */ @@ -929,9 +927,9 @@ public function setUserData($userData) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -941,7 +939,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -970,7 +968,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -981,14 +979,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -1015,4 +1014,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php b/clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php index 2d97e8e94b..5af39f3245 100644 --- a/clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php +++ b/clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * BaseSearchResponseFacetsStats Class Doc Comment @@ -34,7 +34,7 @@ class BaseSearchResponseFacetsStats implements ModelInterface, ArrayAccess, \Jso 'min' => 'int', 'max' => 'int', 'avg' => 'int', - 'sum' => 'int' + 'sum' => 'int', ]; /** @@ -48,7 +48,7 @@ class BaseSearchResponseFacetsStats implements ModelInterface, ArrayAccess, \Jso 'min' => null, 'max' => null, 'avg' => null, - 'sum' => null + 'sum' => null, ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() 'min' => 'min', 'max' => 'max', 'avg' => 'avg', - 'sum' => 'sum' + 'sum' => 'sum', ]; /** @@ -93,7 +93,7 @@ public static function openAPIFormats() 'min' => 'setMin', 'max' => 'setMax', 'avg' => 'setAvg', - 'sum' => 'setSum' + 'sum' => 'setSum', ]; /** @@ -105,7 +105,7 @@ public static function openAPIFormats() 'min' => 'getMin', 'max' => 'getMax', 'avg' => 'getAvg', - 'sum' => 'getSum' + 'sum' => 'getSum', ]; /** @@ -149,7 +149,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -194,7 +193,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets min * @@ -208,7 +206,7 @@ public function getMin() /** * Sets min * - * @param int|null $min The minimum value in the result set. + * @param int|null $min the minimum value in the result set * * @return self */ @@ -232,7 +230,7 @@ public function getMax() /** * Sets max * - * @param int|null $max The maximum value in the result set. + * @param int|null $max the maximum value in the result set * * @return self */ @@ -256,7 +254,7 @@ public function getAvg() /** * Sets avg * - * @param int|null $avg The average facet value in the result set. + * @param int|null $avg the average facet value in the result set * * @return self */ @@ -280,7 +278,7 @@ public function getSum() /** * Sets sum * - * @param int|null $sum The sum of all values in the result set. + * @param int|null $sum the sum of all values in the result set * * @return self */ @@ -293,9 +291,9 @@ public function setSum($sum) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -305,7 +303,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -334,7 +332,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -345,14 +343,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -379,4 +378,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php b/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php index 43c76dd3dd..d556abcaf8 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php +++ b/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * BatchAssignUserIdsObject Class Doc Comment * * @category Class * @description Assign userID object. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -33,7 +34,7 @@ class BatchAssignUserIdsObject implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPITypes = [ 'cluster' => 'string', - 'users' => 'string[]' + 'users' => 'string[]', ]; /** @@ -45,7 +46,7 @@ class BatchAssignUserIdsObject implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPIFormats = [ 'cluster' => null, - 'users' => null + 'users' => null, ]; /** @@ -76,7 +77,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'cluster' => 'cluster', - 'users' => 'users' + 'users' => 'users', ]; /** @@ -86,7 +87,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'cluster' => 'setCluster', - 'users' => 'setUsers' + 'users' => 'setUsers', ]; /** @@ -96,7 +97,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'cluster' => 'getCluster', - 'users' => 'getUsers' + 'users' => 'getUsers', ]; /** @@ -140,7 +141,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -175,6 +175,7 @@ public function listInvalidProperties() if ($this->container['users'] === null) { $invalidProperties[] = "'users' can't be null"; } + return $invalidProperties; } @@ -189,7 +190,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets cluster * @@ -203,7 +203,7 @@ public function getCluster() /** * Sets cluster * - * @param string $cluster Name of the cluster. + * @param string $cluster name of the cluster * * @return self */ @@ -240,9 +240,9 @@ public function setUsers($users) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -252,7 +252,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -281,7 +281,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -292,14 +292,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -326,4 +327,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntries.php b/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntries.php index 8c5a853c0e..809dabd239 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntries.php +++ b/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntries.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * BatchDictionaryEntries Class Doc Comment * * @category Class * @description The `batchDictionaryEntries` requests. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -33,7 +34,7 @@ class BatchDictionaryEntries implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPITypes = [ 'clearExistingDictionaryEntries' => 'bool', - 'requests' => '\Algolia\AlgoliaSearch\Model\BatchDictionaryEntriesRequest[]' + 'requests' => '\Algolia\AlgoliaSearch\Model\BatchDictionaryEntriesRequest[]', ]; /** @@ -45,7 +46,7 @@ class BatchDictionaryEntries implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPIFormats = [ 'clearExistingDictionaryEntries' => null, - 'requests' => null + 'requests' => null, ]; /** @@ -76,7 +77,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'clearExistingDictionaryEntries' => 'clearExistingDictionaryEntries', - 'requests' => 'requests' + 'requests' => 'requests', ]; /** @@ -86,7 +87,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'clearExistingDictionaryEntries' => 'setClearExistingDictionaryEntries', - 'requests' => 'setRequests' + 'requests' => 'setRequests', ]; /** @@ -96,7 +97,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'clearExistingDictionaryEntries' => 'getClearExistingDictionaryEntries', - 'requests' => 'getRequests' + 'requests' => 'getRequests', ]; /** @@ -140,7 +141,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -172,6 +172,7 @@ public function listInvalidProperties() if ($this->container['requests'] === null) { $invalidProperties[] = "'requests' can't be null"; } + return $invalidProperties; } @@ -186,7 +187,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets clearExistingDictionaryEntries * @@ -200,7 +200,7 @@ public function getClearExistingDictionaryEntries() /** * Sets clearExistingDictionaryEntries * - * @param bool|null $clearExistingDictionaryEntries When `true`, start the batch by removing all the custom entries from the dictionary. + * @param bool|null $clearExistingDictionaryEntries when `true`, start the batch by removing all the custom entries from the dictionary * * @return self */ @@ -237,9 +237,9 @@ public function setRequests($requests) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -249,7 +249,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -278,7 +278,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -289,14 +289,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -323,4 +324,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php b/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php index 073e38595f..945c27dea7 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php +++ b/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * BatchDictionaryEntriesRequest Class Doc Comment @@ -32,7 +32,7 @@ class BatchDictionaryEntriesRequest implements ModelInterface, ArrayAccess, \Jso */ protected static $openAPITypes = [ 'action' => 'string', - 'body' => '\Algolia\AlgoliaSearch\Model\DictionaryEntry' + 'body' => '\Algolia\AlgoliaSearch\Model\DictionaryEntry', ]; /** @@ -44,7 +44,7 @@ class BatchDictionaryEntriesRequest implements ModelInterface, ArrayAccess, \Jso */ protected static $openAPIFormats = [ 'action' => null, - 'body' => null + 'body' => null, ]; /** @@ -75,7 +75,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'action' => 'action', - 'body' => 'body' + 'body' => 'body', ]; /** @@ -85,7 +85,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'action' => 'setAction', - 'body' => 'setBody' + 'body' => 'setBody', ]; /** @@ -95,7 +95,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'action' => 'getAction', - 'body' => 'getBody' + 'body' => 'getBody', ]; /** @@ -198,6 +198,7 @@ public function listInvalidProperties() if ($this->container['body'] === null) { $invalidProperties[] = "'body' can't be null"; } + return $invalidProperties; } @@ -212,7 +213,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets action * @@ -226,7 +226,7 @@ public function getAction() /** * Sets action * - * @param string $action Actions to perform. + * @param string $action actions to perform * * @return self */ @@ -273,9 +273,9 @@ public function setBody($body) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -285,7 +285,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -314,7 +314,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -325,14 +325,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -359,4 +360,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/BatchObject.php b/clients/algoliasearch-client-php/lib/Model/BatchObject.php index 815e85b5cb..69068c27fe 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchObject.php +++ b/clients/algoliasearch-client-php/lib/Model/BatchObject.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * BatchObject Class Doc Comment * * @category Class * @description The `batch` requests. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -32,7 +33,7 @@ class BatchObject implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'requests' => '\Algolia\AlgoliaSearch\Model\Operation[]' + 'requests' => '\Algolia\AlgoliaSearch\Model\Operation[]', ]; /** @@ -43,7 +44,7 @@ class BatchObject implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'requests' => null + 'requests' => null, ]; /** @@ -73,7 +74,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'requests' => 'requests' + 'requests' => 'requests', ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'requests' => 'setRequests' + 'requests' => 'setRequests', ]; /** @@ -91,7 +92,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'requests' => 'getRequests' + 'requests' => 'getRequests', ]; /** @@ -135,7 +136,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -177,7 +177,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets requests * @@ -204,9 +203,9 @@ public function setRequests($requests) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -216,7 +215,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -245,7 +244,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -256,14 +255,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -290,4 +290,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/BatchResponse.php b/clients/algoliasearch-client-php/lib/Model/BatchResponse.php index ad20982c93..13b488d920 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/BatchResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * BatchResponse Class Doc Comment @@ -32,7 +32,7 @@ class BatchResponse implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'taskID' => 'int', - 'objectIDs' => 'string[]' + 'objectIDs' => 'string[]', ]; /** @@ -44,7 +44,7 @@ class BatchResponse implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'taskID' => null, - 'objectIDs' => null + 'objectIDs' => null, ]; /** @@ -75,7 +75,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'taskID' => 'taskID', - 'objectIDs' => 'objectIDs' + 'objectIDs' => 'objectIDs', ]; /** @@ -85,7 +85,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'taskID' => 'setTaskID', - 'objectIDs' => 'setObjectIDs' + 'objectIDs' => 'setObjectIDs', ]; /** @@ -95,7 +95,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'taskID' => 'getTaskID', - 'objectIDs' => 'getObjectIDs' + 'objectIDs' => 'getObjectIDs', ]; /** @@ -139,7 +139,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -182,7 +181,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets taskID * @@ -196,7 +194,7 @@ public function getTaskID() /** * Sets taskID * - * @param int|null $taskID taskID of the indexing task to wait for. + * @param int|null $taskID taskID of the indexing task to wait for * * @return self */ @@ -220,7 +218,7 @@ public function getObjectIDs() /** * Sets objectIDs * - * @param string[]|null $objectIDs List of objectID. + * @param string[]|null $objectIDs list of objectID * * @return self */ @@ -233,9 +231,9 @@ public function setObjectIDs($objectIDs) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -245,7 +243,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -274,7 +272,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -285,14 +283,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -319,4 +318,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php b/clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php index 896d0c3b8f..a0cbdc98fd 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php +++ b/clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * BatchWriteObject Class Doc Comment * * @category Class * @description The `batch` requests. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -32,7 +33,7 @@ class BatchWriteObject implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'requests' => '\Algolia\AlgoliaSearch\Model\Operation[]' + 'requests' => '\Algolia\AlgoliaSearch\Model\Operation[]', ]; /** @@ -43,7 +44,7 @@ class BatchWriteObject implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'requests' => null + 'requests' => null, ]; /** @@ -73,7 +74,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'requests' => 'requests' + 'requests' => 'requests', ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'requests' => 'setRequests' + 'requests' => 'setRequests', ]; /** @@ -91,7 +92,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'requests' => 'getRequests' + 'requests' => 'getRequests', ]; /** @@ -135,7 +136,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -177,7 +177,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets requests * @@ -204,9 +203,9 @@ public function setRequests($requests) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -216,7 +215,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -245,7 +244,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -256,14 +255,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -290,4 +290,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/BrowseRequest.php b/clients/algoliasearch-client-php/lib/Model/BrowseRequest.php index 8c2728944a..5c53d672b9 100644 --- a/clients/algoliasearch-client-php/lib/Model/BrowseRequest.php +++ b/clients/algoliasearch-client-php/lib/Model/BrowseRequest.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * BrowseRequest Class Doc Comment @@ -32,7 +32,7 @@ class BrowseRequest implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'params' => 'string', - 'cursor' => 'string' + 'cursor' => 'string', ]; /** @@ -44,7 +44,7 @@ class BrowseRequest implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'params' => null, - 'cursor' => null + 'cursor' => null, ]; /** @@ -75,7 +75,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'params' => 'params', - 'cursor' => 'cursor' + 'cursor' => 'cursor', ]; /** @@ -85,7 +85,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'params' => 'setParams', - 'cursor' => 'setCursor' + 'cursor' => 'setCursor', ]; /** @@ -95,7 +95,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'params' => 'getParams', - 'cursor' => 'getCursor' + 'cursor' => 'getCursor', ]; /** @@ -139,7 +139,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -182,7 +181,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets params * @@ -196,7 +194,7 @@ public function getParams() /** * Sets params * - * @param string|null $params Search parameters as URL-encoded query string. + * @param string|null $params search parameters as URL-encoded query string * * @return self */ @@ -233,9 +231,9 @@ public function setCursor($cursor) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -245,7 +243,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -274,7 +272,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -285,14 +283,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -319,4 +318,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php b/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php index 389fa30b65..fd2be587ff 100644 --- a/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * BrowseResponse Class Doc Comment @@ -56,7 +56,7 @@ class BrowseResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'serverUsed' => 'string', 'userData' => 'object', 'hits' => '\Algolia\AlgoliaSearch\Model\Record[]', - 'cursor' => 'string' + 'cursor' => 'string', ]; /** @@ -92,7 +92,7 @@ class BrowseResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'serverUsed' => null, 'userData' => null, 'hits' => null, - 'cursor' => null + 'cursor' => null, ]; /** @@ -147,7 +147,7 @@ public static function openAPIFormats() 'serverUsed' => 'serverUsed', 'userData' => 'userData', 'hits' => 'hits', - 'cursor' => 'cursor' + 'cursor' => 'cursor', ]; /** @@ -181,7 +181,7 @@ public static function openAPIFormats() 'serverUsed' => 'setServerUsed', 'userData' => 'setUserData', 'hits' => 'setHits', - 'cursor' => 'setCursor' + 'cursor' => 'setCursor', ]; /** @@ -215,7 +215,7 @@ public static function openAPIFormats() 'serverUsed' => 'getServerUsed', 'userData' => 'getUserData', 'hits' => 'getHits', - 'cursor' => 'getCursor' + 'cursor' => 'getCursor', ]; /** @@ -259,7 +259,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -312,7 +311,7 @@ public function listInvalidProperties() { $invalidProperties = []; - if (!is_null($this->container['aroundLatLng']) && !preg_match("/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/", $this->container['aroundLatLng'])) { + if (!is_null($this->container['aroundLatLng']) && !preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $this->container['aroundLatLng'])) { $invalidProperties[] = "invalid value for 'aroundLatLng', must be conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."; } @@ -349,6 +348,7 @@ public function listInvalidProperties() if ($this->container['cursor'] === null) { $invalidProperties[] = "'cursor' can't be null"; } + return $invalidProperties; } @@ -363,7 +363,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets abTestID * @@ -377,7 +376,7 @@ public function getAbTestID() /** * Sets abTestID * - * @param int|null $abTestID If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID. + * @param int|null $abTestID if a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID * * @return self */ @@ -401,7 +400,7 @@ public function getAbTestVariantID() /** * Sets abTestVariantID * - * @param int|null $abTestVariantID If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used. + * @param int|null $abTestVariantID if a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used * * @return self */ @@ -425,14 +424,13 @@ public function getAroundLatLng() /** * Sets aroundLatLng * - * @param string|null $aroundLatLng The computed geo location. + * @param string|null $aroundLatLng the computed geo location * * @return self */ public function setAroundLatLng($aroundLatLng) { - - if (!is_null($aroundLatLng) && (!preg_match("/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/", $aroundLatLng))) { + if (!is_null($aroundLatLng) && (!preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $aroundLatLng))) { throw new \InvalidArgumentException("invalid value for $aroundLatLng when calling BrowseResponse., must conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."); } @@ -478,7 +476,7 @@ public function getExhaustiveFacetsCount() /** * Sets exhaustiveFacetsCount * - * @param bool|null $exhaustiveFacetsCount Whether the facet count is exhaustive or approximate. + * @param bool|null $exhaustiveFacetsCount whether the facet count is exhaustive or approximate * * @return self */ @@ -550,7 +548,7 @@ public function getFacets() /** * Sets facets * - * @param array>|null $facets A mapping of each facet name to the corresponding facet counts. + * @param array>|null $facets a mapping of each facet name to the corresponding facet counts * * @return self */ @@ -574,7 +572,7 @@ public function getFacetsStats() /** * Sets facetsStats * - * @param array|null $facetsStats Statistics for numerical facets. + * @param array|null $facetsStats statistics for numerical facets * * @return self */ @@ -598,7 +596,7 @@ public function getHitsPerPage() /** * Sets hitsPerPage * - * @param int $hitsPerPage Set the number of hits per page. + * @param int $hitsPerPage set the number of hits per page * * @return self */ @@ -622,7 +620,7 @@ public function getIndex() /** * Sets index * - * @param string|null $index Index name used for the query. + * @param string|null $index index name used for the query * * @return self */ @@ -670,7 +668,7 @@ public function getMessage() /** * Sets message * - * @param string|null $message Used to return warnings about the query. + * @param string|null $message used to return warnings about the query * * @return self */ @@ -694,7 +692,7 @@ public function getNbHits() /** * Sets nbHits * - * @param int $nbHits Number of hits that the search query matched. + * @param int $nbHits number of hits that the search query matched * * @return self */ @@ -766,7 +764,7 @@ public function getPage() /** * Sets page * - * @param int $page Specify the page to retrieve. + * @param int $page specify the page to retrieve * * @return self */ @@ -790,7 +788,7 @@ public function getParams() /** * Sets params * - * @param string $params A url-encoded string of all search parameters. + * @param string $params a url-encoded string of all search parameters * * @return self */ @@ -814,7 +812,7 @@ public function getParsedQuery() /** * Sets parsedQuery * - * @param string|null $parsedQuery The query string that will be searched, after normalization. + * @param string|null $parsedQuery the query string that will be searched, after normalization * * @return self */ @@ -838,7 +836,7 @@ public function getProcessingTimeMS() /** * Sets processingTimeMS * - * @param int $processingTimeMS Time the server took to process the request, in milliseconds. + * @param int $processingTimeMS time the server took to process the request, in milliseconds * * @return self */ @@ -862,7 +860,7 @@ public function getQuery() /** * Sets query * - * @param string $query The text to search in the index. + * @param string $query the text to search in the index * * @return self */ @@ -886,7 +884,7 @@ public function getQueryAfterRemoval() /** * Sets queryAfterRemoval * - * @param string|null $queryAfterRemoval A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. + * @param string|null $queryAfterRemoval a markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set * * @return self */ @@ -910,7 +908,7 @@ public function getServerUsed() /** * Sets serverUsed * - * @param string|null $serverUsed Actual host name of the server that processed the request. + * @param string|null $serverUsed actual host name of the server that processed the request * * @return self */ @@ -934,7 +932,7 @@ public function getUserData() /** * Sets userData * - * @param object|null $userData Lets you store custom data in your indices. + * @param object|null $userData lets you store custom data in your indices * * @return self */ @@ -995,9 +993,9 @@ public function setCursor($cursor) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -1007,7 +1005,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -1036,7 +1034,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -1047,14 +1045,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -1081,4 +1080,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/BuildInOperation.php b/clients/algoliasearch-client-php/lib/Model/BuildInOperation.php index 3812d64acb..70680634bc 100644 --- a/clients/algoliasearch-client-php/lib/Model/BuildInOperation.php +++ b/clients/algoliasearch-client-php/lib/Model/BuildInOperation.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * BuildInOperation Class Doc Comment * * @category Class * @description To update an attribute without pushing the entire record, you can use these built-in operations. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -33,7 +34,7 @@ class BuildInOperation implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'operation' => 'string', - 'value' => 'string' + 'value' => 'string', ]; /** @@ -45,7 +46,7 @@ class BuildInOperation implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'operation' => null, - 'value' => null + 'value' => null, ]; /** @@ -76,7 +77,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'operation' => '_operation', - 'value' => 'value' + 'value' => 'value', ]; /** @@ -86,7 +87,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'operation' => 'setOperation', - 'value' => 'setValue' + 'value' => 'setValue', ]; /** @@ -96,7 +97,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'operation' => 'getOperation', - 'value' => 'getValue' + 'value' => 'getValue', ]; /** @@ -209,6 +210,7 @@ public function listInvalidProperties() if ($this->container['value'] === null) { $invalidProperties[] = "'value' can't be null"; } + return $invalidProperties; } @@ -223,7 +225,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets operation * @@ -237,7 +238,7 @@ public function getOperation() /** * Sets operation * - * @param string $operation The operation to apply on the attribute. + * @param string $operation the operation to apply on the attribute * * @return self */ @@ -271,7 +272,7 @@ public function getValue() /** * Sets value * - * @param string $value the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove. + * @param string $value the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove * * @return self */ @@ -284,9 +285,9 @@ public function setValue($value) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -296,7 +297,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -325,7 +326,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -336,14 +337,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -370,4 +372,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/Condition.php b/clients/algoliasearch-client-php/lib/Model/Condition.php index 56abe62cb6..21687ba4c1 100644 --- a/clients/algoliasearch-client-php/lib/Model/Condition.php +++ b/clients/algoliasearch-client-php/lib/Model/Condition.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * Condition Class Doc Comment @@ -34,7 +34,7 @@ class Condition implements ModelInterface, ArrayAccess, \JsonSerializable 'pattern' => 'string', 'anchoring' => '\Algolia\AlgoliaSearch\Model\Anchoring', 'alternatives' => 'bool', - 'context' => 'string' + 'context' => 'string', ]; /** @@ -48,7 +48,7 @@ class Condition implements ModelInterface, ArrayAccess, \JsonSerializable 'pattern' => null, 'anchoring' => null, 'alternatives' => null, - 'context' => null + 'context' => null, ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() 'pattern' => 'pattern', 'anchoring' => 'anchoring', 'alternatives' => 'alternatives', - 'context' => 'context' + 'context' => 'context', ]; /** @@ -93,7 +93,7 @@ public static function openAPIFormats() 'pattern' => 'setPattern', 'anchoring' => 'setAnchoring', 'alternatives' => 'setAlternatives', - 'context' => 'setContext' + 'context' => 'setContext', ]; /** @@ -105,7 +105,7 @@ public static function openAPIFormats() 'pattern' => 'getPattern', 'anchoring' => 'getAnchoring', 'alternatives' => 'getAlternatives', - 'context' => 'getContext' + 'context' => 'getContext', ]; /** @@ -149,7 +149,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -194,7 +193,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets pattern * @@ -256,7 +254,7 @@ public function getAlternatives() /** * Sets alternatives * - * @param bool|null $alternatives Whether the pattern matches on plurals, synonyms, and typos. + * @param bool|null $alternatives whether the pattern matches on plurals, synonyms, and typos * * @return self */ @@ -280,7 +278,7 @@ public function getContext() /** * Sets context * - * @param string|null $context Rule context format: [A-Za-z0-9_-]+). + * @param string|null $context rule context format: [A-Za-z0-9_-]+) * * @return self */ @@ -293,9 +291,9 @@ public function setContext($context) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -305,7 +303,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -334,7 +332,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -345,14 +343,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -379,4 +378,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/Consequence.php b/clients/algoliasearch-client-php/lib/Model/Consequence.php index 5399db7de5..36f7608c55 100644 --- a/clients/algoliasearch-client-php/lib/Model/Consequence.php +++ b/clients/algoliasearch-client-php/lib/Model/Consequence.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * Consequence Class Doc Comment * * @category Class * @description Consequence of the Rule. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -36,7 +37,7 @@ class Consequence implements ModelInterface, ArrayAccess, \JsonSerializable 'promote' => '\Algolia\AlgoliaSearch\Model\Promote[]', 'filterPromotes' => 'bool', 'hide' => '\Algolia\AlgoliaSearch\Model\ConsequenceHide[]', - 'userData' => 'object' + 'userData' => 'object', ]; /** @@ -51,7 +52,7 @@ class Consequence implements ModelInterface, ArrayAccess, \JsonSerializable 'promote' => null, 'filterPromotes' => null, 'hide' => null, - 'userData' => null + 'userData' => null, ]; /** @@ -85,7 +86,7 @@ public static function openAPIFormats() 'promote' => 'promote', 'filterPromotes' => 'filterPromotes', 'hide' => 'hide', - 'userData' => 'userData' + 'userData' => 'userData', ]; /** @@ -98,7 +99,7 @@ public static function openAPIFormats() 'promote' => 'setPromote', 'filterPromotes' => 'setFilterPromotes', 'hide' => 'setHide', - 'userData' => 'setUserData' + 'userData' => 'setUserData', ]; /** @@ -111,7 +112,7 @@ public static function openAPIFormats() 'promote' => 'getPromote', 'filterPromotes' => 'getFilterPromotes', 'hide' => 'getHide', - 'userData' => 'getUserData' + 'userData' => 'getUserData', ]; /** @@ -155,7 +156,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -201,7 +201,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets params * @@ -239,7 +238,7 @@ public function getPromote() /** * Sets promote * - * @param \Algolia\AlgoliaSearch\Model\Promote[]|null $promote Objects to promote as hits. + * @param \Algolia\AlgoliaSearch\Model\Promote[]|null $promote objects to promote as hits * * @return self */ @@ -324,9 +323,9 @@ public function setUserData($userData) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -336,7 +335,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -365,7 +364,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -376,14 +375,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -410,4 +410,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php b/clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php index 35fcc49b7b..439670db5c 100644 --- a/clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php +++ b/clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * ConsequenceHide Class Doc Comment * * @category Class * @description Unique identifier of the object to hide. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -32,7 +33,7 @@ class ConsequenceHide implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'objectID' => 'string' + 'objectID' => 'string', ]; /** @@ -43,7 +44,7 @@ class ConsequenceHide implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'objectID' => null + 'objectID' => null, ]; /** @@ -73,7 +74,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'objectID' => 'objectID' + 'objectID' => 'objectID', ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'objectID' => 'setObjectID' + 'objectID' => 'setObjectID', ]; /** @@ -91,7 +92,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'objectID' => 'getObjectID' + 'objectID' => 'getObjectID', ]; /** @@ -135,7 +136,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -166,6 +166,7 @@ public function listInvalidProperties() if ($this->container['objectID'] === null) { $invalidProperties[] = "'objectID' can't be null"; } + return $invalidProperties; } @@ -180,7 +181,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets objectID * @@ -194,7 +194,7 @@ public function getObjectID() /** * Sets objectID * - * @param string $objectID Unique identifier of the object. + * @param string $objectID unique identifier of the object * * @return self */ @@ -207,9 +207,9 @@ public function setObjectID($objectID) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -219,7 +219,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -248,7 +248,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -259,14 +259,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -293,4 +294,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/ConsequenceParams.php b/clients/algoliasearch-client-php/lib/Model/ConsequenceParams.php index 1d45a92a8a..43312a1303 100644 --- a/clients/algoliasearch-client-php/lib/Model/ConsequenceParams.php +++ b/clients/algoliasearch-client-php/lib/Model/ConsequenceParams.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * ConsequenceParams Class Doc Comment @@ -109,7 +109,7 @@ class ConsequenceParams implements ModelInterface, ArrayAccess, \JsonSerializabl 'responseFields' => 'string[]', 'maxFacetHits' => 'int', 'attributeCriteriaComputedByMinProximity' => 'bool', - 'renderingContent' => 'object' + 'renderingContent' => 'object', ]; /** @@ -198,7 +198,7 @@ class ConsequenceParams implements ModelInterface, ArrayAccess, \JsonSerializabl 'responseFields' => null, 'maxFacetHits' => null, 'attributeCriteriaComputedByMinProximity' => null, - 'renderingContent' => null + 'renderingContent' => null, ]; /** @@ -306,7 +306,7 @@ public static function openAPIFormats() 'responseFields' => 'responseFields', 'maxFacetHits' => 'maxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', - 'renderingContent' => 'renderingContent' + 'renderingContent' => 'renderingContent', ]; /** @@ -393,7 +393,7 @@ public static function openAPIFormats() 'responseFields' => 'setResponseFields', 'maxFacetHits' => 'setMaxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', - 'renderingContent' => 'setRenderingContent' + 'renderingContent' => 'setRenderingContent', ]; /** @@ -480,7 +480,7 @@ public static function openAPIFormats() 'responseFields' => 'getResponseFields', 'maxFacetHits' => 'getMaxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', - 'renderingContent' => 'getRenderingContent' + 'renderingContent' => 'getRenderingContent', ]; /** @@ -816,7 +816,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets query * @@ -830,7 +829,7 @@ public function getQuery() /** * Sets query * - * @param string|null $query Query string. + * @param string|null $query query string * * @return self */ @@ -854,7 +853,7 @@ public function getAutomaticFacetFilters() /** * Sets automaticFacetFilters * - * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticFacetFilters Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern. + * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticFacetFilters names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern * * @return self */ @@ -878,7 +877,7 @@ public function getAutomaticOptionalFacetFilters() /** * Sets automaticOptionalFacetFilters * - * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticOptionalFacetFilters Same syntax as automaticFacetFilters, but the engine treats the filters as optional. + * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticOptionalFacetFilters same syntax as automaticFacetFilters, but the engine treats the filters as optional * * @return self */ @@ -902,7 +901,7 @@ public function getSimilarQuery() /** * Sets similarQuery * - * @param string|null $similarQuery Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. + * @param string|null $similarQuery overrides the query parameter and performs a more generic search that can be used to find \"similar\" results * * @return self */ @@ -926,7 +925,7 @@ public function getFilters() /** * Sets filters * - * @param string|null $filters Filter the query with numeric, facet and/or tag filters. + * @param string|null $filters filter the query with numeric, facet and/or tag filters * * @return self */ @@ -950,7 +949,7 @@ public function getFacetFilters() /** * Sets facetFilters * - * @param string[]|null $facetFilters Filter hits by facet value. + * @param string[]|null $facetFilters filter hits by facet value * * @return self */ @@ -974,7 +973,7 @@ public function getOptionalFilters() /** * Sets optionalFilters * - * @param string[]|null $optionalFilters Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. + * @param string[]|null $optionalFilters create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter * * @return self */ @@ -998,7 +997,7 @@ public function getNumericFilters() /** * Sets numericFilters * - * @param string[]|null $numericFilters Filter on numeric attributes. + * @param string[]|null $numericFilters filter on numeric attributes * * @return self */ @@ -1022,7 +1021,7 @@ public function getTagFilters() /** * Sets tagFilters * - * @param string[]|null $tagFilters Filter hits by tags. + * @param string[]|null $tagFilters filter hits by tags * * @return self */ @@ -1046,7 +1045,7 @@ public function getSumOrFiltersScores() /** * Sets sumOrFiltersScores * - * @param bool|null $sumOrFiltersScores Determines how to calculate the total score for filtering. + * @param bool|null $sumOrFiltersScores determines how to calculate the total score for filtering * * @return self */ @@ -1070,7 +1069,7 @@ public function getFacets() /** * Sets facets * - * @param string[]|null $facets Retrieve facets and their facet values. + * @param string[]|null $facets retrieve facets and their facet values * * @return self */ @@ -1094,7 +1093,7 @@ public function getMaxValuesPerFacet() /** * Sets maxValuesPerFacet * - * @param int|null $maxValuesPerFacet Maximum number of facet values to return for each facet during a regular search. + * @param int|null $maxValuesPerFacet maximum number of facet values to return for each facet during a regular search * * @return self */ @@ -1118,7 +1117,7 @@ public function getFacetingAfterDistinct() /** * Sets facetingAfterDistinct * - * @param bool|null $facetingAfterDistinct Force faceting to be applied after de-duplication (via the Distinct setting). + * @param bool|null $facetingAfterDistinct force faceting to be applied after de-duplication (via the Distinct setting) * * @return self */ @@ -1142,7 +1141,7 @@ public function getSortFacetValuesBy() /** * Sets sortFacetValuesBy * - * @param string|null $sortFacetValuesBy Controls how facet values are fetched. + * @param string|null $sortFacetValuesBy controls how facet values are fetched * * @return self */ @@ -1166,7 +1165,7 @@ public function getPage() /** * Sets page * - * @param int|null $page Specify the page to retrieve. + * @param int|null $page specify the page to retrieve * * @return self */ @@ -1190,7 +1189,7 @@ public function getOffset() /** * Sets offset * - * @param int|null $offset Specify the offset of the first hit to return. + * @param int|null $offset specify the offset of the first hit to return * * @return self */ @@ -1214,13 +1213,12 @@ public function getLength() /** * Sets length * - * @param int|null $length Set the number of hits to retrieve (used only with offset). + * @param int|null $length set the number of hits to retrieve (used only with offset) * * @return self */ public function setLength($length) { - if (!is_null($length) && ($length > 1000)) { throw new \InvalidArgumentException('invalid value for $length when calling ConsequenceParams., must be smaller than or equal to 1000.'); } @@ -1246,7 +1244,7 @@ public function getAroundLatLng() /** * Sets aroundLatLng * - * @param string|null $aroundLatLng Search for entries around a central geolocation, enabling a geo search within a circular area. + * @param string|null $aroundLatLng search for entries around a central geolocation, enabling a geo search within a circular area * * @return self */ @@ -1270,7 +1268,7 @@ public function getAroundLatLngViaIP() /** * Sets aroundLatLngViaIP * - * @param bool|null $aroundLatLngViaIP Search for entries around a given location automatically computed from the requester's IP address. + * @param bool|null $aroundLatLngViaIP search for entries around a given location automatically computed from the requester's IP address * * @return self */ @@ -1294,7 +1292,7 @@ public function getAroundRadius() /** * Sets aroundRadius * - * @param OneOfIntegerString|null $aroundRadius Define the maximum radius for a geo search (in meters). + * @param OneOfIntegerString|null $aroundRadius define the maximum radius for a geo search (in meters) * * @return self */ @@ -1318,7 +1316,7 @@ public function getAroundPrecision() /** * Sets aroundPrecision * - * @param int|null $aroundPrecision Precision of geo search (in meters), to add grouping by geo location to the ranking formula. + * @param int|null $aroundPrecision precision of geo search (in meters), to add grouping by geo location to the ranking formula * * @return self */ @@ -1342,13 +1340,12 @@ public function getMinimumAroundRadius() /** * Sets minimumAroundRadius * - * @param int|null $minimumAroundRadius Minimum radius (in meters) used for a geo search when aroundRadius is not set. + * @param int|null $minimumAroundRadius minimum radius (in meters) used for a geo search when aroundRadius is not set * * @return self */ public function setMinimumAroundRadius($minimumAroundRadius) { - if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling ConsequenceParams., must be bigger than or equal to 1.'); } @@ -1371,7 +1368,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox * - * @param float[]|null $insideBoundingBox Search inside a rectangular area (in geo coordinates). + * @param float[]|null $insideBoundingBox search inside a rectangular area (in geo coordinates) * * @return self */ @@ -1395,7 +1392,7 @@ public function getInsidePolygon() /** * Sets insidePolygon * - * @param float[]|null $insidePolygon Search inside a polygon (in geo coordinates). + * @param float[]|null $insidePolygon search inside a polygon (in geo coordinates) * * @return self */ @@ -1443,7 +1440,7 @@ public function getRuleContexts() /** * Sets ruleContexts * - * @param string[]|null $ruleContexts Enables contextual rules. + * @param string[]|null $ruleContexts enables contextual rules * * @return self */ @@ -1467,7 +1464,7 @@ public function getPersonalizationImpact() /** * Sets personalizationImpact * - * @param int|null $personalizationImpact Define the impact of the Personalization feature. + * @param int|null $personalizationImpact define the impact of the Personalization feature * * @return self */ @@ -1491,7 +1488,7 @@ public function getUserToken() /** * Sets userToken * - * @param string|null $userToken Associates a certain user token with the current search. + * @param string|null $userToken associates a certain user token with the current search * * @return self */ @@ -1515,7 +1512,7 @@ public function getGetRankingInfo() /** * Sets getRankingInfo * - * @param bool|null $getRankingInfo Retrieve detailed ranking information. + * @param bool|null $getRankingInfo retrieve detailed ranking information * * @return self */ @@ -1539,7 +1536,7 @@ public function getClickAnalytics() /** * Sets clickAnalytics * - * @param bool|null $clickAnalytics Enable the Click Analytics feature. + * @param bool|null $clickAnalytics enable the Click Analytics feature * * @return self */ @@ -1563,7 +1560,7 @@ public function getAnalytics() /** * Sets analytics * - * @param bool|null $analytics Whether the current query will be taken into account in the Analytics. + * @param bool|null $analytics whether the current query will be taken into account in the Analytics * * @return self */ @@ -1587,7 +1584,7 @@ public function getAnalyticsTags() /** * Sets analyticsTags * - * @param string[]|null $analyticsTags List of tags to apply to the query for analytics purposes. + * @param string[]|null $analyticsTags list of tags to apply to the query for analytics purposes * * @return self */ @@ -1611,7 +1608,7 @@ public function getPercentileComputation() /** * Sets percentileComputation * - * @param bool|null $percentileComputation Whether to include or exclude a query from the processing-time percentile computation. + * @param bool|null $percentileComputation whether to include or exclude a query from the processing-time percentile computation * * @return self */ @@ -1635,7 +1632,7 @@ public function getEnableABTest() /** * Sets enableABTest * - * @param bool|null $enableABTest Whether this search should participate in running AB tests. + * @param bool|null $enableABTest whether this search should participate in running AB tests * * @return self */ @@ -1659,7 +1656,7 @@ public function getEnableReRanking() /** * Sets enableReRanking * - * @param bool|null $enableReRanking Whether this search should use AI Re-Ranking. + * @param bool|null $enableReRanking whether this search should use AI Re-Ranking * * @return self */ @@ -1683,7 +1680,7 @@ public function getSearchableAttributes() /** * Sets searchableAttributes * - * @param string[]|null $searchableAttributes The complete list of attributes used for searching. + * @param string[]|null $searchableAttributes the complete list of attributes used for searching * * @return self */ @@ -1707,7 +1704,7 @@ public function getAttributesForFaceting() /** * Sets attributesForFaceting * - * @param string[]|null $attributesForFaceting The complete list of attributes that will be used for faceting. + * @param string[]|null $attributesForFaceting the complete list of attributes that will be used for faceting * * @return self */ @@ -1731,7 +1728,7 @@ public function getUnretrievableAttributes() /** * Sets unretrievableAttributes * - * @param string[]|null $unretrievableAttributes List of attributes that can't be retrieved at query time. + * @param string[]|null $unretrievableAttributes list of attributes that can't be retrieved at query time * * @return self */ @@ -1755,7 +1752,7 @@ public function getAttributesToRetrieve() /** * Sets attributesToRetrieve * - * @param string[]|null $attributesToRetrieve This parameter controls which attributes to retrieve and which not to retrieve. + * @param string[]|null $attributesToRetrieve this parameter controls which attributes to retrieve and which not to retrieve * * @return self */ @@ -1779,7 +1776,7 @@ public function getRestrictSearchableAttributes() /** * Sets restrictSearchableAttributes * - * @param string[]|null $restrictSearchableAttributes Restricts a given query to look in only a subset of your searchable attributes. + * @param string[]|null $restrictSearchableAttributes restricts a given query to look in only a subset of your searchable attributes * * @return self */ @@ -1803,7 +1800,7 @@ public function getRanking() /** * Sets ranking * - * @param string[]|null $ranking Controls how Algolia should sort your results. + * @param string[]|null $ranking controls how Algolia should sort your results * * @return self */ @@ -1827,7 +1824,7 @@ public function getCustomRanking() /** * Sets customRanking * - * @param string[]|null $customRanking Specifies the custom ranking criterion. + * @param string[]|null $customRanking specifies the custom ranking criterion * * @return self */ @@ -1851,7 +1848,7 @@ public function getRelevancyStrictness() /** * Sets relevancyStrictness * - * @param int|null $relevancyStrictness Controls the relevancy threshold below which less relevant results aren't included in the results. + * @param int|null $relevancyStrictness controls the relevancy threshold below which less relevant results aren't included in the results * * @return self */ @@ -1875,7 +1872,7 @@ public function getAttributesToHighlight() /** * Sets attributesToHighlight * - * @param string[]|null $attributesToHighlight List of attributes to highlight. + * @param string[]|null $attributesToHighlight list of attributes to highlight * * @return self */ @@ -1899,7 +1896,7 @@ public function getAttributesToSnippet() /** * Sets attributesToSnippet * - * @param string[]|null $attributesToSnippet List of attributes to snippet, with an optional maximum number of words to snippet. + * @param string[]|null $attributesToSnippet list of attributes to snippet, with an optional maximum number of words to snippet * * @return self */ @@ -1923,7 +1920,7 @@ public function getHighlightPreTag() /** * Sets highlightPreTag * - * @param string|null $highlightPreTag The HTML string to insert before the highlighted parts in all highlight and snippet results. + * @param string|null $highlightPreTag the HTML string to insert before the highlighted parts in all highlight and snippet results * * @return self */ @@ -1947,7 +1944,7 @@ public function getHighlightPostTag() /** * Sets highlightPostTag * - * @param string|null $highlightPostTag The HTML string to insert after the highlighted parts in all highlight and snippet results. + * @param string|null $highlightPostTag the HTML string to insert after the highlighted parts in all highlight and snippet results * * @return self */ @@ -1971,7 +1968,7 @@ public function getSnippetEllipsisText() /** * Sets snippetEllipsisText * - * @param string|null $snippetEllipsisText String used as an ellipsis indicator when a snippet is truncated. + * @param string|null $snippetEllipsisText string used as an ellipsis indicator when a snippet is truncated * * @return self */ @@ -1995,7 +1992,7 @@ public function getRestrictHighlightAndSnippetArrays() /** * Sets restrictHighlightAndSnippetArrays * - * @param bool|null $restrictHighlightAndSnippetArrays Restrict highlighting and snippeting to items that matched the query. + * @param bool|null $restrictHighlightAndSnippetArrays restrict highlighting and snippeting to items that matched the query * * @return self */ @@ -2019,7 +2016,7 @@ public function getHitsPerPage() /** * Sets hitsPerPage * - * @param int|null $hitsPerPage Set the number of hits per page. + * @param int|null $hitsPerPage set the number of hits per page * * @return self */ @@ -2043,7 +2040,7 @@ public function getMinWordSizefor1Typo() /** * Sets minWordSizefor1Typo * - * @param int|null $minWordSizefor1Typo Minimum number of characters a word in the query string must contain to accept matches with 1 typo. + * @param int|null $minWordSizefor1Typo minimum number of characters a word in the query string must contain to accept matches with 1 typo * * @return self */ @@ -2067,7 +2064,7 @@ public function getMinWordSizefor2Typos() /** * Sets minWordSizefor2Typos * - * @param int|null $minWordSizefor2Typos Minimum number of characters a word in the query string must contain to accept matches with 2 typos. + * @param int|null $minWordSizefor2Typos minimum number of characters a word in the query string must contain to accept matches with 2 typos * * @return self */ @@ -2091,7 +2088,7 @@ public function getTypoTolerance() /** * Sets typoTolerance * - * @param string|null $typoTolerance Controls whether typo tolerance is enabled and how it is applied. + * @param string|null $typoTolerance controls whether typo tolerance is enabled and how it is applied * * @return self */ @@ -2125,7 +2122,7 @@ public function getAllowTyposOnNumericTokens() /** * Sets allowTyposOnNumericTokens * - * @param bool|null $allowTyposOnNumericTokens Whether to allow typos on numbers (\"numeric tokens\") in the query string. + * @param bool|null $allowTyposOnNumericTokens whether to allow typos on numbers (\"numeric tokens\") in the query string * * @return self */ @@ -2149,7 +2146,7 @@ public function getDisableTypoToleranceOnAttributes() /** * Sets disableTypoToleranceOnAttributes * - * @param string[]|null $disableTypoToleranceOnAttributes List of attributes on which you want to disable typo tolerance. + * @param string[]|null $disableTypoToleranceOnAttributes list of attributes on which you want to disable typo tolerance * * @return self */ @@ -2173,7 +2170,7 @@ public function getSeparatorsToIndex() /** * Sets separatorsToIndex * - * @param string|null $separatorsToIndex Control which separators are indexed. + * @param string|null $separatorsToIndex control which separators are indexed * * @return self */ @@ -2197,7 +2194,7 @@ public function getIgnorePlurals() /** * Sets ignorePlurals * - * @param string|null $ignorePlurals Treats singular, plurals, and other forms of declensions as matching terms. + * @param string|null $ignorePlurals treats singular, plurals, and other forms of declensions as matching terms * * @return self */ @@ -2221,7 +2218,7 @@ public function getRemoveStopWords() /** * Sets removeStopWords * - * @param string|null $removeStopWords Removes stop (common) words from the query before executing it. + * @param string|null $removeStopWords removes stop (common) words from the query before executing it * * @return self */ @@ -2245,7 +2242,7 @@ public function getKeepDiacriticsOnCharacters() /** * Sets keepDiacriticsOnCharacters * - * @param string|null $keepDiacriticsOnCharacters List of characters that the engine shouldn't automatically normalize. + * @param string|null $keepDiacriticsOnCharacters list of characters that the engine shouldn't automatically normalize * * @return self */ @@ -2269,7 +2266,7 @@ public function getQueryLanguages() /** * Sets queryLanguages * - * @param string[]|null $queryLanguages Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. + * @param string[]|null $queryLanguages sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection * * @return self */ @@ -2293,7 +2290,7 @@ public function getDecompoundQuery() /** * Sets decompoundQuery * - * @param bool|null $decompoundQuery Splits compound words into their composing atoms in the query. + * @param bool|null $decompoundQuery splits compound words into their composing atoms in the query * * @return self */ @@ -2317,7 +2314,7 @@ public function getEnableRules() /** * Sets enableRules * - * @param bool|null $enableRules Whether Rules should be globally enabled. + * @param bool|null $enableRules whether Rules should be globally enabled * * @return self */ @@ -2341,7 +2338,7 @@ public function getEnablePersonalization() /** * Sets enablePersonalization * - * @param bool|null $enablePersonalization Enable the Personalization feature. + * @param bool|null $enablePersonalization enable the Personalization feature * * @return self */ @@ -2365,7 +2362,7 @@ public function getQueryType() /** * Sets queryType * - * @param string|null $queryType Controls if and how query words are interpreted as prefixes. + * @param string|null $queryType controls if and how query words are interpreted as prefixes * * @return self */ @@ -2399,7 +2396,7 @@ public function getRemoveWordsIfNoResults() /** * Sets removeWordsIfNoResults * - * @param string|null $removeWordsIfNoResults Selects a strategy to remove words from the query when it doesn't match any hits. + * @param string|null $removeWordsIfNoResults selects a strategy to remove words from the query when it doesn't match any hits * * @return self */ @@ -2433,7 +2430,7 @@ public function getAdvancedSyntax() /** * Sets advancedSyntax * - * @param bool|null $advancedSyntax Enables the advanced query syntax. + * @param bool|null $advancedSyntax enables the advanced query syntax * * @return self */ @@ -2457,7 +2454,7 @@ public function getOptionalWords() /** * Sets optionalWords * - * @param string[]|null $optionalWords A list of words that should be considered as optional when found in the query. + * @param string[]|null $optionalWords a list of words that should be considered as optional when found in the query * * @return self */ @@ -2481,7 +2478,7 @@ public function getDisableExactOnAttributes() /** * Sets disableExactOnAttributes * - * @param string[]|null $disableExactOnAttributes List of attributes on which you want to disable the exact ranking criterion. + * @param string[]|null $disableExactOnAttributes list of attributes on which you want to disable the exact ranking criterion * * @return self */ @@ -2505,7 +2502,7 @@ public function getExactOnSingleWordQuery() /** * Sets exactOnSingleWordQuery * - * @param string|null $exactOnSingleWordQuery Controls how the exact ranking criterion is computed when the query contains only one word. + * @param string|null $exactOnSingleWordQuery controls how the exact ranking criterion is computed when the query contains only one word * * @return self */ @@ -2539,7 +2536,7 @@ public function getAlternativesAsExact() /** * Sets alternativesAsExact * - * @param string[]|null $alternativesAsExact List of alternatives that should be considered an exact match by the exact ranking criterion. + * @param string[]|null $alternativesAsExact list of alternatives that should be considered an exact match by the exact ranking criterion * * @return self */ @@ -2572,7 +2569,7 @@ public function getAdvancedSyntaxFeatures() /** * Sets advancedSyntaxFeatures * - * @param string[]|null $advancedSyntaxFeatures Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. + * @param string[]|null $advancedSyntaxFeatures allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled * * @return self */ @@ -2605,13 +2602,12 @@ public function getDistinct() /** * Sets distinct * - * @param int|null $distinct Enables de-duplication or grouping of results. + * @param int|null $distinct enables de-duplication or grouping of results * * @return self */ public function setDistinct($distinct) { - if (!is_null($distinct) && ($distinct > 4)) { throw new \InvalidArgumentException('invalid value for $distinct when calling ConsequenceParams., must be smaller than or equal to 4.'); } @@ -2637,7 +2633,7 @@ public function getSynonyms() /** * Sets synonyms * - * @param bool|null $synonyms Whether to take into account an index's synonyms for a particular search. + * @param bool|null $synonyms whether to take into account an index's synonyms for a particular search * * @return self */ @@ -2661,7 +2657,7 @@ public function getReplaceSynonymsInHighlight() /** * Sets replaceSynonymsInHighlight * - * @param bool|null $replaceSynonymsInHighlight Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + * @param bool|null $replaceSynonymsInHighlight whether to highlight and snippet the original word that matches the synonym or the synonym itself * * @return self */ @@ -2685,13 +2681,12 @@ public function getMinProximity() /** * Sets minProximity * - * @param int|null $minProximity Precision of the proximity ranking criterion. + * @param int|null $minProximity precision of the proximity ranking criterion * * @return self */ public function setMinProximity($minProximity) { - if (!is_null($minProximity) && ($minProximity > 7)) { throw new \InvalidArgumentException('invalid value for $minProximity when calling ConsequenceParams., must be smaller than or equal to 7.'); } @@ -2747,7 +2742,6 @@ public function getMaxFacetHits() */ public function setMaxFacetHits($maxFacetHits) { - if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling ConsequenceParams., must be smaller than or equal to 100.'); } @@ -2770,7 +2764,7 @@ public function getAttributeCriteriaComputedByMinProximity() /** * Sets attributeCriteriaComputedByMinProximity * - * @param bool|null $attributeCriteriaComputedByMinProximity When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. + * @param bool|null $attributeCriteriaComputedByMinProximity when attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage * * @return self */ @@ -2807,9 +2801,9 @@ public function setRenderingContent($renderingContent) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -2819,7 +2813,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -2848,7 +2842,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -2859,14 +2853,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -2893,4 +2888,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php b/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php index 0aa84a34c1..25a3783669 100644 --- a/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php +++ b/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * CreatedAtObject Class Doc Comment @@ -31,7 +31,7 @@ class CreatedAtObject implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'createdAt' => '\DateTime' + 'createdAt' => '\DateTime', ]; /** @@ -42,7 +42,7 @@ class CreatedAtObject implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'createdAt' => 'date-time' + 'createdAt' => 'date-time', ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'createdAt' => 'createdAt' + 'createdAt' => 'createdAt', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'createdAt' => 'setCreatedAt' + 'createdAt' => 'setCreatedAt', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'createdAt' => 'getCreatedAt' + 'createdAt' => 'getCreatedAt', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -165,6 +164,7 @@ public function listInvalidProperties() if ($this->container['createdAt'] === null) { $invalidProperties[] = "'createdAt' can't be null"; } + return $invalidProperties; } @@ -179,7 +179,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets createdAt * @@ -193,7 +192,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param \DateTime $createdAt Date of creation (ISO-8601 format). + * @param \DateTime $createdAt date of creation (ISO-8601 format) * * @return self */ @@ -206,9 +205,9 @@ public function setCreatedAt($createdAt) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -218,7 +217,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -247,7 +246,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -258,14 +257,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -292,4 +292,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php index 315a5ae358..518f5e1dd9 100644 --- a/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * CreatedAtResponse Class Doc Comment * * @category Class * @description The response with a createdAt timestamp. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -32,7 +33,7 @@ class CreatedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializabl * @var string[] */ protected static $openAPITypes = [ - 'createdAt' => '\DateTime' + 'createdAt' => '\DateTime', ]; /** @@ -43,7 +44,7 @@ class CreatedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializabl * @psalm-var array */ protected static $openAPIFormats = [ - 'createdAt' => 'date-time' + 'createdAt' => 'date-time', ]; /** @@ -73,7 +74,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'createdAt' => 'createdAt' + 'createdAt' => 'createdAt', ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'createdAt' => 'setCreatedAt' + 'createdAt' => 'setCreatedAt', ]; /** @@ -91,7 +92,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'createdAt' => 'getCreatedAt' + 'createdAt' => 'getCreatedAt', ]; /** @@ -135,7 +136,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -166,6 +166,7 @@ public function listInvalidProperties() if ($this->container['createdAt'] === null) { $invalidProperties[] = "'createdAt' can't be null"; } + return $invalidProperties; } @@ -180,7 +181,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets createdAt * @@ -194,7 +194,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param \DateTime $createdAt Date of creation (ISO-8601 format). + * @param \DateTime $createdAt date of creation (ISO-8601 format) * * @return self */ @@ -207,9 +207,9 @@ public function setCreatedAt($createdAt) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -219,7 +219,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -248,7 +248,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -259,14 +259,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -293,4 +294,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php b/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php index 91a0261797..49799d84d4 100644 --- a/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * DeleteApiKeyResponse Class Doc Comment @@ -31,7 +31,7 @@ class DeleteApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'deletedAt' => '\DateTime' + 'deletedAt' => '\DateTime', ]; /** @@ -42,7 +42,7 @@ class DeleteApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'deletedAt' => 'date-time' + 'deletedAt' => 'date-time', ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'deletedAt' => 'deletedAt' + 'deletedAt' => 'deletedAt', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'deletedAt' => 'setDeletedAt' + 'deletedAt' => 'setDeletedAt', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'deletedAt' => 'getDeletedAt' + 'deletedAt' => 'getDeletedAt', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -165,6 +164,7 @@ public function listInvalidProperties() if ($this->container['deletedAt'] === null) { $invalidProperties[] = "'deletedAt' can't be null"; } + return $invalidProperties; } @@ -179,7 +179,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets deletedAt * @@ -193,7 +192,7 @@ public function getDeletedAt() /** * Sets deletedAt * - * @param \DateTime $deletedAt Date of deletion (ISO-8601 format). + * @param \DateTime $deletedAt date of deletion (ISO-8601 format) * * @return self */ @@ -206,9 +205,9 @@ public function setDeletedAt($deletedAt) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -218,7 +217,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -247,7 +246,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -258,14 +257,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -292,4 +292,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php b/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php index 0d93123442..ad6f17652f 100644 --- a/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * DeleteSourceResponse Class Doc Comment @@ -31,7 +31,7 @@ class DeleteSourceResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'deletedAt' => '\DateTime' + 'deletedAt' => '\DateTime', ]; /** @@ -42,7 +42,7 @@ class DeleteSourceResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'deletedAt' => 'date-time' + 'deletedAt' => 'date-time', ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'deletedAt' => 'deletedAt' + 'deletedAt' => 'deletedAt', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'deletedAt' => 'setDeletedAt' + 'deletedAt' => 'setDeletedAt', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'deletedAt' => 'getDeletedAt' + 'deletedAt' => 'getDeletedAt', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -165,6 +164,7 @@ public function listInvalidProperties() if ($this->container['deletedAt'] === null) { $invalidProperties[] = "'deletedAt' can't be null"; } + return $invalidProperties; } @@ -179,7 +179,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets deletedAt * @@ -193,7 +192,7 @@ public function getDeletedAt() /** * Sets deletedAt * - * @param \DateTime $deletedAt Date of deletion (ISO-8601 format). + * @param \DateTime $deletedAt date of deletion (ISO-8601 format) * * @return self */ @@ -206,9 +205,9 @@ public function setDeletedAt($deletedAt) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -218,7 +217,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -247,7 +246,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -258,14 +257,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -292,4 +292,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php index 7877e7405a..1101441536 100644 --- a/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * DeletedAtResponse Class Doc Comment * * @category Class * @description The response with a taskID and a deletedAt timestamp. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -33,7 +34,7 @@ class DeletedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPITypes = [ 'taskID' => 'int', - 'deletedAt' => '\DateTime' + 'deletedAt' => '\DateTime', ]; /** @@ -45,7 +46,7 @@ class DeletedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPIFormats = [ 'taskID' => null, - 'deletedAt' => 'date-time' + 'deletedAt' => 'date-time', ]; /** @@ -76,7 +77,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'taskID' => 'taskID', - 'deletedAt' => 'deletedAt' + 'deletedAt' => 'deletedAt', ]; /** @@ -86,7 +87,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'taskID' => 'setTaskID', - 'deletedAt' => 'setDeletedAt' + 'deletedAt' => 'setDeletedAt', ]; /** @@ -96,7 +97,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'taskID' => 'getTaskID', - 'deletedAt' => 'getDeletedAt' + 'deletedAt' => 'getDeletedAt', ]; /** @@ -140,7 +141,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -175,6 +175,7 @@ public function listInvalidProperties() if ($this->container['deletedAt'] === null) { $invalidProperties[] = "'deletedAt' can't be null"; } + return $invalidProperties; } @@ -189,7 +190,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets taskID * @@ -203,7 +203,7 @@ public function getTaskID() /** * Sets taskID * - * @param int $taskID taskID of the indexing task to wait for. + * @param int $taskID taskID of the indexing task to wait for * * @return self */ @@ -227,7 +227,7 @@ public function getDeletedAt() /** * Sets deletedAt * - * @param \DateTime $deletedAt Date of deletion (ISO-8601 format). + * @param \DateTime $deletedAt date of deletion (ISO-8601 format) * * @return self */ @@ -240,9 +240,9 @@ public function setDeletedAt($deletedAt) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -252,7 +252,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -281,7 +281,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -292,14 +292,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -326,4 +327,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/DictionaryEntry.php b/clients/algoliasearch-client-php/lib/Model/DictionaryEntry.php index 5f82ce427d..bd1d2403d8 100644 --- a/clients/algoliasearch-client-php/lib/Model/DictionaryEntry.php +++ b/clients/algoliasearch-client-php/lib/Model/DictionaryEntry.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * DictionaryEntry Class Doc Comment * * @category Class * @description A dictionary entry. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -37,7 +38,7 @@ class DictionaryEntry implements ModelInterface, ArrayAccess, \JsonSerializable 'word' => 'string', 'words' => 'string[]', 'decomposition' => 'string[]', - 'state' => 'string' + 'state' => 'string', ]; /** @@ -53,7 +54,7 @@ class DictionaryEntry implements ModelInterface, ArrayAccess, \JsonSerializable 'word' => null, 'words' => null, 'decomposition' => null, - 'state' => null + 'state' => null, ]; /** @@ -88,7 +89,7 @@ public static function openAPIFormats() 'word' => 'word', 'words' => 'words', 'decomposition' => 'decomposition', - 'state' => 'state' + 'state' => 'state', ]; /** @@ -102,7 +103,7 @@ public static function openAPIFormats() 'word' => 'setWord', 'words' => 'setWords', 'decomposition' => 'setDecomposition', - 'state' => 'setState' + 'state' => 'setState', ]; /** @@ -116,7 +117,7 @@ public static function openAPIFormats() 'word' => 'getWord', 'words' => 'getWords', 'decomposition' => 'getDecomposition', - 'state' => 'getState' + 'state' => 'getState', ]; /** @@ -237,7 +238,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets objectID * @@ -251,7 +251,7 @@ public function getObjectID() /** * Sets objectID * - * @param string $objectID Unique identifier of the object. + * @param string $objectID unique identifier of the object * * @return self */ @@ -299,7 +299,7 @@ public function getWord() /** * Sets word * - * @param string|null $word The word of the dictionary entry. + * @param string|null $word the word of the dictionary entry * * @return self */ @@ -323,7 +323,7 @@ public function getWords() /** * Sets words * - * @param string[]|null $words The words of the dictionary entry. + * @param string[]|null $words the words of the dictionary entry * * @return self */ @@ -347,7 +347,7 @@ public function getDecomposition() /** * Sets decomposition * - * @param string[]|null $decomposition A decomposition of the word of the dictionary entry. + * @param string[]|null $decomposition a decomposition of the word of the dictionary entry * * @return self */ @@ -371,7 +371,7 @@ public function getState() /** * Sets state * - * @param string|null $state The state of the dictionary entry. + * @param string|null $state the state of the dictionary entry * * @return self */ @@ -394,9 +394,9 @@ public function setState($state) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -406,7 +406,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -435,7 +435,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -446,14 +446,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -480,4 +481,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/DictionaryLanguage.php b/clients/algoliasearch-client-php/lib/Model/DictionaryLanguage.php index fca61ce2e7..48dc0a82eb 100644 --- a/clients/algoliasearch-client-php/lib/Model/DictionaryLanguage.php +++ b/clients/algoliasearch-client-php/lib/Model/DictionaryLanguage.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * DictionaryLanguage Class Doc Comment * * @category Class * @description Custom entries for a dictionary + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -32,7 +33,7 @@ class DictionaryLanguage implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'nbCustomEntires' => 'int' + 'nbCustomEntires' => 'int', ]; /** @@ -43,7 +44,7 @@ class DictionaryLanguage implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'nbCustomEntires' => null + 'nbCustomEntires' => null, ]; /** @@ -73,7 +74,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'nbCustomEntires' => 'nbCustomEntires' + 'nbCustomEntires' => 'nbCustomEntires', ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'nbCustomEntires' => 'setNbCustomEntires' + 'nbCustomEntires' => 'setNbCustomEntires', ]; /** @@ -91,7 +92,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'nbCustomEntires' => 'getNbCustomEntires' + 'nbCustomEntires' => 'getNbCustomEntires', ]; /** @@ -135,7 +136,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -177,7 +177,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets nbCustomEntires * @@ -204,9 +203,9 @@ public function setNbCustomEntires($nbCustomEntires) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -216,7 +215,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -245,7 +244,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -256,14 +255,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -290,4 +290,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/DictionarySettingsRequest.php b/clients/algoliasearch-client-php/lib/Model/DictionarySettingsRequest.php index 598f8285e6..3a1a076d6e 100644 --- a/clients/algoliasearch-client-php/lib/Model/DictionarySettingsRequest.php +++ b/clients/algoliasearch-client-php/lib/Model/DictionarySettingsRequest.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * DictionarySettingsRequest Class Doc Comment * * @category Class * @description Disable the builtin Algolia entries for a type of dictionary per language. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -32,7 +33,7 @@ class DictionarySettingsRequest implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'disableStandardEntries' => '\Algolia\AlgoliaSearch\Model\StandardEntries' + 'disableStandardEntries' => '\Algolia\AlgoliaSearch\Model\StandardEntries', ]; /** @@ -43,7 +44,7 @@ class DictionarySettingsRequest implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ - 'disableStandardEntries' => null + 'disableStandardEntries' => null, ]; /** @@ -73,7 +74,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'disableStandardEntries' => 'disableStandardEntries' + 'disableStandardEntries' => 'disableStandardEntries', ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'disableStandardEntries' => 'setDisableStandardEntries' + 'disableStandardEntries' => 'setDisableStandardEntries', ]; /** @@ -91,7 +92,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'disableStandardEntries' => 'getDisableStandardEntries' + 'disableStandardEntries' => 'getDisableStandardEntries', ]; /** @@ -135,7 +136,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -166,6 +166,7 @@ public function listInvalidProperties() if ($this->container['disableStandardEntries'] === null) { $invalidProperties[] = "'disableStandardEntries' can't be null"; } + return $invalidProperties; } @@ -180,7 +181,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets disableStandardEntries * @@ -207,9 +207,9 @@ public function setDisableStandardEntries($disableStandardEntries) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -219,7 +219,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -248,7 +248,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -259,14 +259,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -293,4 +294,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/ErrorBase.php b/clients/algoliasearch-client-php/lib/Model/ErrorBase.php index 53696972f2..1bbea7821b 100644 --- a/clients/algoliasearch-client-php/lib/Model/ErrorBase.php +++ b/clients/algoliasearch-client-php/lib/Model/ErrorBase.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * ErrorBase Class Doc Comment * * @category Class * @description Error. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -32,7 +33,7 @@ class ErrorBase implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'message' => 'string' + 'message' => 'string', ]; /** @@ -43,7 +44,7 @@ class ErrorBase implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'message' => null + 'message' => null, ]; /** @@ -73,7 +74,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'message' => 'message' + 'message' => 'message', ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'message' => 'setMessage' + 'message' => 'setMessage', ]; /** @@ -91,7 +92,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'message' => 'getMessage' + 'message' => 'getMessage', ]; /** @@ -135,7 +136,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -177,7 +177,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets message * @@ -204,9 +203,9 @@ public function setMessage($message) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -216,7 +215,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -245,7 +244,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -256,14 +255,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -290,4 +290,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/GetDictionarySettingsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetDictionarySettingsResponse.php index d946c1d7b9..3a5bdc91d9 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetDictionarySettingsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/GetDictionarySettingsResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * GetDictionarySettingsResponse Class Doc Comment @@ -31,7 +31,7 @@ class GetDictionarySettingsResponse implements ModelInterface, ArrayAccess, \Jso * @var string[] */ protected static $openAPITypes = [ - 'disableStandardEntries' => '\Algolia\AlgoliaSearch\Model\StandardEntries' + 'disableStandardEntries' => '\Algolia\AlgoliaSearch\Model\StandardEntries', ]; /** @@ -42,7 +42,7 @@ class GetDictionarySettingsResponse implements ModelInterface, ArrayAccess, \Jso * @psalm-var array */ protected static $openAPIFormats = [ - 'disableStandardEntries' => null + 'disableStandardEntries' => null, ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'disableStandardEntries' => 'disableStandardEntries' + 'disableStandardEntries' => 'disableStandardEntries', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'disableStandardEntries' => 'setDisableStandardEntries' + 'disableStandardEntries' => 'setDisableStandardEntries', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'disableStandardEntries' => 'getDisableStandardEntries' + 'disableStandardEntries' => 'getDisableStandardEntries', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -165,6 +164,7 @@ public function listInvalidProperties() if ($this->container['disableStandardEntries'] === null) { $invalidProperties[] = "'disableStandardEntries' can't be null"; } + return $invalidProperties; } @@ -179,7 +179,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets disableStandardEntries * @@ -206,9 +205,9 @@ public function setDisableStandardEntries($disableStandardEntries) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -218,7 +217,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -247,7 +246,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -258,14 +257,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -292,4 +292,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php index c2e0033e7d..ce4a52628a 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * GetLogsResponse Class Doc Comment @@ -31,7 +31,7 @@ class GetLogsResponse implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'logs' => '\Algolia\AlgoliaSearch\Model\GetLogsResponseLogs[]' + 'logs' => '\Algolia\AlgoliaSearch\Model\GetLogsResponseLogs[]', ]; /** @@ -42,7 +42,7 @@ class GetLogsResponse implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'logs' => null + 'logs' => null, ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'logs' => 'logs' + 'logs' => 'logs', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'logs' => 'setLogs' + 'logs' => 'setLogs', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'logs' => 'getLogs' + 'logs' => 'getLogs', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -165,6 +164,7 @@ public function listInvalidProperties() if ($this->container['logs'] === null) { $invalidProperties[] = "'logs' can't be null"; } + return $invalidProperties; } @@ -179,7 +179,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets logs * @@ -206,9 +205,9 @@ public function setLogs($logs) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -218,7 +217,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -247,7 +246,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -258,14 +257,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -292,4 +292,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php b/clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php index a895461a73..8fef10989e 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php +++ b/clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * GetLogsResponseInnerQueries Class Doc Comment @@ -33,7 +33,7 @@ class GetLogsResponseInnerQueries implements ModelInterface, ArrayAccess, \JsonS protected static $openAPITypes = [ 'indexName' => 'string', 'userToken' => 'string', - 'queryId' => 'string' + 'queryId' => 'string', ]; /** @@ -46,7 +46,7 @@ class GetLogsResponseInnerQueries implements ModelInterface, ArrayAccess, \JsonS protected static $openAPIFormats = [ 'indexName' => null, 'userToken' => null, - 'queryId' => null + 'queryId' => null, ]; /** @@ -78,7 +78,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'indexName' => 'index_name', 'userToken' => 'user_token', - 'queryId' => 'query_id' + 'queryId' => 'query_id', ]; /** @@ -89,7 +89,7 @@ public static function openAPIFormats() protected static $setters = [ 'indexName' => 'setIndexName', 'userToken' => 'setUserToken', - 'queryId' => 'setQueryId' + 'queryId' => 'setQueryId', ]; /** @@ -100,7 +100,7 @@ public static function openAPIFormats() protected static $getters = [ 'indexName' => 'getIndexName', 'userToken' => 'getUserToken', - 'queryId' => 'getQueryId' + 'queryId' => 'getQueryId', ]; /** @@ -144,7 +144,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -188,7 +187,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets indexName * @@ -202,7 +200,7 @@ public function getIndexName() /** * Sets indexName * - * @param string|null $indexName Index targeted by the query. + * @param string|null $indexName index targeted by the query * * @return self */ @@ -226,7 +224,7 @@ public function getUserToken() /** * Sets userToken * - * @param string|null $userToken User identifier. + * @param string|null $userToken user identifier * * @return self */ @@ -250,7 +248,7 @@ public function getQueryId() /** * Sets queryId * - * @param string|null $queryId QueryID for the given query. + * @param string|null $queryId queryID for the given query * * @return self */ @@ -263,9 +261,9 @@ public function setQueryId($queryId) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -275,7 +273,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -304,7 +302,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -315,14 +313,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -349,4 +348,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/GetLogsResponseLogs.php b/clients/algoliasearch-client-php/lib/Model/GetLogsResponseLogs.php index 1c30d989b3..a8ff63bf14 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetLogsResponseLogs.php +++ b/clients/algoliasearch-client-php/lib/Model/GetLogsResponseLogs.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * GetLogsResponseLogs Class Doc Comment @@ -45,7 +45,7 @@ class GetLogsResponseLogs implements ModelInterface, ArrayAccess, \JsonSerializa 'index' => 'string', 'queryParams' => 'string', 'queryNbHits' => 'string', - 'innerQueries' => '\Algolia\AlgoliaSearch\Model\GetLogsResponseInnerQueries[]' + 'innerQueries' => '\Algolia\AlgoliaSearch\Model\GetLogsResponseInnerQueries[]', ]; /** @@ -70,7 +70,7 @@ class GetLogsResponseLogs implements ModelInterface, ArrayAccess, \JsonSerializa 'index' => null, 'queryParams' => null, 'queryNbHits' => null, - 'innerQueries' => null + 'innerQueries' => null, ]; /** @@ -114,7 +114,7 @@ public static function openAPIFormats() 'index' => 'index', 'queryParams' => 'query_params', 'queryNbHits' => 'query_nb_hits', - 'innerQueries' => 'inner_queries' + 'innerQueries' => 'inner_queries', ]; /** @@ -137,7 +137,7 @@ public static function openAPIFormats() 'index' => 'setIndex', 'queryParams' => 'setQueryParams', 'queryNbHits' => 'setQueryNbHits', - 'innerQueries' => 'setInnerQueries' + 'innerQueries' => 'setInnerQueries', ]; /** @@ -160,7 +160,7 @@ public static function openAPIFormats() 'index' => 'getIndex', 'queryParams' => 'getQueryParams', 'queryNbHits' => 'getQueryNbHits', - 'innerQueries' => 'getInnerQueries' + 'innerQueries' => 'getInnerQueries', ]; /** @@ -204,7 +204,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -279,6 +278,7 @@ public function listInvalidProperties() if ($this->container['processingTimeMs'] === null) { $invalidProperties[] = "'processingTimeMs' can't be null"; } + return $invalidProperties; } @@ -293,7 +293,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets timestamp * @@ -307,7 +306,7 @@ public function getTimestamp() /** * Sets timestamp * - * @param string $timestamp Timestamp in ISO-8601 format. + * @param string $timestamp timestamp in ISO-8601 format * * @return self */ @@ -331,7 +330,7 @@ public function getMethod() /** * Sets method * - * @param string $method HTTP method of the perfomed request. + * @param string $method HTTP method of the perfomed request * * @return self */ @@ -355,7 +354,7 @@ public function getAnswerCode() /** * Sets answerCode * - * @param string $answerCode HTTP response code. + * @param string $answerCode HTTP response code * * @return self */ @@ -427,7 +426,7 @@ public function getUrl() /** * Sets url * - * @param string $url Request URL. + * @param string $url request URL * * @return self */ @@ -451,7 +450,7 @@ public function getIp() /** * Sets ip * - * @param string $ip IP of the client which perfomed the request. + * @param string $ip IP of the client which perfomed the request * * @return self */ @@ -475,7 +474,7 @@ public function getQueryHeaders() /** * Sets queryHeaders * - * @param string $queryHeaders Request Headers (API Key is obfuscated). + * @param string $queryHeaders request Headers (API Key is obfuscated) * * @return self */ @@ -499,7 +498,7 @@ public function getSha1() /** * Sets sha1 * - * @param string $sha1 SHA1 signature of the log entry. + * @param string $sha1 SHA1 signature of the log entry * * @return self */ @@ -523,7 +522,7 @@ public function getNbApiCalls() /** * Sets nbApiCalls * - * @param string $nbApiCalls Number of API calls. + * @param string $nbApiCalls number of API calls * * @return self */ @@ -571,7 +570,7 @@ public function getIndex() /** * Sets index * - * @param string|null $index Index targeted by the query. + * @param string|null $index index targeted by the query * * @return self */ @@ -595,7 +594,7 @@ public function getQueryParams() /** * Sets queryParams * - * @param string|null $queryParams Query parameters sent with the request. + * @param string|null $queryParams query parameters sent with the request * * @return self */ @@ -619,7 +618,7 @@ public function getQueryNbHits() /** * Sets queryNbHits * - * @param string|null $queryNbHits Number of hits returned for the query. + * @param string|null $queryNbHits number of hits returned for the query * * @return self */ @@ -643,7 +642,7 @@ public function getInnerQueries() /** * Sets innerQueries * - * @param \Algolia\AlgoliaSearch\Model\GetLogsResponseInnerQueries[]|null $innerQueries Array of all performed queries for the given request. + * @param \Algolia\AlgoliaSearch\Model\GetLogsResponseInnerQueries[]|null $innerQueries array of all performed queries for the given request * * @return self */ @@ -656,9 +655,9 @@ public function setInnerQueries($innerQueries) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -668,7 +667,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -697,7 +696,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -708,14 +707,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -742,4 +742,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php b/clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php index 7e4184184d..4db95782ef 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php +++ b/clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * GetObjectsObject Class Doc Comment * * @category Class * @description The `getObjects` requests. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -32,7 +33,7 @@ class GetObjectsObject implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'requests' => '\Algolia\AlgoliaSearch\Model\MultipleGetObjectsObject[]' + 'requests' => '\Algolia\AlgoliaSearch\Model\MultipleGetObjectsObject[]', ]; /** @@ -43,7 +44,7 @@ class GetObjectsObject implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'requests' => null + 'requests' => null, ]; /** @@ -73,7 +74,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'requests' => 'requests' + 'requests' => 'requests', ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'requests' => 'setRequests' + 'requests' => 'setRequests', ]; /** @@ -91,7 +92,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'requests' => 'getRequests' + 'requests' => 'getRequests', ]; /** @@ -135,7 +136,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -177,7 +177,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets requests * @@ -204,9 +203,9 @@ public function setRequests($requests) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -216,7 +215,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -245,7 +244,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -256,14 +255,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -290,4 +290,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php index 3e54417691..27c7531669 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * GetObjectsResponse Class Doc Comment @@ -31,7 +31,7 @@ class GetObjectsResponse implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'results' => 'object[]' + 'results' => 'object[]', ]; /** @@ -42,7 +42,7 @@ class GetObjectsResponse implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'results' => null + 'results' => null, ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'results' => 'results' + 'results' => 'results', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'results' => 'setResults' + 'results' => 'setResults', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'results' => 'getResults' + 'results' => 'getResults', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -176,7 +175,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets results * @@ -190,7 +188,7 @@ public function getResults() /** * Sets results * - * @param object[]|null $results List of results fetched. + * @param object[]|null $results list of results fetched * * @return self */ @@ -203,9 +201,9 @@ public function setResults($results) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -215,7 +213,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -244,7 +242,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -255,14 +253,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -289,4 +288,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/GetTaskResponse.php b/clients/algoliasearch-client-php/lib/Model/GetTaskResponse.php index 5f11816c35..b46ddac49f 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetTaskResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/GetTaskResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * GetTaskResponse Class Doc Comment @@ -31,7 +31,7 @@ class GetTaskResponse implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'status' => 'string' + 'status' => 'string', ]; /** @@ -42,7 +42,7 @@ class GetTaskResponse implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'status' => null + 'status' => null, ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'status' => 'status' + 'status' => 'status', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'status' => 'setStatus' + 'status' => 'setStatus', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'status' => 'getStatus' + 'status' => 'getStatus', ]; /** @@ -203,7 +203,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets status * @@ -240,9 +239,9 @@ public function setStatus($status) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -252,7 +251,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -281,7 +280,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -292,14 +291,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -326,4 +326,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopUserIdsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetTopUserIdsResponse.php index 138d5abf2f..fd18eb3cea 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetTopUserIdsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/GetTopUserIdsResponse.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * GetTopUserIdsResponse Class Doc Comment * * @category Class * @description Array of userIDs and clusters. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -32,7 +33,7 @@ class GetTopUserIdsResponse implements ModelInterface, ArrayAccess, \JsonSeriali * @var string[] */ protected static $openAPITypes = [ - 'topUsers' => 'array[]' + 'topUsers' => 'array[]', ]; /** @@ -43,7 +44,7 @@ class GetTopUserIdsResponse implements ModelInterface, ArrayAccess, \JsonSeriali * @psalm-var array */ protected static $openAPIFormats = [ - 'topUsers' => null + 'topUsers' => null, ]; /** @@ -73,7 +74,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'topUsers' => 'topUsers' + 'topUsers' => 'topUsers', ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'topUsers' => 'setTopUsers' + 'topUsers' => 'setTopUsers', ]; /** @@ -91,7 +92,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'topUsers' => 'getTopUsers' + 'topUsers' => 'getTopUsers', ]; /** @@ -135,7 +136,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -166,6 +166,7 @@ public function listInvalidProperties() if ($this->container['topUsers'] === null) { $invalidProperties[] = "'topUsers' can't be null"; } + return $invalidProperties; } @@ -180,7 +181,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets topUsers * @@ -194,7 +194,7 @@ public function getTopUsers() /** * Sets topUsers * - * @param array[] $topUsers Mapping of cluster names to top users. + * @param array[] $topUsers Mapping of cluster names to top users * * @return self */ @@ -207,9 +207,9 @@ public function setTopUsers($topUsers) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -219,7 +219,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -248,7 +248,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -259,14 +259,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -293,4 +294,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/HighlightResult.php b/clients/algoliasearch-client-php/lib/Model/HighlightResult.php index 129b4740ed..2fb9d53ddb 100644 --- a/clients/algoliasearch-client-php/lib/Model/HighlightResult.php +++ b/clients/algoliasearch-client-php/lib/Model/HighlightResult.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * HighlightResult Class Doc Comment * * @category Class * @description Highlighted attributes. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -35,7 +36,7 @@ class HighlightResult implements ModelInterface, ArrayAccess, \JsonSerializable 'value' => 'string', 'matchLevel' => 'string', 'matchedWords' => 'string[]', - 'fullyHighlighted' => 'bool' + 'fullyHighlighted' => 'bool', ]; /** @@ -49,7 +50,7 @@ class HighlightResult implements ModelInterface, ArrayAccess, \JsonSerializable 'value' => null, 'matchLevel' => null, 'matchedWords' => null, - 'fullyHighlighted' => null + 'fullyHighlighted' => null, ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() 'value' => 'value', 'matchLevel' => 'matchLevel', 'matchedWords' => 'matchedWords', - 'fullyHighlighted' => 'fullyHighlighted' + 'fullyHighlighted' => 'fullyHighlighted', ]; /** @@ -94,7 +95,7 @@ public static function openAPIFormats() 'value' => 'setValue', 'matchLevel' => 'setMatchLevel', 'matchedWords' => 'setMatchedWords', - 'fullyHighlighted' => 'setFullyHighlighted' + 'fullyHighlighted' => 'setFullyHighlighted', ]; /** @@ -106,7 +107,7 @@ public static function openAPIFormats() 'value' => 'getValue', 'matchLevel' => 'getMatchLevel', 'matchedWords' => 'getMatchedWords', - 'fullyHighlighted' => 'getFullyHighlighted' + 'fullyHighlighted' => 'getFullyHighlighted', ]; /** @@ -221,7 +222,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets value * @@ -235,7 +235,7 @@ public function getValue() /** * Sets value * - * @param string|null $value Markup text with occurrences highlighted. + * @param string|null $value markup text with occurrences highlighted * * @return self */ @@ -259,7 +259,7 @@ public function getMatchLevel() /** * Sets matchLevel * - * @param string|null $matchLevel Indicates how well the attribute matched the search query. + * @param string|null $matchLevel indicates how well the attribute matched the search query * * @return self */ @@ -293,7 +293,7 @@ public function getMatchedWords() /** * Sets matchedWords * - * @param string[]|null $matchedWords List of words from the query that matched the object. + * @param string[]|null $matchedWords list of words from the query that matched the object * * @return self */ @@ -317,7 +317,7 @@ public function getFullyHighlighted() /** * Sets fullyHighlighted * - * @param bool|null $fullyHighlighted Whether the entire attribute value is highlighted. + * @param bool|null $fullyHighlighted whether the entire attribute value is highlighted * * @return self */ @@ -330,9 +330,9 @@ public function setFullyHighlighted($fullyHighlighted) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -342,7 +342,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -371,7 +371,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -382,14 +382,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -416,4 +417,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/Index.php b/clients/algoliasearch-client-php/lib/Model/Index.php index 03a2871dcd..94651a0e9b 100644 --- a/clients/algoliasearch-client-php/lib/Model/Index.php +++ b/clients/algoliasearch-client-php/lib/Model/Index.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * Index Class Doc Comment @@ -41,7 +41,7 @@ class Index implements ModelInterface, ArrayAccess, \JsonSerializable 'numberOfPendingTask' => 'int', 'pendingTask' => 'bool', 'primary' => 'string', - 'replicas' => 'string[]' + 'replicas' => 'string[]', ]; /** @@ -62,7 +62,7 @@ class Index implements ModelInterface, ArrayAccess, \JsonSerializable 'numberOfPendingTask' => null, 'pendingTask' => null, 'primary' => null, - 'replicas' => null + 'replicas' => null, ]; /** @@ -102,7 +102,7 @@ public static function openAPIFormats() 'numberOfPendingTask' => 'numberOfPendingTask', 'pendingTask' => 'pendingTask', 'primary' => 'primary', - 'replicas' => 'replicas' + 'replicas' => 'replicas', ]; /** @@ -121,7 +121,7 @@ public static function openAPIFormats() 'numberOfPendingTask' => 'setNumberOfPendingTask', 'pendingTask' => 'setPendingTask', 'primary' => 'setPrimary', - 'replicas' => 'setReplicas' + 'replicas' => 'setReplicas', ]; /** @@ -140,7 +140,7 @@ public static function openAPIFormats() 'numberOfPendingTask' => 'getNumberOfPendingTask', 'pendingTask' => 'getPendingTask', 'primary' => 'getPrimary', - 'replicas' => 'getReplicas' + 'replicas' => 'getReplicas', ]; /** @@ -184,7 +184,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -246,6 +245,7 @@ public function listInvalidProperties() if ($this->container['pendingTask'] === null) { $invalidProperties[] = "'pendingTask' can't be null"; } + return $invalidProperties; } @@ -260,7 +260,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -274,7 +273,7 @@ public function getName() /** * Sets name * - * @param string $name Index name. + * @param string $name index name * * @return self */ @@ -322,7 +321,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime $updatedAt Date of last update (ISO-8601 format). + * @param \DateTime $updatedAt date of last update (ISO-8601 format) * * @return self */ @@ -346,7 +345,7 @@ public function getEntries() /** * Sets entries * - * @param int $entries Number of records contained in the index. + * @param int $entries number of records contained in the index * * @return self */ @@ -370,7 +369,7 @@ public function getDataSize() /** * Sets dataSize * - * @param int $dataSize Number of bytes of the index in minified format. + * @param int $dataSize number of bytes of the index in minified format * * @return self */ @@ -394,7 +393,7 @@ public function getFileSize() /** * Sets fileSize * - * @param int $fileSize Number of bytes of the index binary file. + * @param int $fileSize number of bytes of the index binary file * * @return self */ @@ -527,9 +526,9 @@ public function setReplicas($replicas) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -539,7 +538,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -568,7 +567,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -579,14 +578,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -613,4 +613,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/IndexSettings.php b/clients/algoliasearch-client-php/lib/Model/IndexSettings.php index 01ea27278c..66c7494b07 100644 --- a/clients/algoliasearch-client-php/lib/Model/IndexSettings.php +++ b/clients/algoliasearch-client-php/lib/Model/IndexSettings.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * IndexSettings Class Doc Comment * * @category Class * @description The Algolia index settings. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -87,7 +88,7 @@ class IndexSettings implements ModelInterface, ArrayAccess, \JsonSerializable 'responseFields' => 'string[]', 'maxFacetHits' => 'int', 'attributeCriteriaComputedByMinProximity' => 'bool', - 'renderingContent' => 'object' + 'renderingContent' => 'object', ]; /** @@ -153,7 +154,7 @@ class IndexSettings implements ModelInterface, ArrayAccess, \JsonSerializable 'responseFields' => null, 'maxFacetHits' => null, 'attributeCriteriaComputedByMinProximity' => null, - 'renderingContent' => null + 'renderingContent' => null, ]; /** @@ -238,7 +239,7 @@ public static function openAPIFormats() 'responseFields' => 'responseFields', 'maxFacetHits' => 'maxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', - 'renderingContent' => 'renderingContent' + 'renderingContent' => 'renderingContent', ]; /** @@ -302,7 +303,7 @@ public static function openAPIFormats() 'responseFields' => 'setResponseFields', 'maxFacetHits' => 'setMaxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', - 'renderingContent' => 'setRenderingContent' + 'renderingContent' => 'setRenderingContent', ]; /** @@ -366,7 +367,7 @@ public static function openAPIFormats() 'responseFields' => 'getResponseFields', 'maxFacetHits' => 'getMaxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', - 'renderingContent' => 'getRenderingContent' + 'renderingContent' => 'getRenderingContent', ]; /** @@ -667,7 +668,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets replicas * @@ -681,7 +681,7 @@ public function getReplicas() /** * Sets replicas * - * @param string[]|null $replicas Creates replicas, exact copies of an index. + * @param string[]|null $replicas creates replicas, exact copies of an index * * @return self */ @@ -705,7 +705,7 @@ public function getPaginationLimitedTo() /** * Sets paginationLimitedTo * - * @param int|null $paginationLimitedTo Set the maximum number of hits accessible via pagination. + * @param int|null $paginationLimitedTo set the maximum number of hits accessible via pagination * * @return self */ @@ -729,7 +729,7 @@ public function getDisableTypoToleranceOnWords() /** * Sets disableTypoToleranceOnWords * - * @param string[]|null $disableTypoToleranceOnWords A list of words for which you want to turn off typo tolerance. + * @param string[]|null $disableTypoToleranceOnWords a list of words for which you want to turn off typo tolerance * * @return self */ @@ -753,7 +753,7 @@ public function getAttributesToTransliterate() /** * Sets attributesToTransliterate * - * @param string[]|null $attributesToTransliterate Specify on which attributes to apply transliteration. + * @param string[]|null $attributesToTransliterate specify on which attributes to apply transliteration * * @return self */ @@ -777,7 +777,7 @@ public function getCamelCaseAttributes() /** * Sets camelCaseAttributes * - * @param string[]|null $camelCaseAttributes List of attributes on which to do a decomposition of camel case words. + * @param string[]|null $camelCaseAttributes list of attributes on which to do a decomposition of camel case words * * @return self */ @@ -801,7 +801,7 @@ public function getDecompoundedAttributes() /** * Sets decompoundedAttributes * - * @param object|null $decompoundedAttributes Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding. + * @param object|null $decompoundedAttributes specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding * * @return self */ @@ -825,7 +825,7 @@ public function getIndexLanguages() /** * Sets indexLanguages * - * @param string[]|null $indexLanguages Sets the languages at the index level for language-specific processing such as tokenization and normalization. + * @param string[]|null $indexLanguages sets the languages at the index level for language-specific processing such as tokenization and normalization * * @return self */ @@ -849,7 +849,7 @@ public function getFilterPromotes() /** * Sets filterPromotes * - * @param bool|null $filterPromotes Whether promoted results should match the filters of the current search, except for geographic filters. + * @param bool|null $filterPromotes whether promoted results should match the filters of the current search, except for geographic filters * * @return self */ @@ -873,7 +873,7 @@ public function getDisablePrefixOnAttributes() /** * Sets disablePrefixOnAttributes * - * @param string[]|null $disablePrefixOnAttributes List of attributes on which you want to disable prefix matching. + * @param string[]|null $disablePrefixOnAttributes list of attributes on which you want to disable prefix matching * * @return self */ @@ -897,7 +897,7 @@ public function getAllowCompressionOfIntegerArray() /** * Sets allowCompressionOfIntegerArray * - * @param bool|null $allowCompressionOfIntegerArray Enables compression of large integer arrays. + * @param bool|null $allowCompressionOfIntegerArray enables compression of large integer arrays * * @return self */ @@ -921,7 +921,7 @@ public function getNumericAttributesForFiltering() /** * Sets numericAttributesForFiltering * - * @param string[]|null $numericAttributesForFiltering List of numeric attributes that can be used as numerical filters. + * @param string[]|null $numericAttributesForFiltering list of numeric attributes that can be used as numerical filters * * @return self */ @@ -945,7 +945,7 @@ public function getUserData() /** * Sets userData * - * @param object|null $userData Lets you store custom data in your indices. + * @param object|null $userData lets you store custom data in your indices * * @return self */ @@ -969,7 +969,7 @@ public function getSearchableAttributes() /** * Sets searchableAttributes * - * @param string[]|null $searchableAttributes The complete list of attributes used for searching. + * @param string[]|null $searchableAttributes the complete list of attributes used for searching * * @return self */ @@ -993,7 +993,7 @@ public function getAttributesForFaceting() /** * Sets attributesForFaceting * - * @param string[]|null $attributesForFaceting The complete list of attributes that will be used for faceting. + * @param string[]|null $attributesForFaceting the complete list of attributes that will be used for faceting * * @return self */ @@ -1017,7 +1017,7 @@ public function getUnretrievableAttributes() /** * Sets unretrievableAttributes * - * @param string[]|null $unretrievableAttributes List of attributes that can't be retrieved at query time. + * @param string[]|null $unretrievableAttributes list of attributes that can't be retrieved at query time * * @return self */ @@ -1041,7 +1041,7 @@ public function getAttributesToRetrieve() /** * Sets attributesToRetrieve * - * @param string[]|null $attributesToRetrieve This parameter controls which attributes to retrieve and which not to retrieve. + * @param string[]|null $attributesToRetrieve this parameter controls which attributes to retrieve and which not to retrieve * * @return self */ @@ -1065,7 +1065,7 @@ public function getRestrictSearchableAttributes() /** * Sets restrictSearchableAttributes * - * @param string[]|null $restrictSearchableAttributes Restricts a given query to look in only a subset of your searchable attributes. + * @param string[]|null $restrictSearchableAttributes restricts a given query to look in only a subset of your searchable attributes * * @return self */ @@ -1089,7 +1089,7 @@ public function getRanking() /** * Sets ranking * - * @param string[]|null $ranking Controls how Algolia should sort your results. + * @param string[]|null $ranking controls how Algolia should sort your results * * @return self */ @@ -1113,7 +1113,7 @@ public function getCustomRanking() /** * Sets customRanking * - * @param string[]|null $customRanking Specifies the custom ranking criterion. + * @param string[]|null $customRanking specifies the custom ranking criterion * * @return self */ @@ -1137,7 +1137,7 @@ public function getRelevancyStrictness() /** * Sets relevancyStrictness * - * @param int|null $relevancyStrictness Controls the relevancy threshold below which less relevant results aren't included in the results. + * @param int|null $relevancyStrictness controls the relevancy threshold below which less relevant results aren't included in the results * * @return self */ @@ -1161,7 +1161,7 @@ public function getAttributesToHighlight() /** * Sets attributesToHighlight * - * @param string[]|null $attributesToHighlight List of attributes to highlight. + * @param string[]|null $attributesToHighlight list of attributes to highlight * * @return self */ @@ -1185,7 +1185,7 @@ public function getAttributesToSnippet() /** * Sets attributesToSnippet * - * @param string[]|null $attributesToSnippet List of attributes to snippet, with an optional maximum number of words to snippet. + * @param string[]|null $attributesToSnippet list of attributes to snippet, with an optional maximum number of words to snippet * * @return self */ @@ -1209,7 +1209,7 @@ public function getHighlightPreTag() /** * Sets highlightPreTag * - * @param string|null $highlightPreTag The HTML string to insert before the highlighted parts in all highlight and snippet results. + * @param string|null $highlightPreTag the HTML string to insert before the highlighted parts in all highlight and snippet results * * @return self */ @@ -1233,7 +1233,7 @@ public function getHighlightPostTag() /** * Sets highlightPostTag * - * @param string|null $highlightPostTag The HTML string to insert after the highlighted parts in all highlight and snippet results. + * @param string|null $highlightPostTag the HTML string to insert after the highlighted parts in all highlight and snippet results * * @return self */ @@ -1257,7 +1257,7 @@ public function getSnippetEllipsisText() /** * Sets snippetEllipsisText * - * @param string|null $snippetEllipsisText String used as an ellipsis indicator when a snippet is truncated. + * @param string|null $snippetEllipsisText string used as an ellipsis indicator when a snippet is truncated * * @return self */ @@ -1281,7 +1281,7 @@ public function getRestrictHighlightAndSnippetArrays() /** * Sets restrictHighlightAndSnippetArrays * - * @param bool|null $restrictHighlightAndSnippetArrays Restrict highlighting and snippeting to items that matched the query. + * @param bool|null $restrictHighlightAndSnippetArrays restrict highlighting and snippeting to items that matched the query * * @return self */ @@ -1305,7 +1305,7 @@ public function getHitsPerPage() /** * Sets hitsPerPage * - * @param int|null $hitsPerPage Set the number of hits per page. + * @param int|null $hitsPerPage set the number of hits per page * * @return self */ @@ -1329,7 +1329,7 @@ public function getMinWordSizefor1Typo() /** * Sets minWordSizefor1Typo * - * @param int|null $minWordSizefor1Typo Minimum number of characters a word in the query string must contain to accept matches with 1 typo. + * @param int|null $minWordSizefor1Typo minimum number of characters a word in the query string must contain to accept matches with 1 typo * * @return self */ @@ -1353,7 +1353,7 @@ public function getMinWordSizefor2Typos() /** * Sets minWordSizefor2Typos * - * @param int|null $minWordSizefor2Typos Minimum number of characters a word in the query string must contain to accept matches with 2 typos. + * @param int|null $minWordSizefor2Typos minimum number of characters a word in the query string must contain to accept matches with 2 typos * * @return self */ @@ -1377,7 +1377,7 @@ public function getTypoTolerance() /** * Sets typoTolerance * - * @param string|null $typoTolerance Controls whether typo tolerance is enabled and how it is applied. + * @param string|null $typoTolerance controls whether typo tolerance is enabled and how it is applied * * @return self */ @@ -1411,7 +1411,7 @@ public function getAllowTyposOnNumericTokens() /** * Sets allowTyposOnNumericTokens * - * @param bool|null $allowTyposOnNumericTokens Whether to allow typos on numbers (\"numeric tokens\") in the query string. + * @param bool|null $allowTyposOnNumericTokens whether to allow typos on numbers (\"numeric tokens\") in the query string * * @return self */ @@ -1435,7 +1435,7 @@ public function getDisableTypoToleranceOnAttributes() /** * Sets disableTypoToleranceOnAttributes * - * @param string[]|null $disableTypoToleranceOnAttributes List of attributes on which you want to disable typo tolerance. + * @param string[]|null $disableTypoToleranceOnAttributes list of attributes on which you want to disable typo tolerance * * @return self */ @@ -1459,7 +1459,7 @@ public function getSeparatorsToIndex() /** * Sets separatorsToIndex * - * @param string|null $separatorsToIndex Control which separators are indexed. + * @param string|null $separatorsToIndex control which separators are indexed * * @return self */ @@ -1483,7 +1483,7 @@ public function getIgnorePlurals() /** * Sets ignorePlurals * - * @param string|null $ignorePlurals Treats singular, plurals, and other forms of declensions as matching terms. + * @param string|null $ignorePlurals treats singular, plurals, and other forms of declensions as matching terms * * @return self */ @@ -1507,7 +1507,7 @@ public function getRemoveStopWords() /** * Sets removeStopWords * - * @param string|null $removeStopWords Removes stop (common) words from the query before executing it. + * @param string|null $removeStopWords removes stop (common) words from the query before executing it * * @return self */ @@ -1531,7 +1531,7 @@ public function getKeepDiacriticsOnCharacters() /** * Sets keepDiacriticsOnCharacters * - * @param string|null $keepDiacriticsOnCharacters List of characters that the engine shouldn't automatically normalize. + * @param string|null $keepDiacriticsOnCharacters list of characters that the engine shouldn't automatically normalize * * @return self */ @@ -1555,7 +1555,7 @@ public function getQueryLanguages() /** * Sets queryLanguages * - * @param string[]|null $queryLanguages Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. + * @param string[]|null $queryLanguages sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection * * @return self */ @@ -1579,7 +1579,7 @@ public function getDecompoundQuery() /** * Sets decompoundQuery * - * @param bool|null $decompoundQuery Splits compound words into their composing atoms in the query. + * @param bool|null $decompoundQuery splits compound words into their composing atoms in the query * * @return self */ @@ -1603,7 +1603,7 @@ public function getEnableRules() /** * Sets enableRules * - * @param bool|null $enableRules Whether Rules should be globally enabled. + * @param bool|null $enableRules whether Rules should be globally enabled * * @return self */ @@ -1627,7 +1627,7 @@ public function getEnablePersonalization() /** * Sets enablePersonalization * - * @param bool|null $enablePersonalization Enable the Personalization feature. + * @param bool|null $enablePersonalization enable the Personalization feature * * @return self */ @@ -1651,7 +1651,7 @@ public function getQueryType() /** * Sets queryType * - * @param string|null $queryType Controls if and how query words are interpreted as prefixes. + * @param string|null $queryType controls if and how query words are interpreted as prefixes * * @return self */ @@ -1685,7 +1685,7 @@ public function getRemoveWordsIfNoResults() /** * Sets removeWordsIfNoResults * - * @param string|null $removeWordsIfNoResults Selects a strategy to remove words from the query when it doesn't match any hits. + * @param string|null $removeWordsIfNoResults selects a strategy to remove words from the query when it doesn't match any hits * * @return self */ @@ -1719,7 +1719,7 @@ public function getAdvancedSyntax() /** * Sets advancedSyntax * - * @param bool|null $advancedSyntax Enables the advanced query syntax. + * @param bool|null $advancedSyntax enables the advanced query syntax * * @return self */ @@ -1743,7 +1743,7 @@ public function getOptionalWords() /** * Sets optionalWords * - * @param string[]|null $optionalWords A list of words that should be considered as optional when found in the query. + * @param string[]|null $optionalWords a list of words that should be considered as optional when found in the query * * @return self */ @@ -1767,7 +1767,7 @@ public function getDisableExactOnAttributes() /** * Sets disableExactOnAttributes * - * @param string[]|null $disableExactOnAttributes List of attributes on which you want to disable the exact ranking criterion. + * @param string[]|null $disableExactOnAttributes list of attributes on which you want to disable the exact ranking criterion * * @return self */ @@ -1791,7 +1791,7 @@ public function getExactOnSingleWordQuery() /** * Sets exactOnSingleWordQuery * - * @param string|null $exactOnSingleWordQuery Controls how the exact ranking criterion is computed when the query contains only one word. + * @param string|null $exactOnSingleWordQuery controls how the exact ranking criterion is computed when the query contains only one word * * @return self */ @@ -1825,7 +1825,7 @@ public function getAlternativesAsExact() /** * Sets alternativesAsExact * - * @param string[]|null $alternativesAsExact List of alternatives that should be considered an exact match by the exact ranking criterion. + * @param string[]|null $alternativesAsExact list of alternatives that should be considered an exact match by the exact ranking criterion * * @return self */ @@ -1858,7 +1858,7 @@ public function getAdvancedSyntaxFeatures() /** * Sets advancedSyntaxFeatures * - * @param string[]|null $advancedSyntaxFeatures Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. + * @param string[]|null $advancedSyntaxFeatures allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled * * @return self */ @@ -1891,13 +1891,12 @@ public function getDistinct() /** * Sets distinct * - * @param int|null $distinct Enables de-duplication or grouping of results. + * @param int|null $distinct enables de-duplication or grouping of results * * @return self */ public function setDistinct($distinct) { - if (!is_null($distinct) && ($distinct > 4)) { throw new \InvalidArgumentException('invalid value for $distinct when calling IndexSettings., must be smaller than or equal to 4.'); } @@ -1923,7 +1922,7 @@ public function getSynonyms() /** * Sets synonyms * - * @param bool|null $synonyms Whether to take into account an index's synonyms for a particular search. + * @param bool|null $synonyms whether to take into account an index's synonyms for a particular search * * @return self */ @@ -1947,7 +1946,7 @@ public function getReplaceSynonymsInHighlight() /** * Sets replaceSynonymsInHighlight * - * @param bool|null $replaceSynonymsInHighlight Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + * @param bool|null $replaceSynonymsInHighlight whether to highlight and snippet the original word that matches the synonym or the synonym itself * * @return self */ @@ -1971,13 +1970,12 @@ public function getMinProximity() /** * Sets minProximity * - * @param int|null $minProximity Precision of the proximity ranking criterion. + * @param int|null $minProximity precision of the proximity ranking criterion * * @return self */ public function setMinProximity($minProximity) { - if (!is_null($minProximity) && ($minProximity > 7)) { throw new \InvalidArgumentException('invalid value for $minProximity when calling IndexSettings., must be smaller than or equal to 7.'); } @@ -2033,7 +2031,6 @@ public function getMaxFacetHits() */ public function setMaxFacetHits($maxFacetHits) { - if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling IndexSettings., must be smaller than or equal to 100.'); } @@ -2056,7 +2053,7 @@ public function getAttributeCriteriaComputedByMinProximity() /** * Sets attributeCriteriaComputedByMinProximity * - * @param bool|null $attributeCriteriaComputedByMinProximity When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. + * @param bool|null $attributeCriteriaComputedByMinProximity when attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage * * @return self */ @@ -2093,9 +2090,9 @@ public function setRenderingContent($renderingContent) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -2105,7 +2102,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -2134,7 +2131,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -2145,14 +2142,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -2179,4 +2177,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/IndexSettingsAsSearchParams.php b/clients/algoliasearch-client-php/lib/Model/IndexSettingsAsSearchParams.php index 1672b402c3..a8431235b8 100644 --- a/clients/algoliasearch-client-php/lib/Model/IndexSettingsAsSearchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/IndexSettingsAsSearchParams.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * IndexSettingsAsSearchParams Class Doc Comment @@ -74,7 +74,7 @@ class IndexSettingsAsSearchParams implements ModelInterface, ArrayAccess, \JsonS 'responseFields' => 'string[]', 'maxFacetHits' => 'int', 'attributeCriteriaComputedByMinProximity' => 'bool', - 'renderingContent' => 'object' + 'renderingContent' => 'object', ]; /** @@ -128,7 +128,7 @@ class IndexSettingsAsSearchParams implements ModelInterface, ArrayAccess, \JsonS 'responseFields' => null, 'maxFacetHits' => null, 'attributeCriteriaComputedByMinProximity' => null, - 'renderingContent' => null + 'renderingContent' => null, ]; /** @@ -201,7 +201,7 @@ public static function openAPIFormats() 'responseFields' => 'responseFields', 'maxFacetHits' => 'maxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', - 'renderingContent' => 'renderingContent' + 'renderingContent' => 'renderingContent', ]; /** @@ -253,7 +253,7 @@ public static function openAPIFormats() 'responseFields' => 'setResponseFields', 'maxFacetHits' => 'setMaxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', - 'renderingContent' => 'setRenderingContent' + 'renderingContent' => 'setRenderingContent', ]; /** @@ -305,7 +305,7 @@ public static function openAPIFormats() 'responseFields' => 'getResponseFields', 'maxFacetHits' => 'getMaxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', - 'renderingContent' => 'getRenderingContent' + 'renderingContent' => 'getRenderingContent', ]; /** @@ -594,7 +594,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets searchableAttributes * @@ -608,7 +607,7 @@ public function getSearchableAttributes() /** * Sets searchableAttributes * - * @param string[]|null $searchableAttributes The complete list of attributes used for searching. + * @param string[]|null $searchableAttributes the complete list of attributes used for searching * * @return self */ @@ -632,7 +631,7 @@ public function getAttributesForFaceting() /** * Sets attributesForFaceting * - * @param string[]|null $attributesForFaceting The complete list of attributes that will be used for faceting. + * @param string[]|null $attributesForFaceting the complete list of attributes that will be used for faceting * * @return self */ @@ -656,7 +655,7 @@ public function getUnretrievableAttributes() /** * Sets unretrievableAttributes * - * @param string[]|null $unretrievableAttributes List of attributes that can't be retrieved at query time. + * @param string[]|null $unretrievableAttributes list of attributes that can't be retrieved at query time * * @return self */ @@ -680,7 +679,7 @@ public function getAttributesToRetrieve() /** * Sets attributesToRetrieve * - * @param string[]|null $attributesToRetrieve This parameter controls which attributes to retrieve and which not to retrieve. + * @param string[]|null $attributesToRetrieve this parameter controls which attributes to retrieve and which not to retrieve * * @return self */ @@ -704,7 +703,7 @@ public function getRestrictSearchableAttributes() /** * Sets restrictSearchableAttributes * - * @param string[]|null $restrictSearchableAttributes Restricts a given query to look in only a subset of your searchable attributes. + * @param string[]|null $restrictSearchableAttributes restricts a given query to look in only a subset of your searchable attributes * * @return self */ @@ -728,7 +727,7 @@ public function getRanking() /** * Sets ranking * - * @param string[]|null $ranking Controls how Algolia should sort your results. + * @param string[]|null $ranking controls how Algolia should sort your results * * @return self */ @@ -752,7 +751,7 @@ public function getCustomRanking() /** * Sets customRanking * - * @param string[]|null $customRanking Specifies the custom ranking criterion. + * @param string[]|null $customRanking specifies the custom ranking criterion * * @return self */ @@ -776,7 +775,7 @@ public function getRelevancyStrictness() /** * Sets relevancyStrictness * - * @param int|null $relevancyStrictness Controls the relevancy threshold below which less relevant results aren't included in the results. + * @param int|null $relevancyStrictness controls the relevancy threshold below which less relevant results aren't included in the results * * @return self */ @@ -800,7 +799,7 @@ public function getAttributesToHighlight() /** * Sets attributesToHighlight * - * @param string[]|null $attributesToHighlight List of attributes to highlight. + * @param string[]|null $attributesToHighlight list of attributes to highlight * * @return self */ @@ -824,7 +823,7 @@ public function getAttributesToSnippet() /** * Sets attributesToSnippet * - * @param string[]|null $attributesToSnippet List of attributes to snippet, with an optional maximum number of words to snippet. + * @param string[]|null $attributesToSnippet list of attributes to snippet, with an optional maximum number of words to snippet * * @return self */ @@ -848,7 +847,7 @@ public function getHighlightPreTag() /** * Sets highlightPreTag * - * @param string|null $highlightPreTag The HTML string to insert before the highlighted parts in all highlight and snippet results. + * @param string|null $highlightPreTag the HTML string to insert before the highlighted parts in all highlight and snippet results * * @return self */ @@ -872,7 +871,7 @@ public function getHighlightPostTag() /** * Sets highlightPostTag * - * @param string|null $highlightPostTag The HTML string to insert after the highlighted parts in all highlight and snippet results. + * @param string|null $highlightPostTag the HTML string to insert after the highlighted parts in all highlight and snippet results * * @return self */ @@ -896,7 +895,7 @@ public function getSnippetEllipsisText() /** * Sets snippetEllipsisText * - * @param string|null $snippetEllipsisText String used as an ellipsis indicator when a snippet is truncated. + * @param string|null $snippetEllipsisText string used as an ellipsis indicator when a snippet is truncated * * @return self */ @@ -920,7 +919,7 @@ public function getRestrictHighlightAndSnippetArrays() /** * Sets restrictHighlightAndSnippetArrays * - * @param bool|null $restrictHighlightAndSnippetArrays Restrict highlighting and snippeting to items that matched the query. + * @param bool|null $restrictHighlightAndSnippetArrays restrict highlighting and snippeting to items that matched the query * * @return self */ @@ -944,7 +943,7 @@ public function getHitsPerPage() /** * Sets hitsPerPage * - * @param int|null $hitsPerPage Set the number of hits per page. + * @param int|null $hitsPerPage set the number of hits per page * * @return self */ @@ -968,7 +967,7 @@ public function getMinWordSizefor1Typo() /** * Sets minWordSizefor1Typo * - * @param int|null $minWordSizefor1Typo Minimum number of characters a word in the query string must contain to accept matches with 1 typo. + * @param int|null $minWordSizefor1Typo minimum number of characters a word in the query string must contain to accept matches with 1 typo * * @return self */ @@ -992,7 +991,7 @@ public function getMinWordSizefor2Typos() /** * Sets minWordSizefor2Typos * - * @param int|null $minWordSizefor2Typos Minimum number of characters a word in the query string must contain to accept matches with 2 typos. + * @param int|null $minWordSizefor2Typos minimum number of characters a word in the query string must contain to accept matches with 2 typos * * @return self */ @@ -1016,7 +1015,7 @@ public function getTypoTolerance() /** * Sets typoTolerance * - * @param string|null $typoTolerance Controls whether typo tolerance is enabled and how it is applied. + * @param string|null $typoTolerance controls whether typo tolerance is enabled and how it is applied * * @return self */ @@ -1050,7 +1049,7 @@ public function getAllowTyposOnNumericTokens() /** * Sets allowTyposOnNumericTokens * - * @param bool|null $allowTyposOnNumericTokens Whether to allow typos on numbers (\"numeric tokens\") in the query string. + * @param bool|null $allowTyposOnNumericTokens whether to allow typos on numbers (\"numeric tokens\") in the query string * * @return self */ @@ -1074,7 +1073,7 @@ public function getDisableTypoToleranceOnAttributes() /** * Sets disableTypoToleranceOnAttributes * - * @param string[]|null $disableTypoToleranceOnAttributes List of attributes on which you want to disable typo tolerance. + * @param string[]|null $disableTypoToleranceOnAttributes list of attributes on which you want to disable typo tolerance * * @return self */ @@ -1098,7 +1097,7 @@ public function getSeparatorsToIndex() /** * Sets separatorsToIndex * - * @param string|null $separatorsToIndex Control which separators are indexed. + * @param string|null $separatorsToIndex control which separators are indexed * * @return self */ @@ -1122,7 +1121,7 @@ public function getIgnorePlurals() /** * Sets ignorePlurals * - * @param string|null $ignorePlurals Treats singular, plurals, and other forms of declensions as matching terms. + * @param string|null $ignorePlurals treats singular, plurals, and other forms of declensions as matching terms * * @return self */ @@ -1146,7 +1145,7 @@ public function getRemoveStopWords() /** * Sets removeStopWords * - * @param string|null $removeStopWords Removes stop (common) words from the query before executing it. + * @param string|null $removeStopWords removes stop (common) words from the query before executing it * * @return self */ @@ -1170,7 +1169,7 @@ public function getKeepDiacriticsOnCharacters() /** * Sets keepDiacriticsOnCharacters * - * @param string|null $keepDiacriticsOnCharacters List of characters that the engine shouldn't automatically normalize. + * @param string|null $keepDiacriticsOnCharacters list of characters that the engine shouldn't automatically normalize * * @return self */ @@ -1194,7 +1193,7 @@ public function getQueryLanguages() /** * Sets queryLanguages * - * @param string[]|null $queryLanguages Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. + * @param string[]|null $queryLanguages sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection * * @return self */ @@ -1218,7 +1217,7 @@ public function getDecompoundQuery() /** * Sets decompoundQuery * - * @param bool|null $decompoundQuery Splits compound words into their composing atoms in the query. + * @param bool|null $decompoundQuery splits compound words into their composing atoms in the query * * @return self */ @@ -1242,7 +1241,7 @@ public function getEnableRules() /** * Sets enableRules * - * @param bool|null $enableRules Whether Rules should be globally enabled. + * @param bool|null $enableRules whether Rules should be globally enabled * * @return self */ @@ -1266,7 +1265,7 @@ public function getEnablePersonalization() /** * Sets enablePersonalization * - * @param bool|null $enablePersonalization Enable the Personalization feature. + * @param bool|null $enablePersonalization enable the Personalization feature * * @return self */ @@ -1290,7 +1289,7 @@ public function getQueryType() /** * Sets queryType * - * @param string|null $queryType Controls if and how query words are interpreted as prefixes. + * @param string|null $queryType controls if and how query words are interpreted as prefixes * * @return self */ @@ -1324,7 +1323,7 @@ public function getRemoveWordsIfNoResults() /** * Sets removeWordsIfNoResults * - * @param string|null $removeWordsIfNoResults Selects a strategy to remove words from the query when it doesn't match any hits. + * @param string|null $removeWordsIfNoResults selects a strategy to remove words from the query when it doesn't match any hits * * @return self */ @@ -1358,7 +1357,7 @@ public function getAdvancedSyntax() /** * Sets advancedSyntax * - * @param bool|null $advancedSyntax Enables the advanced query syntax. + * @param bool|null $advancedSyntax enables the advanced query syntax * * @return self */ @@ -1382,7 +1381,7 @@ public function getOptionalWords() /** * Sets optionalWords * - * @param string[]|null $optionalWords A list of words that should be considered as optional when found in the query. + * @param string[]|null $optionalWords a list of words that should be considered as optional when found in the query * * @return self */ @@ -1406,7 +1405,7 @@ public function getDisableExactOnAttributes() /** * Sets disableExactOnAttributes * - * @param string[]|null $disableExactOnAttributes List of attributes on which you want to disable the exact ranking criterion. + * @param string[]|null $disableExactOnAttributes list of attributes on which you want to disable the exact ranking criterion * * @return self */ @@ -1430,7 +1429,7 @@ public function getExactOnSingleWordQuery() /** * Sets exactOnSingleWordQuery * - * @param string|null $exactOnSingleWordQuery Controls how the exact ranking criterion is computed when the query contains only one word. + * @param string|null $exactOnSingleWordQuery controls how the exact ranking criterion is computed when the query contains only one word * * @return self */ @@ -1464,7 +1463,7 @@ public function getAlternativesAsExact() /** * Sets alternativesAsExact * - * @param string[]|null $alternativesAsExact List of alternatives that should be considered an exact match by the exact ranking criterion. + * @param string[]|null $alternativesAsExact list of alternatives that should be considered an exact match by the exact ranking criterion * * @return self */ @@ -1497,7 +1496,7 @@ public function getAdvancedSyntaxFeatures() /** * Sets advancedSyntaxFeatures * - * @param string[]|null $advancedSyntaxFeatures Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. + * @param string[]|null $advancedSyntaxFeatures allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled * * @return self */ @@ -1530,13 +1529,12 @@ public function getDistinct() /** * Sets distinct * - * @param int|null $distinct Enables de-duplication or grouping of results. + * @param int|null $distinct enables de-duplication or grouping of results * * @return self */ public function setDistinct($distinct) { - if (!is_null($distinct) && ($distinct > 4)) { throw new \InvalidArgumentException('invalid value for $distinct when calling IndexSettingsAsSearchParams., must be smaller than or equal to 4.'); } @@ -1562,7 +1560,7 @@ public function getSynonyms() /** * Sets synonyms * - * @param bool|null $synonyms Whether to take into account an index's synonyms for a particular search. + * @param bool|null $synonyms whether to take into account an index's synonyms for a particular search * * @return self */ @@ -1586,7 +1584,7 @@ public function getReplaceSynonymsInHighlight() /** * Sets replaceSynonymsInHighlight * - * @param bool|null $replaceSynonymsInHighlight Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + * @param bool|null $replaceSynonymsInHighlight whether to highlight and snippet the original word that matches the synonym or the synonym itself * * @return self */ @@ -1610,13 +1608,12 @@ public function getMinProximity() /** * Sets minProximity * - * @param int|null $minProximity Precision of the proximity ranking criterion. + * @param int|null $minProximity precision of the proximity ranking criterion * * @return self */ public function setMinProximity($minProximity) { - if (!is_null($minProximity) && ($minProximity > 7)) { throw new \InvalidArgumentException('invalid value for $minProximity when calling IndexSettingsAsSearchParams., must be smaller than or equal to 7.'); } @@ -1672,7 +1669,6 @@ public function getMaxFacetHits() */ public function setMaxFacetHits($maxFacetHits) { - if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling IndexSettingsAsSearchParams., must be smaller than or equal to 100.'); } @@ -1695,7 +1691,7 @@ public function getAttributeCriteriaComputedByMinProximity() /** * Sets attributeCriteriaComputedByMinProximity * - * @param bool|null $attributeCriteriaComputedByMinProximity When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. + * @param bool|null $attributeCriteriaComputedByMinProximity when attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage * * @return self */ @@ -1732,9 +1728,9 @@ public function setRenderingContent($renderingContent) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -1744,7 +1740,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -1773,7 +1769,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -1784,14 +1780,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -1818,4 +1815,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/KeyObject.php b/clients/algoliasearch-client-php/lib/Model/KeyObject.php index 68429a2485..14b8aa70a7 100644 --- a/clients/algoliasearch-client-php/lib/Model/KeyObject.php +++ b/clients/algoliasearch-client-php/lib/Model/KeyObject.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * KeyObject Class Doc Comment @@ -39,7 +39,7 @@ class KeyObject implements ModelInterface, ArrayAccess, \JsonSerializable 'queryParameters' => 'string', 'referers' => 'string[]', 'validity' => 'int', - 'createdAt' => '\DateTime' + 'createdAt' => '\DateTime', ]; /** @@ -58,7 +58,7 @@ class KeyObject implements ModelInterface, ArrayAccess, \JsonSerializable 'queryParameters' => null, 'referers' => null, 'validity' => null, - 'createdAt' => 'date-time' + 'createdAt' => 'date-time', ]; /** @@ -96,7 +96,7 @@ public static function openAPIFormats() 'queryParameters' => 'queryParameters', 'referers' => 'referers', 'validity' => 'validity', - 'createdAt' => 'createdAt' + 'createdAt' => 'createdAt', ]; /** @@ -113,7 +113,7 @@ public static function openAPIFormats() 'queryParameters' => 'setQueryParameters', 'referers' => 'setReferers', 'validity' => 'setValidity', - 'createdAt' => 'setCreatedAt' + 'createdAt' => 'setCreatedAt', ]; /** @@ -130,7 +130,7 @@ public static function openAPIFormats() 'queryParameters' => 'getQueryParameters', 'referers' => 'getReferers', 'validity' => 'getValidity', - 'createdAt' => 'getCreatedAt' + 'createdAt' => 'getCreatedAt', ]; /** @@ -255,6 +255,7 @@ public function listInvalidProperties() if ($this->container['createdAt'] === null) { $invalidProperties[] = "'createdAt' can't be null"; } + return $invalidProperties; } @@ -269,7 +270,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets acl * @@ -283,7 +283,7 @@ public function getAcl() /** * Sets acl * - * @param string[] $acl Set of permissions associated with the key. + * @param string[] $acl set of permissions associated with the key * * @return self */ @@ -388,7 +388,7 @@ public function getMaxQueriesPerIPPerHour() /** * Sets maxQueriesPerIPPerHour * - * @param int|null $maxQueriesPerIPPerHour Maximum number of API calls per hour allowed from a given IP address or a user token. + * @param int|null $maxQueriesPerIPPerHour maximum number of API calls per hour allowed from a given IP address or a user token * * @return self */ @@ -484,7 +484,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param \DateTime $createdAt Date of creation (ISO-8601 format). + * @param \DateTime $createdAt date of creation (ISO-8601 format) * * @return self */ @@ -497,9 +497,9 @@ public function setCreatedAt($createdAt) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -509,7 +509,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -538,7 +538,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -549,14 +549,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -583,4 +584,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/Languages.php b/clients/algoliasearch-client-php/lib/Model/Languages.php index 373bef4ce2..22624b2f6f 100644 --- a/clients/algoliasearch-client-php/lib/Model/Languages.php +++ b/clients/algoliasearch-client-php/lib/Model/Languages.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * Languages Class Doc Comment * * @category Class * @description A dictionary language. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -34,7 +35,7 @@ class Languages implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'plurals' => '\Algolia\AlgoliaSearch\Model\DictionaryLanguage', 'stopwords' => '\Algolia\AlgoliaSearch\Model\DictionaryLanguage', - 'compounds' => '\Algolia\AlgoliaSearch\Model\DictionaryLanguage' + 'compounds' => '\Algolia\AlgoliaSearch\Model\DictionaryLanguage', ]; /** @@ -47,7 +48,7 @@ class Languages implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'plurals' => null, 'stopwords' => null, - 'compounds' => null + 'compounds' => null, ]; /** @@ -79,7 +80,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'plurals' => 'plurals', 'stopwords' => 'stopwords', - 'compounds' => 'compounds' + 'compounds' => 'compounds', ]; /** @@ -90,7 +91,7 @@ public static function openAPIFormats() protected static $setters = [ 'plurals' => 'setPlurals', 'stopwords' => 'setStopwords', - 'compounds' => 'setCompounds' + 'compounds' => 'setCompounds', ]; /** @@ -101,7 +102,7 @@ public static function openAPIFormats() protected static $getters = [ 'plurals' => 'getPlurals', 'stopwords' => 'getStopwords', - 'compounds' => 'getCompounds' + 'compounds' => 'getCompounds', ]; /** @@ -145,7 +146,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -184,6 +184,7 @@ public function listInvalidProperties() if ($this->container['compounds'] === null) { $invalidProperties[] = "'compounds' can't be null"; } + return $invalidProperties; } @@ -198,7 +199,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets plurals * @@ -273,9 +273,9 @@ public function setCompounds($compounds) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -285,7 +285,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -314,7 +314,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -325,14 +325,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -359,4 +360,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php b/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php index 6ffa69ff60..3bc9ce390c 100644 --- a/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * ListApiKeysResponse Class Doc Comment @@ -31,7 +31,7 @@ class ListApiKeysResponse implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'keys' => '\Algolia\AlgoliaSearch\Model\KeyObject[]' + 'keys' => '\Algolia\AlgoliaSearch\Model\KeyObject[]', ]; /** @@ -42,7 +42,7 @@ class ListApiKeysResponse implements ModelInterface, ArrayAccess, \JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ - 'keys' => null + 'keys' => null, ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'keys' => 'keys' + 'keys' => 'keys', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'keys' => 'setKeys' + 'keys' => 'setKeys', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'keys' => 'getKeys' + 'keys' => 'getKeys', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -165,6 +164,7 @@ public function listInvalidProperties() if ($this->container['keys'] === null) { $invalidProperties[] = "'keys' can't be null"; } + return $invalidProperties; } @@ -179,7 +179,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets keys * @@ -193,7 +192,7 @@ public function getKeys() /** * Sets keys * - * @param \Algolia\AlgoliaSearch\Model\KeyObject[] $keys List of api keys. + * @param \Algolia\AlgoliaSearch\Model\KeyObject[] $keys list of api keys * * @return self */ @@ -206,9 +205,9 @@ public function setKeys($keys) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -218,7 +217,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -247,7 +246,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -258,14 +257,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -292,4 +292,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php b/clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php index da37124416..9f47847915 100644 --- a/clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * ListClustersResponse Class Doc Comment * * @category Class * @description Array of clusters. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -32,7 +33,7 @@ class ListClustersResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'topUsers' => 'string[]' + 'topUsers' => 'string[]', ]; /** @@ -43,7 +44,7 @@ class ListClustersResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'topUsers' => null + 'topUsers' => null, ]; /** @@ -73,7 +74,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'topUsers' => 'topUsers' + 'topUsers' => 'topUsers', ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'topUsers' => 'setTopUsers' + 'topUsers' => 'setTopUsers', ]; /** @@ -91,7 +92,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'topUsers' => 'getTopUsers' + 'topUsers' => 'getTopUsers', ]; /** @@ -135,7 +136,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -166,6 +166,7 @@ public function listInvalidProperties() if ($this->container['topUsers'] === null) { $invalidProperties[] = "'topUsers' can't be null"; } + return $invalidProperties; } @@ -180,7 +181,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets topUsers * @@ -194,7 +194,7 @@ public function getTopUsers() /** * Sets topUsers * - * @param string[] $topUsers Mapping of cluster names to top users. + * @param string[] $topUsers mapping of cluster names to top users * * @return self */ @@ -207,9 +207,9 @@ public function setTopUsers($topUsers) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -219,7 +219,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -248,7 +248,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -259,14 +259,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -293,4 +294,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php b/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php index 2177f69f96..b6cc55b479 100644 --- a/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * ListIndicesResponse Class Doc Comment @@ -32,7 +32,7 @@ class ListIndicesResponse implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPITypes = [ 'items' => '\Algolia\AlgoliaSearch\Model\Index[]', - 'nbPages' => 'int' + 'nbPages' => 'int', ]; /** @@ -44,7 +44,7 @@ class ListIndicesResponse implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPIFormats = [ 'items' => null, - 'nbPages' => null + 'nbPages' => null, ]; /** @@ -75,7 +75,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'items' => 'items', - 'nbPages' => 'nbPages' + 'nbPages' => 'nbPages', ]; /** @@ -85,7 +85,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'items' => 'setItems', - 'nbPages' => 'setNbPages' + 'nbPages' => 'setNbPages', ]; /** @@ -95,7 +95,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'items' => 'getItems', - 'nbPages' => 'getNbPages' + 'nbPages' => 'getNbPages', ]; /** @@ -139,7 +139,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -182,7 +181,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets items * @@ -196,7 +194,7 @@ public function getItems() /** * Sets items * - * @param \Algolia\AlgoliaSearch\Model\Index[]|null $items List of the fetched indices. + * @param \Algolia\AlgoliaSearch\Model\Index[]|null $items list of the fetched indices * * @return self */ @@ -220,7 +218,7 @@ public function getNbPages() /** * Sets nbPages * - * @param int|null $nbPages Number of pages. + * @param int|null $nbPages number of pages * * @return self */ @@ -233,9 +231,9 @@ public function setNbPages($nbPages) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -245,7 +243,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -274,7 +272,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -285,14 +283,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -319,4 +318,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php b/clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php index 64b26c1d72..d26bb071df 100644 --- a/clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * ListUserIdsResponse Class Doc Comment * * @category Class * @description UserIDs data. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -32,7 +33,7 @@ class ListUserIdsResponse implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'userIDs' => '\Algolia\AlgoliaSearch\Model\UserId[]' + 'userIDs' => '\Algolia\AlgoliaSearch\Model\UserId[]', ]; /** @@ -43,7 +44,7 @@ class ListUserIdsResponse implements ModelInterface, ArrayAccess, \JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ - 'userIDs' => null + 'userIDs' => null, ]; /** @@ -73,7 +74,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'userIDs' => 'userIDs' + 'userIDs' => 'userIDs', ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'userIDs' => 'setUserIDs' + 'userIDs' => 'setUserIDs', ]; /** @@ -91,7 +92,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'userIDs' => 'getUserIDs' + 'userIDs' => 'getUserIDs', ]; /** @@ -135,7 +136,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -166,6 +166,7 @@ public function listInvalidProperties() if ($this->container['userIDs'] === null) { $invalidProperties[] = "'userIDs' can't be null"; } + return $invalidProperties; } @@ -180,7 +181,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets userIDs * @@ -194,7 +194,7 @@ public function getUserIDs() /** * Sets userIDs * - * @param \Algolia\AlgoliaSearch\Model\UserId[] $userIDs List of userIDs. + * @param \Algolia\AlgoliaSearch\Model\UserId[] $userIDs list of userIDs * * @return self */ @@ -207,9 +207,9 @@ public function setUserIDs($userIDs) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -219,7 +219,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -248,7 +248,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -259,14 +259,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -293,4 +294,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleBatchResponse.php b/clients/algoliasearch-client-php/lib/Model/MultipleBatchResponse.php index 605c71b9d8..9ae0fcc264 100644 --- a/clients/algoliasearch-client-php/lib/Model/MultipleBatchResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/MultipleBatchResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * MultipleBatchResponse Class Doc Comment @@ -32,7 +32,7 @@ class MultipleBatchResponse implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPITypes = [ 'taskID' => 'object', - 'objectIDs' => 'string[]' + 'objectIDs' => 'string[]', ]; /** @@ -44,7 +44,7 @@ class MultipleBatchResponse implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPIFormats = [ 'taskID' => null, - 'objectIDs' => null + 'objectIDs' => null, ]; /** @@ -75,7 +75,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'taskID' => 'taskID', - 'objectIDs' => 'objectIDs' + 'objectIDs' => 'objectIDs', ]; /** @@ -85,7 +85,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'taskID' => 'setTaskID', - 'objectIDs' => 'setObjectIDs' + 'objectIDs' => 'setObjectIDs', ]; /** @@ -95,7 +95,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'taskID' => 'getTaskID', - 'objectIDs' => 'getObjectIDs' + 'objectIDs' => 'getObjectIDs', ]; /** @@ -139,7 +139,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -182,7 +181,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets taskID * @@ -196,7 +194,7 @@ public function getTaskID() /** * Sets taskID * - * @param object|null $taskID List of tasksIDs per index. + * @param object|null $taskID list of tasksIDs per index * * @return self */ @@ -220,7 +218,7 @@ public function getObjectIDs() /** * Sets objectIDs * - * @param string[]|null $objectIDs List of objectID. + * @param string[]|null $objectIDs list of objectID * * @return self */ @@ -233,9 +231,9 @@ public function setObjectIDs($objectIDs) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -245,7 +243,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -274,7 +272,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -285,14 +283,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -319,4 +318,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php b/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php index ab47ce8284..c7aa0dff1b 100644 --- a/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php +++ b/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * MultipleGetObjectsObject Class Doc Comment * * @category Class * @description GetObject operation on an index. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -34,7 +35,7 @@ class MultipleGetObjectsObject implements ModelInterface, ArrayAccess, \JsonSeri protected static $openAPITypes = [ 'attributesToRetrieve' => 'string[]', 'objectID' => 'string', - 'indexName' => 'string' + 'indexName' => 'string', ]; /** @@ -47,7 +48,7 @@ class MultipleGetObjectsObject implements ModelInterface, ArrayAccess, \JsonSeri protected static $openAPIFormats = [ 'attributesToRetrieve' => null, 'objectID' => null, - 'indexName' => null + 'indexName' => null, ]; /** @@ -79,7 +80,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'attributesToRetrieve' => 'attributesToRetrieve', 'objectID' => 'objectID', - 'indexName' => 'indexName' + 'indexName' => 'indexName', ]; /** @@ -90,7 +91,7 @@ public static function openAPIFormats() protected static $setters = [ 'attributesToRetrieve' => 'setAttributesToRetrieve', 'objectID' => 'setObjectID', - 'indexName' => 'setIndexName' + 'indexName' => 'setIndexName', ]; /** @@ -101,7 +102,7 @@ public static function openAPIFormats() protected static $getters = [ 'attributesToRetrieve' => 'getAttributesToRetrieve', 'objectID' => 'getObjectID', - 'indexName' => 'getIndexName' + 'indexName' => 'getIndexName', ]; /** @@ -145,7 +146,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -181,6 +181,7 @@ public function listInvalidProperties() if ($this->container['indexName'] === null) { $invalidProperties[] = "'indexName' can't be null"; } + return $invalidProperties; } @@ -195,7 +196,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets attributesToRetrieve * @@ -233,7 +233,7 @@ public function getObjectID() /** * Sets objectID * - * @param string $objectID ID of the object within that index. + * @param string $objectID ID of the object within that index * * @return self */ @@ -257,7 +257,7 @@ public function getIndexName() /** * Sets indexName * - * @param string $indexName name of the index containing the object. + * @param string $indexName name of the index containing the object * * @return self */ @@ -270,9 +270,9 @@ public function setIndexName($indexName) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -282,7 +282,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -311,7 +311,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -322,14 +322,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -356,4 +357,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php b/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php index f29705e627..65afdbdc7c 100644 --- a/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php +++ b/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * MultipleQueries Class Doc Comment @@ -35,7 +35,7 @@ class MultipleQueries implements ModelInterface, ArrayAccess, \JsonSerializable 'query' => 'string', 'type' => 'string', 'facet' => 'string', - 'params' => 'string' + 'params' => 'string', ]; /** @@ -50,7 +50,7 @@ class MultipleQueries implements ModelInterface, ArrayAccess, \JsonSerializable 'query' => null, 'type' => null, 'facet' => null, - 'params' => null + 'params' => null, ]; /** @@ -84,7 +84,7 @@ public static function openAPIFormats() 'query' => 'query', 'type' => 'type', 'facet' => 'facet', - 'params' => 'params' + 'params' => 'params', ]; /** @@ -97,7 +97,7 @@ public static function openAPIFormats() 'query' => 'setQuery', 'type' => 'setType', 'facet' => 'setFacet', - 'params' => 'setParams' + 'params' => 'setParams', ]; /** @@ -110,7 +110,7 @@ public static function openAPIFormats() 'query' => 'getQuery', 'type' => 'getType', 'facet' => 'getFacet', - 'params' => 'getParams' + 'params' => 'getParams', ]; /** @@ -227,7 +227,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets indexName * @@ -241,7 +240,7 @@ public function getIndexName() /** * Sets indexName * - * @param string $indexName The Algolia index name. + * @param string $indexName the Algolia index name * * @return self */ @@ -265,7 +264,7 @@ public function getQuery() /** * Sets query * - * @param string|null $query The text to search in the index. + * @param string|null $query the text to search in the index * * @return self */ @@ -289,7 +288,7 @@ public function getType() /** * Sets type * - * @param string|null $type Perform a search query with `default`, will search for facet values if `facet` is given. + * @param string|null $type perform a search query with `default`, will search for facet values if `facet` is given * * @return self */ @@ -323,7 +322,7 @@ public function getFacet() /** * Sets facet * - * @param string|null $facet The `facet` name. + * @param string|null $facet the `facet` name * * @return self */ @@ -347,7 +346,7 @@ public function getParams() /** * Sets params * - * @param string|null $params A query string of search parameters. + * @param string|null $params a query string of search parameters * * @return self */ @@ -360,9 +359,9 @@ public function setParams($params) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -372,7 +371,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -401,7 +400,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -412,14 +411,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -446,4 +446,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php index 448a05f979..221f62ee03 100644 --- a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php +++ b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * MultipleQueriesObject Class Doc Comment @@ -32,7 +32,7 @@ class MultipleQueriesObject implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPITypes = [ 'requests' => '\Algolia\AlgoliaSearch\Model\MultipleQueries[]', - 'strategy' => 'string' + 'strategy' => 'string', ]; /** @@ -44,7 +44,7 @@ class MultipleQueriesObject implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPIFormats = [ 'requests' => null, - 'strategy' => null + 'strategy' => null, ]; /** @@ -75,7 +75,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'requests' => 'requests', - 'strategy' => 'strategy' + 'strategy' => 'strategy', ]; /** @@ -85,7 +85,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'requests' => 'setRequests', - 'strategy' => 'setStrategy' + 'strategy' => 'setStrategy', ]; /** @@ -95,7 +95,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'requests' => 'getRequests', - 'strategy' => 'getStrategy' + 'strategy' => 'getStrategy', ]; /** @@ -209,7 +209,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets requests * @@ -270,9 +269,9 @@ public function setStrategy($strategy) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -282,7 +281,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -311,7 +310,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -322,14 +321,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -356,4 +356,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php index a5109a497d..8e9892d174 100644 --- a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * MultipleQueriesResponse Class Doc Comment @@ -31,7 +31,7 @@ class MultipleQueriesResponse implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $openAPITypes = [ - 'results' => '\Algolia\AlgoliaSearch\Model\SearchResponse[]' + 'results' => '\Algolia\AlgoliaSearch\Model\SearchResponse[]', ]; /** @@ -42,7 +42,7 @@ class MultipleQueriesResponse implements ModelInterface, ArrayAccess, \JsonSeria * @psalm-var array */ protected static $openAPIFormats = [ - 'results' => null + 'results' => null, ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'results' => 'results' + 'results' => 'results', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'results' => 'setResults' + 'results' => 'setResults', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'results' => 'getResults' + 'results' => 'getResults', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -176,7 +175,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets results * @@ -203,9 +201,9 @@ public function setResults($results) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -215,7 +213,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -244,7 +242,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -255,14 +253,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -289,4 +288,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/Operation.php b/clients/algoliasearch-client-php/lib/Model/Operation.php index 8683c73b1b..93b42c78d4 100644 --- a/clients/algoliasearch-client-php/lib/Model/Operation.php +++ b/clients/algoliasearch-client-php/lib/Model/Operation.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * Operation Class Doc Comment @@ -33,7 +33,7 @@ class Operation implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'action' => '\Algolia\AlgoliaSearch\Model\Action', 'body' => 'object', - 'indexName' => 'string' + 'indexName' => 'string', ]; /** @@ -46,7 +46,7 @@ class Operation implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'action' => null, 'body' => null, - 'indexName' => null + 'indexName' => null, ]; /** @@ -78,7 +78,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'action' => 'action', 'body' => 'body', - 'indexName' => 'indexName' + 'indexName' => 'indexName', ]; /** @@ -89,7 +89,7 @@ public static function openAPIFormats() protected static $setters = [ 'action' => 'setAction', 'body' => 'setBody', - 'indexName' => 'setIndexName' + 'indexName' => 'setIndexName', ]; /** @@ -100,7 +100,7 @@ public static function openAPIFormats() protected static $getters = [ 'action' => 'getAction', 'body' => 'getBody', - 'indexName' => 'getIndexName' + 'indexName' => 'getIndexName', ]; /** @@ -144,7 +144,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -188,7 +187,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets action * @@ -226,7 +224,7 @@ public function getBody() /** * Sets body * - * @param object|null $body arguments to the operation (depends on the type of the operation). + * @param object|null $body arguments to the operation (depends on the type of the operation) * * @return self */ @@ -250,7 +248,7 @@ public function getIndexName() /** * Sets indexName * - * @param string|null $indexName Index to target for this operation. + * @param string|null $indexName index to target for this operation * * @return self */ @@ -263,9 +261,9 @@ public function setIndexName($indexName) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -275,7 +273,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -304,7 +302,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -315,14 +313,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -349,4 +348,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php b/clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php index 6ce1064869..4b9696fb5e 100644 --- a/clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php +++ b/clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * OperationIndexObject Class Doc Comment @@ -33,7 +33,7 @@ class OperationIndexObject implements ModelInterface, ArrayAccess, \JsonSerializ protected static $openAPITypes = [ 'operation' => 'string', 'destination' => 'string', - 'scope' => 'string[]' + 'scope' => 'string[]', ]; /** @@ -46,7 +46,7 @@ class OperationIndexObject implements ModelInterface, ArrayAccess, \JsonSerializ protected static $openAPIFormats = [ 'operation' => null, 'destination' => null, - 'scope' => null + 'scope' => null, ]; /** @@ -78,7 +78,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'operation' => 'operation', 'destination' => 'destination', - 'scope' => 'scope' + 'scope' => 'scope', ]; /** @@ -89,7 +89,7 @@ public static function openAPIFormats() protected static $setters = [ 'operation' => 'setOperation', 'destination' => 'setDestination', - 'scope' => 'setScope' + 'scope' => 'setScope', ]; /** @@ -100,7 +100,7 @@ public static function openAPIFormats() protected static $getters = [ 'operation' => 'getOperation', 'destination' => 'getDestination', - 'scope' => 'getScope' + 'scope' => 'getScope', ]; /** @@ -221,6 +221,7 @@ public function listInvalidProperties() if ($this->container['destination'] === null) { $invalidProperties[] = "'destination' can't be null"; } + return $invalidProperties; } @@ -235,7 +236,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets operation * @@ -249,7 +249,7 @@ public function getOperation() /** * Sets operation * - * @param string $operation Type of operation to perform (move or copy). + * @param string $operation type of operation to perform (move or copy) * * @return self */ @@ -283,7 +283,7 @@ public function getDestination() /** * Sets destination * - * @param string $destination The Algolia index name. + * @param string $destination the Algolia index name * * @return self */ @@ -329,9 +329,9 @@ public function setScope($scope) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -341,7 +341,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -370,7 +370,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -381,14 +381,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -415,4 +416,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/Params.php b/clients/algoliasearch-client-php/lib/Model/Params.php index 91841228dc..f177d67d17 100644 --- a/clients/algoliasearch-client-php/lib/Model/Params.php +++ b/clients/algoliasearch-client-php/lib/Model/Params.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * Params Class Doc Comment * * @category Class * @description Additional search parameters. Any valid search parameter is allowed. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -34,7 +35,7 @@ class Params implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'query' => 'string', 'automaticFacetFilters' => '\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]', - 'automaticOptionalFacetFilters' => '\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]' + 'automaticOptionalFacetFilters' => '\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]', ]; /** @@ -47,7 +48,7 @@ class Params implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'query' => null, 'automaticFacetFilters' => null, - 'automaticOptionalFacetFilters' => null + 'automaticOptionalFacetFilters' => null, ]; /** @@ -79,7 +80,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'query' => 'query', 'automaticFacetFilters' => 'automaticFacetFilters', - 'automaticOptionalFacetFilters' => 'automaticOptionalFacetFilters' + 'automaticOptionalFacetFilters' => 'automaticOptionalFacetFilters', ]; /** @@ -90,7 +91,7 @@ public static function openAPIFormats() protected static $setters = [ 'query' => 'setQuery', 'automaticFacetFilters' => 'setAutomaticFacetFilters', - 'automaticOptionalFacetFilters' => 'setAutomaticOptionalFacetFilters' + 'automaticOptionalFacetFilters' => 'setAutomaticOptionalFacetFilters', ]; /** @@ -101,7 +102,7 @@ public static function openAPIFormats() protected static $getters = [ 'query' => 'getQuery', 'automaticFacetFilters' => 'getAutomaticFacetFilters', - 'automaticOptionalFacetFilters' => 'getAutomaticOptionalFacetFilters' + 'automaticOptionalFacetFilters' => 'getAutomaticOptionalFacetFilters', ]; /** @@ -145,7 +146,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -189,7 +189,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets query * @@ -203,7 +202,7 @@ public function getQuery() /** * Sets query * - * @param string|null $query Query string. + * @param string|null $query query string * * @return self */ @@ -227,7 +226,7 @@ public function getAutomaticFacetFilters() /** * Sets automaticFacetFilters * - * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticFacetFilters Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern. + * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticFacetFilters names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern * * @return self */ @@ -251,7 +250,7 @@ public function getAutomaticOptionalFacetFilters() /** * Sets automaticOptionalFacetFilters * - * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticOptionalFacetFilters Same syntax as automaticFacetFilters, but the engine treats the filters as optional. + * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticOptionalFacetFilters same syntax as automaticFacetFilters, but the engine treats the filters as optional * * @return self */ @@ -264,9 +263,9 @@ public function setAutomaticOptionalFacetFilters($automaticOptionalFacetFilters) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -276,7 +275,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -305,7 +304,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -316,14 +315,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -350,4 +350,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/Promote.php b/clients/algoliasearch-client-php/lib/Model/Promote.php index 14718b1d2c..27b86fae58 100644 --- a/clients/algoliasearch-client-php/lib/Model/Promote.php +++ b/clients/algoliasearch-client-php/lib/Model/Promote.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * Promote Class Doc Comment * * @category Class * @description Object to promote as hits. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -34,7 +35,7 @@ class Promote implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'objectID' => 'string', 'objectIDs' => 'string[]', - 'position' => 'int' + 'position' => 'int', ]; /** @@ -47,7 +48,7 @@ class Promote implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'objectID' => null, 'objectIDs' => null, - 'position' => null + 'position' => null, ]; /** @@ -79,7 +80,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'objectID' => 'objectID', 'objectIDs' => 'objectIDs', - 'position' => 'position' + 'position' => 'position', ]; /** @@ -90,7 +91,7 @@ public static function openAPIFormats() protected static $setters = [ 'objectID' => 'setObjectID', 'objectIDs' => 'setObjectIDs', - 'position' => 'setPosition' + 'position' => 'setPosition', ]; /** @@ -101,7 +102,7 @@ public static function openAPIFormats() protected static $getters = [ 'objectID' => 'getObjectID', 'objectIDs' => 'getObjectIDs', - 'position' => 'getPosition' + 'position' => 'getPosition', ]; /** @@ -145,7 +146,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -178,6 +178,7 @@ public function listInvalidProperties() if ($this->container['position'] === null) { $invalidProperties[] = "'position' can't be null"; } + return $invalidProperties; } @@ -192,7 +193,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets objectID * @@ -206,7 +206,7 @@ public function getObjectID() /** * Sets objectID * - * @param string|null $objectID Unique identifier of the object to promote. + * @param string|null $objectID unique identifier of the object to promote * * @return self */ @@ -230,7 +230,7 @@ public function getObjectIDs() /** * Sets objectIDs * - * @param string[]|null $objectIDs Array of unique identifiers of the objects to promote. + * @param string[]|null $objectIDs array of unique identifiers of the objects to promote * * @return self */ @@ -267,9 +267,9 @@ public function setPosition($position) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -279,7 +279,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -308,7 +308,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -319,14 +319,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -353,4 +354,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/RankingInfo.php b/clients/algoliasearch-client-php/lib/Model/RankingInfo.php index 03196a4eb5..0818d4c0a0 100644 --- a/clients/algoliasearch-client-php/lib/Model/RankingInfo.php +++ b/clients/algoliasearch-client-php/lib/Model/RankingInfo.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * RankingInfo Class Doc Comment @@ -41,7 +41,7 @@ class RankingInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'promoted' => 'bool', 'proximityDistance' => 'int', 'userScore' => 'int', - 'word' => 'int' + 'word' => 'int', ]; /** @@ -62,7 +62,7 @@ class RankingInfo implements ModelInterface, ArrayAccess, \JsonSerializable 'promoted' => null, 'proximityDistance' => null, 'userScore' => null, - 'word' => null + 'word' => null, ]; /** @@ -102,7 +102,7 @@ public static function openAPIFormats() 'promoted' => 'promoted', 'proximityDistance' => 'proximityDistance', 'userScore' => 'userScore', - 'word' => 'word' + 'word' => 'word', ]; /** @@ -121,7 +121,7 @@ public static function openAPIFormats() 'promoted' => 'setPromoted', 'proximityDistance' => 'setProximityDistance', 'userScore' => 'setUserScore', - 'word' => 'setWord' + 'word' => 'setWord', ]; /** @@ -140,7 +140,7 @@ public static function openAPIFormats() 'promoted' => 'getPromoted', 'proximityDistance' => 'getProximityDistance', 'userScore' => 'getUserScore', - 'word' => 'getWord' + 'word' => 'getWord', ]; /** @@ -184,7 +184,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -236,7 +235,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets filters * @@ -250,7 +248,7 @@ public function getFilters() /** * Sets filters * - * @param int|null $filters This field is reserved for advanced usage. + * @param int|null $filters this field is reserved for advanced usage * * @return self */ @@ -274,7 +272,7 @@ public function getFirstMatchedWord() /** * Sets firstMatchedWord * - * @param int|null $firstMatchedWord Position of the most important matched attribute in the attributes to index list. + * @param int|null $firstMatchedWord position of the most important matched attribute in the attributes to index list * * @return self */ @@ -298,7 +296,7 @@ public function getGeoDistance() /** * Sets geoDistance * - * @param int|null $geoDistance Distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters). + * @param int|null $geoDistance distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters) * * @return self */ @@ -322,7 +320,7 @@ public function getGeoPrecision() /** * Sets geoPrecision * - * @param int|null $geoPrecision Precision used when computing the geo distance, in meters. + * @param int|null $geoPrecision precision used when computing the geo distance, in meters * * @return self */ @@ -370,7 +368,7 @@ public function getNbExactWords() /** * Sets nbExactWords * - * @param int|null $nbExactWords Number of exactly matched words. + * @param int|null $nbExactWords number of exactly matched words * * @return self */ @@ -394,7 +392,7 @@ public function getNbTypos() /** * Sets nbTypos * - * @param int|null $nbTypos Number of typos encountered when matching the record. + * @param int|null $nbTypos number of typos encountered when matching the record * * @return self */ @@ -418,7 +416,7 @@ public function getPromoted() /** * Sets promoted * - * @param bool|null $promoted Present and set to true if a Rule promoted the hit. + * @param bool|null $promoted present and set to true if a Rule promoted the hit * * @return self */ @@ -442,7 +440,7 @@ public function getProximityDistance() /** * Sets proximityDistance * - * @param int|null $proximityDistance When the query contains more than one word, the sum of the distances between matched words (in meters). + * @param int|null $proximityDistance when the query contains more than one word, the sum of the distances between matched words (in meters) * * @return self */ @@ -466,7 +464,7 @@ public function getUserScore() /** * Sets userScore * - * @param int|null $userScore Custom ranking for the object, expressed as a single integer value. + * @param int|null $userScore custom ranking for the object, expressed as a single integer value * * @return self */ @@ -490,7 +488,7 @@ public function getWord() /** * Sets word * - * @param int|null $word Number of matched words, including prefixes and typos. + * @param int|null $word number of matched words, including prefixes and typos * * @return self */ @@ -503,9 +501,9 @@ public function setWord($word) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -515,7 +513,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -544,7 +542,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -555,14 +553,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -589,4 +588,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php b/clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php index 40e0ff224f..cc946d6772 100644 --- a/clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php +++ b/clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * RankingInfoMatchedGeoLocation Class Doc Comment @@ -33,7 +33,7 @@ class RankingInfoMatchedGeoLocation implements ModelInterface, ArrayAccess, \Jso protected static $openAPITypes = [ 'lat' => 'double', 'lng' => 'double', - 'distance' => 'int' + 'distance' => 'int', ]; /** @@ -46,7 +46,7 @@ class RankingInfoMatchedGeoLocation implements ModelInterface, ArrayAccess, \Jso protected static $openAPIFormats = [ 'lat' => 'double', 'lng' => 'double', - 'distance' => null + 'distance' => null, ]; /** @@ -78,7 +78,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'lat' => 'lat', 'lng' => 'lng', - 'distance' => 'distance' + 'distance' => 'distance', ]; /** @@ -89,7 +89,7 @@ public static function openAPIFormats() protected static $setters = [ 'lat' => 'setLat', 'lng' => 'setLng', - 'distance' => 'setDistance' + 'distance' => 'setDistance', ]; /** @@ -100,7 +100,7 @@ public static function openAPIFormats() protected static $getters = [ 'lat' => 'getLat', 'lng' => 'getLng', - 'distance' => 'getDistance' + 'distance' => 'getDistance', ]; /** @@ -144,7 +144,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -188,11 +187,10 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets lat * - * @return double|null + * @return float|null */ public function getLat() { @@ -202,7 +200,7 @@ public function getLat() /** * Sets lat * - * @param double|null $lat Latitude of the matched location. + * @param float|null $lat latitude of the matched location * * @return self */ @@ -216,7 +214,7 @@ public function setLat($lat) /** * Gets lng * - * @return double|null + * @return float|null */ public function getLng() { @@ -226,7 +224,7 @@ public function getLng() /** * Sets lng * - * @param double|null $lng Longitude of the matched location. + * @param float|null $lng longitude of the matched location * * @return self */ @@ -250,7 +248,7 @@ public function getDistance() /** * Sets distance * - * @param int|null $distance Distance between the matched location and the search location (in meters). + * @param int|null $distance distance between the matched location and the search location (in meters) * * @return self */ @@ -263,9 +261,9 @@ public function setDistance($distance) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -275,7 +273,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -304,7 +302,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -315,14 +313,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -349,4 +348,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/Record.php b/clients/algoliasearch-client-php/lib/Model/Record.php index cc58da5171..8865c7c54c 100644 --- a/clients/algoliasearch-client-php/lib/Model/Record.php +++ b/clients/algoliasearch-client-php/lib/Model/Record.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * Record Class Doc Comment * * @category Class * @description A single record. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -36,7 +37,7 @@ class Record implements ModelInterface, ArrayAccess, \JsonSerializable 'highlightResult' => '\Algolia\AlgoliaSearch\Model\HighlightResult', 'snippetResult' => '\Algolia\AlgoliaSearch\Model\SnippetResult', 'rankingInfo' => '\Algolia\AlgoliaSearch\Model\RankingInfo', - 'distinctSeqID' => 'int' + 'distinctSeqID' => 'int', ]; /** @@ -51,7 +52,7 @@ class Record implements ModelInterface, ArrayAccess, \JsonSerializable 'highlightResult' => null, 'snippetResult' => null, 'rankingInfo' => null, - 'distinctSeqID' => null + 'distinctSeqID' => null, ]; /** @@ -85,7 +86,7 @@ public static function openAPIFormats() 'highlightResult' => '_highlightResult', 'snippetResult' => '_snippetResult', 'rankingInfo' => '_rankingInfo', - 'distinctSeqID' => '_distinctSeqID' + 'distinctSeqID' => '_distinctSeqID', ]; /** @@ -98,7 +99,7 @@ public static function openAPIFormats() 'highlightResult' => 'setHighlightResult', 'snippetResult' => 'setSnippetResult', 'rankingInfo' => 'setRankingInfo', - 'distinctSeqID' => 'setDistinctSeqID' + 'distinctSeqID' => 'setDistinctSeqID', ]; /** @@ -111,7 +112,7 @@ public static function openAPIFormats() 'highlightResult' => 'getHighlightResult', 'snippetResult' => 'getSnippetResult', 'rankingInfo' => 'getRankingInfo', - 'distinctSeqID' => 'getDistinctSeqID' + 'distinctSeqID' => 'getDistinctSeqID', ]; /** @@ -155,7 +156,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -190,6 +190,7 @@ public function listInvalidProperties() if ($this->container['objectID'] === null) { $invalidProperties[] = "'objectID' can't be null"; } + return $invalidProperties; } @@ -204,7 +205,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets objectID * @@ -218,7 +218,7 @@ public function getObjectID() /** * Sets objectID * - * @param string $objectID Unique identifier of the object. + * @param string $objectID unique identifier of the object * * @return self */ @@ -327,9 +327,9 @@ public function setDistinctSeqID($distinctSeqID) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -339,7 +339,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -368,7 +368,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -379,14 +379,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -413,4 +414,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php b/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php index 0c70495abb..613ea7b881 100644 --- a/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * RemoveUserIdResponse Class Doc Comment @@ -31,7 +31,7 @@ class RemoveUserIdResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'deletedAt' => '\DateTime' + 'deletedAt' => '\DateTime', ]; /** @@ -42,7 +42,7 @@ class RemoveUserIdResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'deletedAt' => 'date-time' + 'deletedAt' => 'date-time', ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'deletedAt' => 'deletedAt' + 'deletedAt' => 'deletedAt', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'deletedAt' => 'setDeletedAt' + 'deletedAt' => 'setDeletedAt', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'deletedAt' => 'getDeletedAt' + 'deletedAt' => 'getDeletedAt', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -165,6 +164,7 @@ public function listInvalidProperties() if ($this->container['deletedAt'] === null) { $invalidProperties[] = "'deletedAt' can't be null"; } + return $invalidProperties; } @@ -179,7 +179,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets deletedAt * @@ -193,7 +192,7 @@ public function getDeletedAt() /** * Sets deletedAt * - * @param \DateTime $deletedAt Date of deletion (ISO-8601 format). + * @param \DateTime $deletedAt date of deletion (ISO-8601 format) * * @return self */ @@ -206,9 +205,9 @@ public function setDeletedAt($deletedAt) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -218,7 +217,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -247,7 +246,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -258,14 +257,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -292,4 +292,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php b/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php index 2b7487736e..76fdb9b512 100644 --- a/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * ReplaceSourceResponse Class Doc Comment @@ -31,7 +31,7 @@ class ReplaceSourceResponse implements ModelInterface, ArrayAccess, \JsonSeriali * @var string[] */ protected static $openAPITypes = [ - 'updatedAt' => '\DateTime' + 'updatedAt' => '\DateTime', ]; /** @@ -42,7 +42,7 @@ class ReplaceSourceResponse implements ModelInterface, ArrayAccess, \JsonSeriali * @psalm-var array */ protected static $openAPIFormats = [ - 'updatedAt' => 'date-time' + 'updatedAt' => 'date-time', ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'updatedAt' => 'updatedAt' + 'updatedAt' => 'updatedAt', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'updatedAt' => 'setUpdatedAt' + 'updatedAt' => 'setUpdatedAt', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'updatedAt' => 'getUpdatedAt' + 'updatedAt' => 'getUpdatedAt', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -165,6 +164,7 @@ public function listInvalidProperties() if ($this->container['updatedAt'] === null) { $invalidProperties[] = "'updatedAt' can't be null"; } + return $invalidProperties; } @@ -179,7 +179,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets updatedAt * @@ -193,7 +192,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime $updatedAt Date of last update (ISO-8601 format). + * @param \DateTime $updatedAt date of last update (ISO-8601 format) * * @return self */ @@ -206,9 +205,9 @@ public function setUpdatedAt($updatedAt) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -218,7 +217,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -247,7 +246,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -258,14 +257,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -292,4 +292,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/RequiredSearchParams.php b/clients/algoliasearch-client-php/lib/Model/RequiredSearchParams.php index 180e14b0cd..9ad354fa1a 100644 --- a/clients/algoliasearch-client-php/lib/Model/RequiredSearchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/RequiredSearchParams.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * RequiredSearchParams Class Doc Comment @@ -31,7 +31,7 @@ class RequiredSearchParams implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'query' => 'string' + 'query' => 'string', ]; /** @@ -42,7 +42,7 @@ class RequiredSearchParams implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'query' => null + 'query' => null, ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'query' => 'query' + 'query' => 'query', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'query' => 'setQuery' + 'query' => 'setQuery', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'query' => 'getQuery' + 'query' => 'getQuery', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -165,6 +164,7 @@ public function listInvalidProperties() if ($this->container['query'] === null) { $invalidProperties[] = "'query' can't be null"; } + return $invalidProperties; } @@ -179,7 +179,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets query * @@ -193,7 +192,7 @@ public function getQuery() /** * Sets query * - * @param string $query The text to search in the index. + * @param string $query the text to search in the index * * @return self */ @@ -206,9 +205,9 @@ public function setQuery($query) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -218,7 +217,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -247,7 +246,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -258,14 +257,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -292,4 +292,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/Rule.php b/clients/algoliasearch-client-php/lib/Model/Rule.php index ff0c3fb926..348f078ebe 100644 --- a/clients/algoliasearch-client-php/lib/Model/Rule.php +++ b/clients/algoliasearch-client-php/lib/Model/Rule.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * Rule Class Doc Comment * * @category Class * @description Rule object. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -37,7 +38,7 @@ class Rule implements ModelInterface, ArrayAccess, \JsonSerializable 'consequence' => '\Algolia\AlgoliaSearch\Model\Consequence', 'description' => 'string', 'enabled' => 'bool', - 'validity' => '\Algolia\AlgoliaSearch\Model\TimeRange[]' + 'validity' => '\Algolia\AlgoliaSearch\Model\TimeRange[]', ]; /** @@ -53,7 +54,7 @@ class Rule implements ModelInterface, ArrayAccess, \JsonSerializable 'consequence' => null, 'description' => null, 'enabled' => null, - 'validity' => null + 'validity' => null, ]; /** @@ -88,7 +89,7 @@ public static function openAPIFormats() 'consequence' => 'consequence', 'description' => 'description', 'enabled' => 'enabled', - 'validity' => 'validity' + 'validity' => 'validity', ]; /** @@ -102,7 +103,7 @@ public static function openAPIFormats() 'consequence' => 'setConsequence', 'description' => 'setDescription', 'enabled' => 'setEnabled', - 'validity' => 'setValidity' + 'validity' => 'setValidity', ]; /** @@ -116,7 +117,7 @@ public static function openAPIFormats() 'consequence' => 'getConsequence', 'description' => 'getDescription', 'enabled' => 'getEnabled', - 'validity' => 'getValidity' + 'validity' => 'getValidity', ]; /** @@ -160,7 +161,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -199,6 +199,7 @@ public function listInvalidProperties() if ($this->container['consequence'] === null) { $invalidProperties[] = "'consequence' can't be null"; } + return $invalidProperties; } @@ -213,7 +214,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets objectID * @@ -227,7 +227,7 @@ public function getObjectID() /** * Sets objectID * - * @param string $objectID Unique identifier of the object. + * @param string $objectID unique identifier of the object * * @return self */ @@ -360,9 +360,9 @@ public function setValidity($validity) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -372,7 +372,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -401,7 +401,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -412,14 +412,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -446,4 +447,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php b/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php index 4b894609d1..f941a44abc 100644 --- a/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SaveObjectResponse Class Doc Comment @@ -33,7 +33,7 @@ class SaveObjectResponse implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPITypes = [ 'createdAt' => 'string', 'taskID' => 'int', - 'objectID' => 'string' + 'objectID' => 'string', ]; /** @@ -46,7 +46,7 @@ class SaveObjectResponse implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPIFormats = [ 'createdAt' => null, 'taskID' => null, - 'objectID' => null + 'objectID' => null, ]; /** @@ -78,7 +78,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'createdAt' => 'createdAt', 'taskID' => 'taskID', - 'objectID' => 'objectID' + 'objectID' => 'objectID', ]; /** @@ -89,7 +89,7 @@ public static function openAPIFormats() protected static $setters = [ 'createdAt' => 'setCreatedAt', 'taskID' => 'setTaskID', - 'objectID' => 'setObjectID' + 'objectID' => 'setObjectID', ]; /** @@ -100,7 +100,7 @@ public static function openAPIFormats() protected static $getters = [ 'createdAt' => 'getCreatedAt', 'taskID' => 'getTaskID', - 'objectID' => 'getObjectID' + 'objectID' => 'getObjectID', ]; /** @@ -144,7 +144,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -188,7 +187,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets createdAt * @@ -226,7 +224,7 @@ public function getTaskID() /** * Sets taskID * - * @param int|null $taskID taskID of the indexing task to wait for. + * @param int|null $taskID taskID of the indexing task to wait for * * @return self */ @@ -250,7 +248,7 @@ public function getObjectID() /** * Sets objectID * - * @param string|null $objectID Unique identifier of the object. + * @param string|null $objectID unique identifier of the object * * @return self */ @@ -263,9 +261,9 @@ public function setObjectID($objectID) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -275,7 +273,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -304,7 +302,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -315,14 +313,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -349,4 +348,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php b/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php index 5781c715c7..2cc8ccc681 100644 --- a/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SaveSynonymResponse Class Doc Comment @@ -33,7 +33,7 @@ class SaveSynonymResponse implements ModelInterface, ArrayAccess, \JsonSerializa protected static $openAPITypes = [ 'taskID' => 'int', 'updatedAt' => '\DateTime', - 'id' => 'string' + 'id' => 'string', ]; /** @@ -46,7 +46,7 @@ class SaveSynonymResponse implements ModelInterface, ArrayAccess, \JsonSerializa protected static $openAPIFormats = [ 'taskID' => null, 'updatedAt' => 'date-time', - 'id' => null + 'id' => null, ]; /** @@ -78,7 +78,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'taskID' => 'taskID', 'updatedAt' => 'updatedAt', - 'id' => 'id' + 'id' => 'id', ]; /** @@ -89,7 +89,7 @@ public static function openAPIFormats() protected static $setters = [ 'taskID' => 'setTaskID', 'updatedAt' => 'setUpdatedAt', - 'id' => 'setId' + 'id' => 'setId', ]; /** @@ -100,7 +100,7 @@ public static function openAPIFormats() protected static $getters = [ 'taskID' => 'getTaskID', 'updatedAt' => 'getUpdatedAt', - 'id' => 'getId' + 'id' => 'getId', ]; /** @@ -144,7 +144,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -183,6 +182,7 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } + return $invalidProperties; } @@ -197,7 +197,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets taskID * @@ -211,7 +210,7 @@ public function getTaskID() /** * Sets taskID * - * @param int $taskID taskID of the indexing task to wait for. + * @param int $taskID taskID of the indexing task to wait for * * @return self */ @@ -235,7 +234,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime $updatedAt Date of last update (ISO-8601 format). + * @param \DateTime $updatedAt date of last update (ISO-8601 format) * * @return self */ @@ -259,7 +258,7 @@ public function getId() /** * Sets id * - * @param string $id objectID of the inserted object. + * @param string $id objectID of the inserted object * * @return self */ @@ -272,9 +271,9 @@ public function setId($id) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -284,7 +283,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -313,7 +312,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -324,14 +323,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -358,4 +358,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchDictionaryEntries.php b/clients/algoliasearch-client-php/lib/Model/SearchDictionaryEntries.php index 1db78c1742..f43a843699 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchDictionaryEntries.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchDictionaryEntries.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchDictionaryEntries Class Doc Comment * * @category Class * @description The `searchDictionaryEntries` request. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -35,7 +36,7 @@ class SearchDictionaryEntries implements ModelInterface, ArrayAccess, \JsonSeria 'query' => 'string', 'page' => 'int', 'hitsPerPage' => 'int', - 'language' => 'string' + 'language' => 'string', ]; /** @@ -49,7 +50,7 @@ class SearchDictionaryEntries implements ModelInterface, ArrayAccess, \JsonSeria 'query' => null, 'page' => null, 'hitsPerPage' => null, - 'language' => null + 'language' => null, ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() 'query' => 'query', 'page' => 'page', 'hitsPerPage' => 'hitsPerPage', - 'language' => 'language' + 'language' => 'language', ]; /** @@ -94,7 +95,7 @@ public static function openAPIFormats() 'query' => 'setQuery', 'page' => 'setPage', 'hitsPerPage' => 'setHitsPerPage', - 'language' => 'setLanguage' + 'language' => 'setLanguage', ]; /** @@ -106,7 +107,7 @@ public static function openAPIFormats() 'query' => 'getQuery', 'page' => 'getPage', 'hitsPerPage' => 'getHitsPerPage', - 'language' => 'getLanguage' + 'language' => 'getLanguage', ]; /** @@ -150,7 +151,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -184,6 +184,7 @@ public function listInvalidProperties() if ($this->container['query'] === null) { $invalidProperties[] = "'query' can't be null"; } + return $invalidProperties; } @@ -198,7 +199,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets query * @@ -212,7 +212,7 @@ public function getQuery() /** * Sets query * - * @param string $query The text to search in the index. + * @param string $query the text to search in the index * * @return self */ @@ -236,7 +236,7 @@ public function getPage() /** * Sets page * - * @param int|null $page Specify the page to retrieve. + * @param int|null $page specify the page to retrieve * * @return self */ @@ -260,7 +260,7 @@ public function getHitsPerPage() /** * Sets hitsPerPage * - * @param int|null $hitsPerPage Set the number of hits per page. + * @param int|null $hitsPerPage set the number of hits per page * * @return self */ @@ -297,9 +297,9 @@ public function setLanguage($language) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -309,7 +309,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -338,7 +338,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -349,14 +349,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -383,4 +384,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesRequest.php b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesRequest.php index 9ab47c9980..941510a8ee 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesRequest.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesRequest.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchForFacetValuesRequest Class Doc Comment @@ -33,7 +33,7 @@ class SearchForFacetValuesRequest implements ModelInterface, ArrayAccess, \JsonS protected static $openAPITypes = [ 'params' => 'string', 'facetQuery' => 'string', - 'maxFacetHits' => 'int' + 'maxFacetHits' => 'int', ]; /** @@ -46,7 +46,7 @@ class SearchForFacetValuesRequest implements ModelInterface, ArrayAccess, \JsonS protected static $openAPIFormats = [ 'params' => null, 'facetQuery' => null, - 'maxFacetHits' => null + 'maxFacetHits' => null, ]; /** @@ -78,7 +78,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'params' => 'params', 'facetQuery' => 'facetQuery', - 'maxFacetHits' => 'maxFacetHits' + 'maxFacetHits' => 'maxFacetHits', ]; /** @@ -89,7 +89,7 @@ public static function openAPIFormats() protected static $setters = [ 'params' => 'setParams', 'facetQuery' => 'setFacetQuery', - 'maxFacetHits' => 'setMaxFacetHits' + 'maxFacetHits' => 'setMaxFacetHits', ]; /** @@ -100,7 +100,7 @@ public static function openAPIFormats() protected static $getters = [ 'params' => 'getParams', 'facetQuery' => 'getFacetQuery', - 'maxFacetHits' => 'getMaxFacetHits' + 'maxFacetHits' => 'getMaxFacetHits', ]; /** @@ -144,7 +144,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -192,7 +191,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets params * @@ -206,7 +204,7 @@ public function getParams() /** * Sets params * - * @param string|null $params Search parameters as URL-encoded query string. + * @param string|null $params search parameters as URL-encoded query string * * @return self */ @@ -230,7 +228,7 @@ public function getFacetQuery() /** * Sets facetQuery * - * @param string|null $facetQuery Text to search inside the facet's values. + * @param string|null $facetQuery text to search inside the facet's values * * @return self */ @@ -260,7 +258,6 @@ public function getMaxFacetHits() */ public function setMaxFacetHits($maxFacetHits) { - if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling SearchForFacetValuesRequest., must be smaller than or equal to 100.'); } @@ -272,9 +269,9 @@ public function setMaxFacetHits($maxFacetHits) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -284,7 +281,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -313,7 +310,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -324,14 +321,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -358,4 +356,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponse.php index 7f1bfa58fa..c69a1144ef 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchForFacetValuesResponse Class Doc Comment @@ -31,7 +31,7 @@ class SearchForFacetValuesResponse implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ - 'facetHits' => '\Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponseFacetHits[]' + 'facetHits' => '\Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponseFacetHits[]', ]; /** @@ -42,7 +42,7 @@ class SearchForFacetValuesResponse implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ - 'facetHits' => null + 'facetHits' => null, ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'facetHits' => 'facetHits' + 'facetHits' => 'facetHits', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'facetHits' => 'setFacetHits' + 'facetHits' => 'setFacetHits', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'facetHits' => 'getFacetHits' + 'facetHits' => 'getFacetHits', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -165,6 +164,7 @@ public function listInvalidProperties() if ($this->container['facetHits'] === null) { $invalidProperties[] = "'facetHits' can't be null"; } + return $invalidProperties; } @@ -179,7 +179,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets facetHits * @@ -206,9 +205,9 @@ public function setFacetHits($facetHits) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -218,7 +217,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -247,7 +246,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -258,14 +257,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -292,4 +292,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php index 0b4efb1a49..f5c7b8bba5 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchForFacetValuesResponseFacetHits Class Doc Comment @@ -33,7 +33,7 @@ class SearchForFacetValuesResponseFacetHits implements ModelInterface, ArrayAcce protected static $openAPITypes = [ 'value' => 'string', 'highlighted' => 'string', - 'count' => 'int' + 'count' => 'int', ]; /** @@ -46,7 +46,7 @@ class SearchForFacetValuesResponseFacetHits implements ModelInterface, ArrayAcce protected static $openAPIFormats = [ 'value' => null, 'highlighted' => null, - 'count' => null + 'count' => null, ]; /** @@ -78,7 +78,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'value' => 'value', 'highlighted' => 'highlighted', - 'count' => 'count' + 'count' => 'count', ]; /** @@ -89,7 +89,7 @@ public static function openAPIFormats() protected static $setters = [ 'value' => 'setValue', 'highlighted' => 'setHighlighted', - 'count' => 'setCount' + 'count' => 'setCount', ]; /** @@ -100,7 +100,7 @@ public static function openAPIFormats() protected static $getters = [ 'value' => 'getValue', 'highlighted' => 'getHighlighted', - 'count' => 'getCount' + 'count' => 'getCount', ]; /** @@ -144,7 +144,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -183,6 +182,7 @@ public function listInvalidProperties() if ($this->container['count'] === null) { $invalidProperties[] = "'count' can't be null"; } + return $invalidProperties; } @@ -197,7 +197,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets value * @@ -211,7 +210,7 @@ public function getValue() /** * Sets value * - * @param string $value Raw value of the facet. + * @param string $value raw value of the facet * * @return self */ @@ -235,7 +234,7 @@ public function getHighlighted() /** * Sets highlighted * - * @param string $highlighted Markup text with occurrences highlighted. + * @param string $highlighted markup text with occurrences highlighted * * @return self */ @@ -272,9 +271,9 @@ public function setCount($count) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -284,7 +283,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -313,7 +312,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -324,14 +323,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -358,4 +358,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchHits.php b/clients/algoliasearch-client-php/lib/Model/SearchHits.php index 98d474deaf..9eea6d0bd9 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchHits.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchHits.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchHits Class Doc Comment @@ -31,7 +31,7 @@ class SearchHits implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'hits' => '\Algolia\AlgoliaSearch\Model\Record[]' + 'hits' => '\Algolia\AlgoliaSearch\Model\Record[]', ]; /** @@ -42,7 +42,7 @@ class SearchHits implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'hits' => null + 'hits' => null, ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'hits' => 'hits' + 'hits' => 'hits', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'hits' => 'setHits' + 'hits' => 'setHits', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'hits' => 'getHits' + 'hits' => 'getHits', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -176,7 +175,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets hits * @@ -203,9 +201,9 @@ public function setHits($hits) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -215,7 +213,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -244,7 +242,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -255,14 +253,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -289,4 +288,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchParams.php b/clients/algoliasearch-client-php/lib/Model/SearchParams.php index 184d6356e4..ec002c5001 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchParams.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchParams Class Doc Comment @@ -108,7 +108,7 @@ class SearchParams implements ModelInterface, ArrayAccess, \JsonSerializable 'responseFields' => 'string[]', 'maxFacetHits' => 'int', 'attributeCriteriaComputedByMinProximity' => 'bool', - 'renderingContent' => 'object' + 'renderingContent' => 'object', ]; /** @@ -196,7 +196,7 @@ class SearchParams implements ModelInterface, ArrayAccess, \JsonSerializable 'responseFields' => null, 'maxFacetHits' => null, 'attributeCriteriaComputedByMinProximity' => null, - 'renderingContent' => null + 'renderingContent' => null, ]; /** @@ -303,7 +303,7 @@ public static function openAPIFormats() 'responseFields' => 'responseFields', 'maxFacetHits' => 'maxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', - 'renderingContent' => 'renderingContent' + 'renderingContent' => 'renderingContent', ]; /** @@ -389,7 +389,7 @@ public static function openAPIFormats() 'responseFields' => 'setResponseFields', 'maxFacetHits' => 'setMaxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', - 'renderingContent' => 'setRenderingContent' + 'renderingContent' => 'setRenderingContent', ]; /** @@ -475,7 +475,7 @@ public static function openAPIFormats() 'responseFields' => 'getResponseFields', 'maxFacetHits' => 'getMaxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', - 'renderingContent' => 'getRenderingContent' + 'renderingContent' => 'getRenderingContent', ]; /** @@ -813,7 +813,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets params * @@ -827,7 +826,7 @@ public function getParams() /** * Sets params * - * @param string|null $params Search parameters as URL-encoded query string. + * @param string|null $params search parameters as URL-encoded query string * * @return self */ @@ -851,7 +850,7 @@ public function getSimilarQuery() /** * Sets similarQuery * - * @param string|null $similarQuery Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. + * @param string|null $similarQuery overrides the query parameter and performs a more generic search that can be used to find \"similar\" results * * @return self */ @@ -875,7 +874,7 @@ public function getFilters() /** * Sets filters * - * @param string|null $filters Filter the query with numeric, facet and/or tag filters. + * @param string|null $filters filter the query with numeric, facet and/or tag filters * * @return self */ @@ -899,7 +898,7 @@ public function getFacetFilters() /** * Sets facetFilters * - * @param string[]|null $facetFilters Filter hits by facet value. + * @param string[]|null $facetFilters filter hits by facet value * * @return self */ @@ -923,7 +922,7 @@ public function getOptionalFilters() /** * Sets optionalFilters * - * @param string[]|null $optionalFilters Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. + * @param string[]|null $optionalFilters create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter * * @return self */ @@ -947,7 +946,7 @@ public function getNumericFilters() /** * Sets numericFilters * - * @param string[]|null $numericFilters Filter on numeric attributes. + * @param string[]|null $numericFilters filter on numeric attributes * * @return self */ @@ -971,7 +970,7 @@ public function getTagFilters() /** * Sets tagFilters * - * @param string[]|null $tagFilters Filter hits by tags. + * @param string[]|null $tagFilters filter hits by tags * * @return self */ @@ -995,7 +994,7 @@ public function getSumOrFiltersScores() /** * Sets sumOrFiltersScores * - * @param bool|null $sumOrFiltersScores Determines how to calculate the total score for filtering. + * @param bool|null $sumOrFiltersScores determines how to calculate the total score for filtering * * @return self */ @@ -1019,7 +1018,7 @@ public function getFacets() /** * Sets facets * - * @param string[]|null $facets Retrieve facets and their facet values. + * @param string[]|null $facets retrieve facets and their facet values * * @return self */ @@ -1043,7 +1042,7 @@ public function getMaxValuesPerFacet() /** * Sets maxValuesPerFacet * - * @param int|null $maxValuesPerFacet Maximum number of facet values to return for each facet during a regular search. + * @param int|null $maxValuesPerFacet maximum number of facet values to return for each facet during a regular search * * @return self */ @@ -1067,7 +1066,7 @@ public function getFacetingAfterDistinct() /** * Sets facetingAfterDistinct * - * @param bool|null $facetingAfterDistinct Force faceting to be applied after de-duplication (via the Distinct setting). + * @param bool|null $facetingAfterDistinct force faceting to be applied after de-duplication (via the Distinct setting) * * @return self */ @@ -1091,7 +1090,7 @@ public function getSortFacetValuesBy() /** * Sets sortFacetValuesBy * - * @param string|null $sortFacetValuesBy Controls how facet values are fetched. + * @param string|null $sortFacetValuesBy controls how facet values are fetched * * @return self */ @@ -1115,7 +1114,7 @@ public function getPage() /** * Sets page * - * @param int|null $page Specify the page to retrieve. + * @param int|null $page specify the page to retrieve * * @return self */ @@ -1139,7 +1138,7 @@ public function getOffset() /** * Sets offset * - * @param int|null $offset Specify the offset of the first hit to return. + * @param int|null $offset specify the offset of the first hit to return * * @return self */ @@ -1163,13 +1162,12 @@ public function getLength() /** * Sets length * - * @param int|null $length Set the number of hits to retrieve (used only with offset). + * @param int|null $length set the number of hits to retrieve (used only with offset) * * @return self */ public function setLength($length) { - if (!is_null($length) && ($length > 1000)) { throw new \InvalidArgumentException('invalid value for $length when calling SearchParams., must be smaller than or equal to 1000.'); } @@ -1195,7 +1193,7 @@ public function getAroundLatLng() /** * Sets aroundLatLng * - * @param string|null $aroundLatLng Search for entries around a central geolocation, enabling a geo search within a circular area. + * @param string|null $aroundLatLng search for entries around a central geolocation, enabling a geo search within a circular area * * @return self */ @@ -1219,7 +1217,7 @@ public function getAroundLatLngViaIP() /** * Sets aroundLatLngViaIP * - * @param bool|null $aroundLatLngViaIP Search for entries around a given location automatically computed from the requester's IP address. + * @param bool|null $aroundLatLngViaIP search for entries around a given location automatically computed from the requester's IP address * * @return self */ @@ -1243,7 +1241,7 @@ public function getAroundRadius() /** * Sets aroundRadius * - * @param OneOfIntegerString|null $aroundRadius Define the maximum radius for a geo search (in meters). + * @param OneOfIntegerString|null $aroundRadius define the maximum radius for a geo search (in meters) * * @return self */ @@ -1267,7 +1265,7 @@ public function getAroundPrecision() /** * Sets aroundPrecision * - * @param int|null $aroundPrecision Precision of geo search (in meters), to add grouping by geo location to the ranking formula. + * @param int|null $aroundPrecision precision of geo search (in meters), to add grouping by geo location to the ranking formula * * @return self */ @@ -1291,13 +1289,12 @@ public function getMinimumAroundRadius() /** * Sets minimumAroundRadius * - * @param int|null $minimumAroundRadius Minimum radius (in meters) used for a geo search when aroundRadius is not set. + * @param int|null $minimumAroundRadius minimum radius (in meters) used for a geo search when aroundRadius is not set * * @return self */ public function setMinimumAroundRadius($minimumAroundRadius) { - if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling SearchParams., must be bigger than or equal to 1.'); } @@ -1320,7 +1317,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox * - * @param float[]|null $insideBoundingBox Search inside a rectangular area (in geo coordinates). + * @param float[]|null $insideBoundingBox search inside a rectangular area (in geo coordinates) * * @return self */ @@ -1344,7 +1341,7 @@ public function getInsidePolygon() /** * Sets insidePolygon * - * @param float[]|null $insidePolygon Search inside a polygon (in geo coordinates). + * @param float[]|null $insidePolygon search inside a polygon (in geo coordinates) * * @return self */ @@ -1392,7 +1389,7 @@ public function getRuleContexts() /** * Sets ruleContexts * - * @param string[]|null $ruleContexts Enables contextual rules. + * @param string[]|null $ruleContexts enables contextual rules * * @return self */ @@ -1416,7 +1413,7 @@ public function getPersonalizationImpact() /** * Sets personalizationImpact * - * @param int|null $personalizationImpact Define the impact of the Personalization feature. + * @param int|null $personalizationImpact define the impact of the Personalization feature * * @return self */ @@ -1440,7 +1437,7 @@ public function getUserToken() /** * Sets userToken * - * @param string|null $userToken Associates a certain user token with the current search. + * @param string|null $userToken associates a certain user token with the current search * * @return self */ @@ -1464,7 +1461,7 @@ public function getGetRankingInfo() /** * Sets getRankingInfo * - * @param bool|null $getRankingInfo Retrieve detailed ranking information. + * @param bool|null $getRankingInfo retrieve detailed ranking information * * @return self */ @@ -1488,7 +1485,7 @@ public function getClickAnalytics() /** * Sets clickAnalytics * - * @param bool|null $clickAnalytics Enable the Click Analytics feature. + * @param bool|null $clickAnalytics enable the Click Analytics feature * * @return self */ @@ -1512,7 +1509,7 @@ public function getAnalytics() /** * Sets analytics * - * @param bool|null $analytics Whether the current query will be taken into account in the Analytics. + * @param bool|null $analytics whether the current query will be taken into account in the Analytics * * @return self */ @@ -1536,7 +1533,7 @@ public function getAnalyticsTags() /** * Sets analyticsTags * - * @param string[]|null $analyticsTags List of tags to apply to the query for analytics purposes. + * @param string[]|null $analyticsTags list of tags to apply to the query for analytics purposes * * @return self */ @@ -1560,7 +1557,7 @@ public function getPercentileComputation() /** * Sets percentileComputation * - * @param bool|null $percentileComputation Whether to include or exclude a query from the processing-time percentile computation. + * @param bool|null $percentileComputation whether to include or exclude a query from the processing-time percentile computation * * @return self */ @@ -1584,7 +1581,7 @@ public function getEnableABTest() /** * Sets enableABTest * - * @param bool|null $enableABTest Whether this search should participate in running AB tests. + * @param bool|null $enableABTest whether this search should participate in running AB tests * * @return self */ @@ -1608,7 +1605,7 @@ public function getEnableReRanking() /** * Sets enableReRanking * - * @param bool|null $enableReRanking Whether this search should use AI Re-Ranking. + * @param bool|null $enableReRanking whether this search should use AI Re-Ranking * * @return self */ @@ -1632,7 +1629,7 @@ public function getQuery() /** * Sets query * - * @param string $query The text to search in the index. + * @param string $query the text to search in the index * * @return self */ @@ -1656,7 +1653,7 @@ public function getSearchableAttributes() /** * Sets searchableAttributes * - * @param string[]|null $searchableAttributes The complete list of attributes used for searching. + * @param string[]|null $searchableAttributes the complete list of attributes used for searching * * @return self */ @@ -1680,7 +1677,7 @@ public function getAttributesForFaceting() /** * Sets attributesForFaceting * - * @param string[]|null $attributesForFaceting The complete list of attributes that will be used for faceting. + * @param string[]|null $attributesForFaceting the complete list of attributes that will be used for faceting * * @return self */ @@ -1704,7 +1701,7 @@ public function getUnretrievableAttributes() /** * Sets unretrievableAttributes * - * @param string[]|null $unretrievableAttributes List of attributes that can't be retrieved at query time. + * @param string[]|null $unretrievableAttributes list of attributes that can't be retrieved at query time * * @return self */ @@ -1728,7 +1725,7 @@ public function getAttributesToRetrieve() /** * Sets attributesToRetrieve * - * @param string[]|null $attributesToRetrieve This parameter controls which attributes to retrieve and which not to retrieve. + * @param string[]|null $attributesToRetrieve this parameter controls which attributes to retrieve and which not to retrieve * * @return self */ @@ -1752,7 +1749,7 @@ public function getRestrictSearchableAttributes() /** * Sets restrictSearchableAttributes * - * @param string[]|null $restrictSearchableAttributes Restricts a given query to look in only a subset of your searchable attributes. + * @param string[]|null $restrictSearchableAttributes restricts a given query to look in only a subset of your searchable attributes * * @return self */ @@ -1776,7 +1773,7 @@ public function getRanking() /** * Sets ranking * - * @param string[]|null $ranking Controls how Algolia should sort your results. + * @param string[]|null $ranking controls how Algolia should sort your results * * @return self */ @@ -1800,7 +1797,7 @@ public function getCustomRanking() /** * Sets customRanking * - * @param string[]|null $customRanking Specifies the custom ranking criterion. + * @param string[]|null $customRanking specifies the custom ranking criterion * * @return self */ @@ -1824,7 +1821,7 @@ public function getRelevancyStrictness() /** * Sets relevancyStrictness * - * @param int|null $relevancyStrictness Controls the relevancy threshold below which less relevant results aren't included in the results. + * @param int|null $relevancyStrictness controls the relevancy threshold below which less relevant results aren't included in the results * * @return self */ @@ -1848,7 +1845,7 @@ public function getAttributesToHighlight() /** * Sets attributesToHighlight * - * @param string[]|null $attributesToHighlight List of attributes to highlight. + * @param string[]|null $attributesToHighlight list of attributes to highlight * * @return self */ @@ -1872,7 +1869,7 @@ public function getAttributesToSnippet() /** * Sets attributesToSnippet * - * @param string[]|null $attributesToSnippet List of attributes to snippet, with an optional maximum number of words to snippet. + * @param string[]|null $attributesToSnippet list of attributes to snippet, with an optional maximum number of words to snippet * * @return self */ @@ -1896,7 +1893,7 @@ public function getHighlightPreTag() /** * Sets highlightPreTag * - * @param string|null $highlightPreTag The HTML string to insert before the highlighted parts in all highlight and snippet results. + * @param string|null $highlightPreTag the HTML string to insert before the highlighted parts in all highlight and snippet results * * @return self */ @@ -1920,7 +1917,7 @@ public function getHighlightPostTag() /** * Sets highlightPostTag * - * @param string|null $highlightPostTag The HTML string to insert after the highlighted parts in all highlight and snippet results. + * @param string|null $highlightPostTag the HTML string to insert after the highlighted parts in all highlight and snippet results * * @return self */ @@ -1944,7 +1941,7 @@ public function getSnippetEllipsisText() /** * Sets snippetEllipsisText * - * @param string|null $snippetEllipsisText String used as an ellipsis indicator when a snippet is truncated. + * @param string|null $snippetEllipsisText string used as an ellipsis indicator when a snippet is truncated * * @return self */ @@ -1968,7 +1965,7 @@ public function getRestrictHighlightAndSnippetArrays() /** * Sets restrictHighlightAndSnippetArrays * - * @param bool|null $restrictHighlightAndSnippetArrays Restrict highlighting and snippeting to items that matched the query. + * @param bool|null $restrictHighlightAndSnippetArrays restrict highlighting and snippeting to items that matched the query * * @return self */ @@ -1992,7 +1989,7 @@ public function getHitsPerPage() /** * Sets hitsPerPage * - * @param int|null $hitsPerPage Set the number of hits per page. + * @param int|null $hitsPerPage set the number of hits per page * * @return self */ @@ -2016,7 +2013,7 @@ public function getMinWordSizefor1Typo() /** * Sets minWordSizefor1Typo * - * @param int|null $minWordSizefor1Typo Minimum number of characters a word in the query string must contain to accept matches with 1 typo. + * @param int|null $minWordSizefor1Typo minimum number of characters a word in the query string must contain to accept matches with 1 typo * * @return self */ @@ -2040,7 +2037,7 @@ public function getMinWordSizefor2Typos() /** * Sets minWordSizefor2Typos * - * @param int|null $minWordSizefor2Typos Minimum number of characters a word in the query string must contain to accept matches with 2 typos. + * @param int|null $minWordSizefor2Typos minimum number of characters a word in the query string must contain to accept matches with 2 typos * * @return self */ @@ -2064,7 +2061,7 @@ public function getTypoTolerance() /** * Sets typoTolerance * - * @param string|null $typoTolerance Controls whether typo tolerance is enabled and how it is applied. + * @param string|null $typoTolerance controls whether typo tolerance is enabled and how it is applied * * @return self */ @@ -2098,7 +2095,7 @@ public function getAllowTyposOnNumericTokens() /** * Sets allowTyposOnNumericTokens * - * @param bool|null $allowTyposOnNumericTokens Whether to allow typos on numbers (\"numeric tokens\") in the query string. + * @param bool|null $allowTyposOnNumericTokens whether to allow typos on numbers (\"numeric tokens\") in the query string * * @return self */ @@ -2122,7 +2119,7 @@ public function getDisableTypoToleranceOnAttributes() /** * Sets disableTypoToleranceOnAttributes * - * @param string[]|null $disableTypoToleranceOnAttributes List of attributes on which you want to disable typo tolerance. + * @param string[]|null $disableTypoToleranceOnAttributes list of attributes on which you want to disable typo tolerance * * @return self */ @@ -2146,7 +2143,7 @@ public function getSeparatorsToIndex() /** * Sets separatorsToIndex * - * @param string|null $separatorsToIndex Control which separators are indexed. + * @param string|null $separatorsToIndex control which separators are indexed * * @return self */ @@ -2170,7 +2167,7 @@ public function getIgnorePlurals() /** * Sets ignorePlurals * - * @param string|null $ignorePlurals Treats singular, plurals, and other forms of declensions as matching terms. + * @param string|null $ignorePlurals treats singular, plurals, and other forms of declensions as matching terms * * @return self */ @@ -2194,7 +2191,7 @@ public function getRemoveStopWords() /** * Sets removeStopWords * - * @param string|null $removeStopWords Removes stop (common) words from the query before executing it. + * @param string|null $removeStopWords removes stop (common) words from the query before executing it * * @return self */ @@ -2218,7 +2215,7 @@ public function getKeepDiacriticsOnCharacters() /** * Sets keepDiacriticsOnCharacters * - * @param string|null $keepDiacriticsOnCharacters List of characters that the engine shouldn't automatically normalize. + * @param string|null $keepDiacriticsOnCharacters list of characters that the engine shouldn't automatically normalize * * @return self */ @@ -2242,7 +2239,7 @@ public function getQueryLanguages() /** * Sets queryLanguages * - * @param string[]|null $queryLanguages Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. + * @param string[]|null $queryLanguages sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection * * @return self */ @@ -2266,7 +2263,7 @@ public function getDecompoundQuery() /** * Sets decompoundQuery * - * @param bool|null $decompoundQuery Splits compound words into their composing atoms in the query. + * @param bool|null $decompoundQuery splits compound words into their composing atoms in the query * * @return self */ @@ -2290,7 +2287,7 @@ public function getEnableRules() /** * Sets enableRules * - * @param bool|null $enableRules Whether Rules should be globally enabled. + * @param bool|null $enableRules whether Rules should be globally enabled * * @return self */ @@ -2314,7 +2311,7 @@ public function getEnablePersonalization() /** * Sets enablePersonalization * - * @param bool|null $enablePersonalization Enable the Personalization feature. + * @param bool|null $enablePersonalization enable the Personalization feature * * @return self */ @@ -2338,7 +2335,7 @@ public function getQueryType() /** * Sets queryType * - * @param string|null $queryType Controls if and how query words are interpreted as prefixes. + * @param string|null $queryType controls if and how query words are interpreted as prefixes * * @return self */ @@ -2372,7 +2369,7 @@ public function getRemoveWordsIfNoResults() /** * Sets removeWordsIfNoResults * - * @param string|null $removeWordsIfNoResults Selects a strategy to remove words from the query when it doesn't match any hits. + * @param string|null $removeWordsIfNoResults selects a strategy to remove words from the query when it doesn't match any hits * * @return self */ @@ -2406,7 +2403,7 @@ public function getAdvancedSyntax() /** * Sets advancedSyntax * - * @param bool|null $advancedSyntax Enables the advanced query syntax. + * @param bool|null $advancedSyntax enables the advanced query syntax * * @return self */ @@ -2430,7 +2427,7 @@ public function getOptionalWords() /** * Sets optionalWords * - * @param string[]|null $optionalWords A list of words that should be considered as optional when found in the query. + * @param string[]|null $optionalWords a list of words that should be considered as optional when found in the query * * @return self */ @@ -2454,7 +2451,7 @@ public function getDisableExactOnAttributes() /** * Sets disableExactOnAttributes * - * @param string[]|null $disableExactOnAttributes List of attributes on which you want to disable the exact ranking criterion. + * @param string[]|null $disableExactOnAttributes list of attributes on which you want to disable the exact ranking criterion * * @return self */ @@ -2478,7 +2475,7 @@ public function getExactOnSingleWordQuery() /** * Sets exactOnSingleWordQuery * - * @param string|null $exactOnSingleWordQuery Controls how the exact ranking criterion is computed when the query contains only one word. + * @param string|null $exactOnSingleWordQuery controls how the exact ranking criterion is computed when the query contains only one word * * @return self */ @@ -2512,7 +2509,7 @@ public function getAlternativesAsExact() /** * Sets alternativesAsExact * - * @param string[]|null $alternativesAsExact List of alternatives that should be considered an exact match by the exact ranking criterion. + * @param string[]|null $alternativesAsExact list of alternatives that should be considered an exact match by the exact ranking criterion * * @return self */ @@ -2545,7 +2542,7 @@ public function getAdvancedSyntaxFeatures() /** * Sets advancedSyntaxFeatures * - * @param string[]|null $advancedSyntaxFeatures Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. + * @param string[]|null $advancedSyntaxFeatures allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled * * @return self */ @@ -2578,13 +2575,12 @@ public function getDistinct() /** * Sets distinct * - * @param int|null $distinct Enables de-duplication or grouping of results. + * @param int|null $distinct enables de-duplication or grouping of results * * @return self */ public function setDistinct($distinct) { - if (!is_null($distinct) && ($distinct > 4)) { throw new \InvalidArgumentException('invalid value for $distinct when calling SearchParams., must be smaller than or equal to 4.'); } @@ -2610,7 +2606,7 @@ public function getSynonyms() /** * Sets synonyms * - * @param bool|null $synonyms Whether to take into account an index's synonyms for a particular search. + * @param bool|null $synonyms whether to take into account an index's synonyms for a particular search * * @return self */ @@ -2634,7 +2630,7 @@ public function getReplaceSynonymsInHighlight() /** * Sets replaceSynonymsInHighlight * - * @param bool|null $replaceSynonymsInHighlight Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + * @param bool|null $replaceSynonymsInHighlight whether to highlight and snippet the original word that matches the synonym or the synonym itself * * @return self */ @@ -2658,13 +2654,12 @@ public function getMinProximity() /** * Sets minProximity * - * @param int|null $minProximity Precision of the proximity ranking criterion. + * @param int|null $minProximity precision of the proximity ranking criterion * * @return self */ public function setMinProximity($minProximity) { - if (!is_null($minProximity) && ($minProximity > 7)) { throw new \InvalidArgumentException('invalid value for $minProximity when calling SearchParams., must be smaller than or equal to 7.'); } @@ -2720,7 +2715,6 @@ public function getMaxFacetHits() */ public function setMaxFacetHits($maxFacetHits) { - if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling SearchParams., must be smaller than or equal to 100.'); } @@ -2743,7 +2737,7 @@ public function getAttributeCriteriaComputedByMinProximity() /** * Sets attributeCriteriaComputedByMinProximity * - * @param bool|null $attributeCriteriaComputedByMinProximity When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. + * @param bool|null $attributeCriteriaComputedByMinProximity when attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage * * @return self */ @@ -2780,9 +2774,9 @@ public function setRenderingContent($renderingContent) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -2792,7 +2786,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -2821,7 +2815,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -2832,14 +2826,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -2866,4 +2861,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchParamsObject.php b/clients/algoliasearch-client-php/lib/Model/SearchParamsObject.php index 49956dd09f..5fcfff23f1 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchParamsObject.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchParamsObject.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchParamsObject Class Doc Comment @@ -107,7 +107,7 @@ class SearchParamsObject implements ModelInterface, ArrayAccess, \JsonSerializab 'responseFields' => 'string[]', 'maxFacetHits' => 'int', 'attributeCriteriaComputedByMinProximity' => 'bool', - 'renderingContent' => 'object' + 'renderingContent' => 'object', ]; /** @@ -194,7 +194,7 @@ class SearchParamsObject implements ModelInterface, ArrayAccess, \JsonSerializab 'responseFields' => null, 'maxFacetHits' => null, 'attributeCriteriaComputedByMinProximity' => null, - 'renderingContent' => null + 'renderingContent' => null, ]; /** @@ -300,7 +300,7 @@ public static function openAPIFormats() 'responseFields' => 'responseFields', 'maxFacetHits' => 'maxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', - 'renderingContent' => 'renderingContent' + 'renderingContent' => 'renderingContent', ]; /** @@ -385,7 +385,7 @@ public static function openAPIFormats() 'responseFields' => 'setResponseFields', 'maxFacetHits' => 'setMaxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', - 'renderingContent' => 'setRenderingContent' + 'renderingContent' => 'setRenderingContent', ]; /** @@ -470,7 +470,7 @@ public static function openAPIFormats() 'responseFields' => 'getResponseFields', 'maxFacetHits' => 'getMaxFacetHits', 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', - 'renderingContent' => 'getRenderingContent' + 'renderingContent' => 'getRenderingContent', ]; /** @@ -807,7 +807,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets similarQuery * @@ -821,7 +820,7 @@ public function getSimilarQuery() /** * Sets similarQuery * - * @param string|null $similarQuery Overrides the query parameter and performs a more generic search that can be used to find \"similar\" results. + * @param string|null $similarQuery overrides the query parameter and performs a more generic search that can be used to find \"similar\" results * * @return self */ @@ -845,7 +844,7 @@ public function getFilters() /** * Sets filters * - * @param string|null $filters Filter the query with numeric, facet and/or tag filters. + * @param string|null $filters filter the query with numeric, facet and/or tag filters * * @return self */ @@ -869,7 +868,7 @@ public function getFacetFilters() /** * Sets facetFilters * - * @param string[]|null $facetFilters Filter hits by facet value. + * @param string[]|null $facetFilters filter hits by facet value * * @return self */ @@ -893,7 +892,7 @@ public function getOptionalFilters() /** * Sets optionalFilters * - * @param string[]|null $optionalFilters Create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter. + * @param string[]|null $optionalFilters create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter * * @return self */ @@ -917,7 +916,7 @@ public function getNumericFilters() /** * Sets numericFilters * - * @param string[]|null $numericFilters Filter on numeric attributes. + * @param string[]|null $numericFilters filter on numeric attributes * * @return self */ @@ -941,7 +940,7 @@ public function getTagFilters() /** * Sets tagFilters * - * @param string[]|null $tagFilters Filter hits by tags. + * @param string[]|null $tagFilters filter hits by tags * * @return self */ @@ -965,7 +964,7 @@ public function getSumOrFiltersScores() /** * Sets sumOrFiltersScores * - * @param bool|null $sumOrFiltersScores Determines how to calculate the total score for filtering. + * @param bool|null $sumOrFiltersScores determines how to calculate the total score for filtering * * @return self */ @@ -989,7 +988,7 @@ public function getFacets() /** * Sets facets * - * @param string[]|null $facets Retrieve facets and their facet values. + * @param string[]|null $facets retrieve facets and their facet values * * @return self */ @@ -1013,7 +1012,7 @@ public function getMaxValuesPerFacet() /** * Sets maxValuesPerFacet * - * @param int|null $maxValuesPerFacet Maximum number of facet values to return for each facet during a regular search. + * @param int|null $maxValuesPerFacet maximum number of facet values to return for each facet during a regular search * * @return self */ @@ -1037,7 +1036,7 @@ public function getFacetingAfterDistinct() /** * Sets facetingAfterDistinct * - * @param bool|null $facetingAfterDistinct Force faceting to be applied after de-duplication (via the Distinct setting). + * @param bool|null $facetingAfterDistinct force faceting to be applied after de-duplication (via the Distinct setting) * * @return self */ @@ -1061,7 +1060,7 @@ public function getSortFacetValuesBy() /** * Sets sortFacetValuesBy * - * @param string|null $sortFacetValuesBy Controls how facet values are fetched. + * @param string|null $sortFacetValuesBy controls how facet values are fetched * * @return self */ @@ -1085,7 +1084,7 @@ public function getPage() /** * Sets page * - * @param int|null $page Specify the page to retrieve. + * @param int|null $page specify the page to retrieve * * @return self */ @@ -1109,7 +1108,7 @@ public function getOffset() /** * Sets offset * - * @param int|null $offset Specify the offset of the first hit to return. + * @param int|null $offset specify the offset of the first hit to return * * @return self */ @@ -1133,13 +1132,12 @@ public function getLength() /** * Sets length * - * @param int|null $length Set the number of hits to retrieve (used only with offset). + * @param int|null $length set the number of hits to retrieve (used only with offset) * * @return self */ public function setLength($length) { - if (!is_null($length) && ($length > 1000)) { throw new \InvalidArgumentException('invalid value for $length when calling SearchParamsObject., must be smaller than or equal to 1000.'); } @@ -1165,7 +1163,7 @@ public function getAroundLatLng() /** * Sets aroundLatLng * - * @param string|null $aroundLatLng Search for entries around a central geolocation, enabling a geo search within a circular area. + * @param string|null $aroundLatLng search for entries around a central geolocation, enabling a geo search within a circular area * * @return self */ @@ -1189,7 +1187,7 @@ public function getAroundLatLngViaIP() /** * Sets aroundLatLngViaIP * - * @param bool|null $aroundLatLngViaIP Search for entries around a given location automatically computed from the requester's IP address. + * @param bool|null $aroundLatLngViaIP search for entries around a given location automatically computed from the requester's IP address * * @return self */ @@ -1213,7 +1211,7 @@ public function getAroundRadius() /** * Sets aroundRadius * - * @param OneOfIntegerString|null $aroundRadius Define the maximum radius for a geo search (in meters). + * @param OneOfIntegerString|null $aroundRadius define the maximum radius for a geo search (in meters) * * @return self */ @@ -1237,7 +1235,7 @@ public function getAroundPrecision() /** * Sets aroundPrecision * - * @param int|null $aroundPrecision Precision of geo search (in meters), to add grouping by geo location to the ranking formula. + * @param int|null $aroundPrecision precision of geo search (in meters), to add grouping by geo location to the ranking formula * * @return self */ @@ -1261,13 +1259,12 @@ public function getMinimumAroundRadius() /** * Sets minimumAroundRadius * - * @param int|null $minimumAroundRadius Minimum radius (in meters) used for a geo search when aroundRadius is not set. + * @param int|null $minimumAroundRadius minimum radius (in meters) used for a geo search when aroundRadius is not set * * @return self */ public function setMinimumAroundRadius($minimumAroundRadius) { - if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling SearchParamsObject., must be bigger than or equal to 1.'); } @@ -1290,7 +1287,7 @@ public function getInsideBoundingBox() /** * Sets insideBoundingBox * - * @param float[]|null $insideBoundingBox Search inside a rectangular area (in geo coordinates). + * @param float[]|null $insideBoundingBox search inside a rectangular area (in geo coordinates) * * @return self */ @@ -1314,7 +1311,7 @@ public function getInsidePolygon() /** * Sets insidePolygon * - * @param float[]|null $insidePolygon Search inside a polygon (in geo coordinates). + * @param float[]|null $insidePolygon search inside a polygon (in geo coordinates) * * @return self */ @@ -1362,7 +1359,7 @@ public function getRuleContexts() /** * Sets ruleContexts * - * @param string[]|null $ruleContexts Enables contextual rules. + * @param string[]|null $ruleContexts enables contextual rules * * @return self */ @@ -1386,7 +1383,7 @@ public function getPersonalizationImpact() /** * Sets personalizationImpact * - * @param int|null $personalizationImpact Define the impact of the Personalization feature. + * @param int|null $personalizationImpact define the impact of the Personalization feature * * @return self */ @@ -1410,7 +1407,7 @@ public function getUserToken() /** * Sets userToken * - * @param string|null $userToken Associates a certain user token with the current search. + * @param string|null $userToken associates a certain user token with the current search * * @return self */ @@ -1434,7 +1431,7 @@ public function getGetRankingInfo() /** * Sets getRankingInfo * - * @param bool|null $getRankingInfo Retrieve detailed ranking information. + * @param bool|null $getRankingInfo retrieve detailed ranking information * * @return self */ @@ -1458,7 +1455,7 @@ public function getClickAnalytics() /** * Sets clickAnalytics * - * @param bool|null $clickAnalytics Enable the Click Analytics feature. + * @param bool|null $clickAnalytics enable the Click Analytics feature * * @return self */ @@ -1482,7 +1479,7 @@ public function getAnalytics() /** * Sets analytics * - * @param bool|null $analytics Whether the current query will be taken into account in the Analytics. + * @param bool|null $analytics whether the current query will be taken into account in the Analytics * * @return self */ @@ -1506,7 +1503,7 @@ public function getAnalyticsTags() /** * Sets analyticsTags * - * @param string[]|null $analyticsTags List of tags to apply to the query for analytics purposes. + * @param string[]|null $analyticsTags list of tags to apply to the query for analytics purposes * * @return self */ @@ -1530,7 +1527,7 @@ public function getPercentileComputation() /** * Sets percentileComputation * - * @param bool|null $percentileComputation Whether to include or exclude a query from the processing-time percentile computation. + * @param bool|null $percentileComputation whether to include or exclude a query from the processing-time percentile computation * * @return self */ @@ -1554,7 +1551,7 @@ public function getEnableABTest() /** * Sets enableABTest * - * @param bool|null $enableABTest Whether this search should participate in running AB tests. + * @param bool|null $enableABTest whether this search should participate in running AB tests * * @return self */ @@ -1578,7 +1575,7 @@ public function getEnableReRanking() /** * Sets enableReRanking * - * @param bool|null $enableReRanking Whether this search should use AI Re-Ranking. + * @param bool|null $enableReRanking whether this search should use AI Re-Ranking * * @return self */ @@ -1602,7 +1599,7 @@ public function getQuery() /** * Sets query * - * @param string $query The text to search in the index. + * @param string $query the text to search in the index * * @return self */ @@ -1626,7 +1623,7 @@ public function getSearchableAttributes() /** * Sets searchableAttributes * - * @param string[]|null $searchableAttributes The complete list of attributes used for searching. + * @param string[]|null $searchableAttributes the complete list of attributes used for searching * * @return self */ @@ -1650,7 +1647,7 @@ public function getAttributesForFaceting() /** * Sets attributesForFaceting * - * @param string[]|null $attributesForFaceting The complete list of attributes that will be used for faceting. + * @param string[]|null $attributesForFaceting the complete list of attributes that will be used for faceting * * @return self */ @@ -1674,7 +1671,7 @@ public function getUnretrievableAttributes() /** * Sets unretrievableAttributes * - * @param string[]|null $unretrievableAttributes List of attributes that can't be retrieved at query time. + * @param string[]|null $unretrievableAttributes list of attributes that can't be retrieved at query time * * @return self */ @@ -1698,7 +1695,7 @@ public function getAttributesToRetrieve() /** * Sets attributesToRetrieve * - * @param string[]|null $attributesToRetrieve This parameter controls which attributes to retrieve and which not to retrieve. + * @param string[]|null $attributesToRetrieve this parameter controls which attributes to retrieve and which not to retrieve * * @return self */ @@ -1722,7 +1719,7 @@ public function getRestrictSearchableAttributes() /** * Sets restrictSearchableAttributes * - * @param string[]|null $restrictSearchableAttributes Restricts a given query to look in only a subset of your searchable attributes. + * @param string[]|null $restrictSearchableAttributes restricts a given query to look in only a subset of your searchable attributes * * @return self */ @@ -1746,7 +1743,7 @@ public function getRanking() /** * Sets ranking * - * @param string[]|null $ranking Controls how Algolia should sort your results. + * @param string[]|null $ranking controls how Algolia should sort your results * * @return self */ @@ -1770,7 +1767,7 @@ public function getCustomRanking() /** * Sets customRanking * - * @param string[]|null $customRanking Specifies the custom ranking criterion. + * @param string[]|null $customRanking specifies the custom ranking criterion * * @return self */ @@ -1794,7 +1791,7 @@ public function getRelevancyStrictness() /** * Sets relevancyStrictness * - * @param int|null $relevancyStrictness Controls the relevancy threshold below which less relevant results aren't included in the results. + * @param int|null $relevancyStrictness controls the relevancy threshold below which less relevant results aren't included in the results * * @return self */ @@ -1818,7 +1815,7 @@ public function getAttributesToHighlight() /** * Sets attributesToHighlight * - * @param string[]|null $attributesToHighlight List of attributes to highlight. + * @param string[]|null $attributesToHighlight list of attributes to highlight * * @return self */ @@ -1842,7 +1839,7 @@ public function getAttributesToSnippet() /** * Sets attributesToSnippet * - * @param string[]|null $attributesToSnippet List of attributes to snippet, with an optional maximum number of words to snippet. + * @param string[]|null $attributesToSnippet list of attributes to snippet, with an optional maximum number of words to snippet * * @return self */ @@ -1866,7 +1863,7 @@ public function getHighlightPreTag() /** * Sets highlightPreTag * - * @param string|null $highlightPreTag The HTML string to insert before the highlighted parts in all highlight and snippet results. + * @param string|null $highlightPreTag the HTML string to insert before the highlighted parts in all highlight and snippet results * * @return self */ @@ -1890,7 +1887,7 @@ public function getHighlightPostTag() /** * Sets highlightPostTag * - * @param string|null $highlightPostTag The HTML string to insert after the highlighted parts in all highlight and snippet results. + * @param string|null $highlightPostTag the HTML string to insert after the highlighted parts in all highlight and snippet results * * @return self */ @@ -1914,7 +1911,7 @@ public function getSnippetEllipsisText() /** * Sets snippetEllipsisText * - * @param string|null $snippetEllipsisText String used as an ellipsis indicator when a snippet is truncated. + * @param string|null $snippetEllipsisText string used as an ellipsis indicator when a snippet is truncated * * @return self */ @@ -1938,7 +1935,7 @@ public function getRestrictHighlightAndSnippetArrays() /** * Sets restrictHighlightAndSnippetArrays * - * @param bool|null $restrictHighlightAndSnippetArrays Restrict highlighting and snippeting to items that matched the query. + * @param bool|null $restrictHighlightAndSnippetArrays restrict highlighting and snippeting to items that matched the query * * @return self */ @@ -1962,7 +1959,7 @@ public function getHitsPerPage() /** * Sets hitsPerPage * - * @param int|null $hitsPerPage Set the number of hits per page. + * @param int|null $hitsPerPage set the number of hits per page * * @return self */ @@ -1986,7 +1983,7 @@ public function getMinWordSizefor1Typo() /** * Sets minWordSizefor1Typo * - * @param int|null $minWordSizefor1Typo Minimum number of characters a word in the query string must contain to accept matches with 1 typo. + * @param int|null $minWordSizefor1Typo minimum number of characters a word in the query string must contain to accept matches with 1 typo * * @return self */ @@ -2010,7 +2007,7 @@ public function getMinWordSizefor2Typos() /** * Sets minWordSizefor2Typos * - * @param int|null $minWordSizefor2Typos Minimum number of characters a word in the query string must contain to accept matches with 2 typos. + * @param int|null $minWordSizefor2Typos minimum number of characters a word in the query string must contain to accept matches with 2 typos * * @return self */ @@ -2034,7 +2031,7 @@ public function getTypoTolerance() /** * Sets typoTolerance * - * @param string|null $typoTolerance Controls whether typo tolerance is enabled and how it is applied. + * @param string|null $typoTolerance controls whether typo tolerance is enabled and how it is applied * * @return self */ @@ -2068,7 +2065,7 @@ public function getAllowTyposOnNumericTokens() /** * Sets allowTyposOnNumericTokens * - * @param bool|null $allowTyposOnNumericTokens Whether to allow typos on numbers (\"numeric tokens\") in the query string. + * @param bool|null $allowTyposOnNumericTokens whether to allow typos on numbers (\"numeric tokens\") in the query string * * @return self */ @@ -2092,7 +2089,7 @@ public function getDisableTypoToleranceOnAttributes() /** * Sets disableTypoToleranceOnAttributes * - * @param string[]|null $disableTypoToleranceOnAttributes List of attributes on which you want to disable typo tolerance. + * @param string[]|null $disableTypoToleranceOnAttributes list of attributes on which you want to disable typo tolerance * * @return self */ @@ -2116,7 +2113,7 @@ public function getSeparatorsToIndex() /** * Sets separatorsToIndex * - * @param string|null $separatorsToIndex Control which separators are indexed. + * @param string|null $separatorsToIndex control which separators are indexed * * @return self */ @@ -2140,7 +2137,7 @@ public function getIgnorePlurals() /** * Sets ignorePlurals * - * @param string|null $ignorePlurals Treats singular, plurals, and other forms of declensions as matching terms. + * @param string|null $ignorePlurals treats singular, plurals, and other forms of declensions as matching terms * * @return self */ @@ -2164,7 +2161,7 @@ public function getRemoveStopWords() /** * Sets removeStopWords * - * @param string|null $removeStopWords Removes stop (common) words from the query before executing it. + * @param string|null $removeStopWords removes stop (common) words from the query before executing it * * @return self */ @@ -2188,7 +2185,7 @@ public function getKeepDiacriticsOnCharacters() /** * Sets keepDiacriticsOnCharacters * - * @param string|null $keepDiacriticsOnCharacters List of characters that the engine shouldn't automatically normalize. + * @param string|null $keepDiacriticsOnCharacters list of characters that the engine shouldn't automatically normalize * * @return self */ @@ -2212,7 +2209,7 @@ public function getQueryLanguages() /** * Sets queryLanguages * - * @param string[]|null $queryLanguages Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection. + * @param string[]|null $queryLanguages sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection * * @return self */ @@ -2236,7 +2233,7 @@ public function getDecompoundQuery() /** * Sets decompoundQuery * - * @param bool|null $decompoundQuery Splits compound words into their composing atoms in the query. + * @param bool|null $decompoundQuery splits compound words into their composing atoms in the query * * @return self */ @@ -2260,7 +2257,7 @@ public function getEnableRules() /** * Sets enableRules * - * @param bool|null $enableRules Whether Rules should be globally enabled. + * @param bool|null $enableRules whether Rules should be globally enabled * * @return self */ @@ -2284,7 +2281,7 @@ public function getEnablePersonalization() /** * Sets enablePersonalization * - * @param bool|null $enablePersonalization Enable the Personalization feature. + * @param bool|null $enablePersonalization enable the Personalization feature * * @return self */ @@ -2308,7 +2305,7 @@ public function getQueryType() /** * Sets queryType * - * @param string|null $queryType Controls if and how query words are interpreted as prefixes. + * @param string|null $queryType controls if and how query words are interpreted as prefixes * * @return self */ @@ -2342,7 +2339,7 @@ public function getRemoveWordsIfNoResults() /** * Sets removeWordsIfNoResults * - * @param string|null $removeWordsIfNoResults Selects a strategy to remove words from the query when it doesn't match any hits. + * @param string|null $removeWordsIfNoResults selects a strategy to remove words from the query when it doesn't match any hits * * @return self */ @@ -2376,7 +2373,7 @@ public function getAdvancedSyntax() /** * Sets advancedSyntax * - * @param bool|null $advancedSyntax Enables the advanced query syntax. + * @param bool|null $advancedSyntax enables the advanced query syntax * * @return self */ @@ -2400,7 +2397,7 @@ public function getOptionalWords() /** * Sets optionalWords * - * @param string[]|null $optionalWords A list of words that should be considered as optional when found in the query. + * @param string[]|null $optionalWords a list of words that should be considered as optional when found in the query * * @return self */ @@ -2424,7 +2421,7 @@ public function getDisableExactOnAttributes() /** * Sets disableExactOnAttributes * - * @param string[]|null $disableExactOnAttributes List of attributes on which you want to disable the exact ranking criterion. + * @param string[]|null $disableExactOnAttributes list of attributes on which you want to disable the exact ranking criterion * * @return self */ @@ -2448,7 +2445,7 @@ public function getExactOnSingleWordQuery() /** * Sets exactOnSingleWordQuery * - * @param string|null $exactOnSingleWordQuery Controls how the exact ranking criterion is computed when the query contains only one word. + * @param string|null $exactOnSingleWordQuery controls how the exact ranking criterion is computed when the query contains only one word * * @return self */ @@ -2482,7 +2479,7 @@ public function getAlternativesAsExact() /** * Sets alternativesAsExact * - * @param string[]|null $alternativesAsExact List of alternatives that should be considered an exact match by the exact ranking criterion. + * @param string[]|null $alternativesAsExact list of alternatives that should be considered an exact match by the exact ranking criterion * * @return self */ @@ -2515,7 +2512,7 @@ public function getAdvancedSyntaxFeatures() /** * Sets advancedSyntaxFeatures * - * @param string[]|null $advancedSyntaxFeatures Allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled. + * @param string[]|null $advancedSyntaxFeatures allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled * * @return self */ @@ -2548,13 +2545,12 @@ public function getDistinct() /** * Sets distinct * - * @param int|null $distinct Enables de-duplication or grouping of results. + * @param int|null $distinct enables de-duplication or grouping of results * * @return self */ public function setDistinct($distinct) { - if (!is_null($distinct) && ($distinct > 4)) { throw new \InvalidArgumentException('invalid value for $distinct when calling SearchParamsObject., must be smaller than or equal to 4.'); } @@ -2580,7 +2576,7 @@ public function getSynonyms() /** * Sets synonyms * - * @param bool|null $synonyms Whether to take into account an index's synonyms for a particular search. + * @param bool|null $synonyms whether to take into account an index's synonyms for a particular search * * @return self */ @@ -2604,7 +2600,7 @@ public function getReplaceSynonymsInHighlight() /** * Sets replaceSynonymsInHighlight * - * @param bool|null $replaceSynonymsInHighlight Whether to highlight and snippet the original word that matches the synonym or the synonym itself. + * @param bool|null $replaceSynonymsInHighlight whether to highlight and snippet the original word that matches the synonym or the synonym itself * * @return self */ @@ -2628,13 +2624,12 @@ public function getMinProximity() /** * Sets minProximity * - * @param int|null $minProximity Precision of the proximity ranking criterion. + * @param int|null $minProximity precision of the proximity ranking criterion * * @return self */ public function setMinProximity($minProximity) { - if (!is_null($minProximity) && ($minProximity > 7)) { throw new \InvalidArgumentException('invalid value for $minProximity when calling SearchParamsObject., must be smaller than or equal to 7.'); } @@ -2690,7 +2685,6 @@ public function getMaxFacetHits() */ public function setMaxFacetHits($maxFacetHits) { - if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling SearchParamsObject., must be smaller than or equal to 100.'); } @@ -2713,7 +2707,7 @@ public function getAttributeCriteriaComputedByMinProximity() /** * Sets attributeCriteriaComputedByMinProximity * - * @param bool|null $attributeCriteriaComputedByMinProximity When attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage. + * @param bool|null $attributeCriteriaComputedByMinProximity when attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage * * @return self */ @@ -2750,9 +2744,9 @@ public function setRenderingContent($renderingContent) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -2762,7 +2756,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -2791,7 +2785,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -2802,14 +2796,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -2836,4 +2831,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchParamsString.php b/clients/algoliasearch-client-php/lib/Model/SearchParamsString.php index ad130c49c8..67a696312f 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchParamsString.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchParamsString.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchParamsString Class Doc Comment @@ -31,7 +31,7 @@ class SearchParamsString implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'params' => 'string' + 'params' => 'string', ]; /** @@ -42,7 +42,7 @@ class SearchParamsString implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'params' => null + 'params' => null, ]; /** @@ -72,7 +72,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'params' => 'params' + 'params' => 'params', ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'params' => 'setParams' + 'params' => 'setParams', ]; /** @@ -90,7 +90,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'params' => 'getParams' + 'params' => 'getParams', ]; /** @@ -134,7 +134,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -176,7 +175,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets params * @@ -190,7 +188,7 @@ public function getParams() /** * Sets params * - * @param string|null $params Search parameters as URL-encoded query string. + * @param string|null $params search parameters as URL-encoded query string * * @return self */ @@ -203,9 +201,9 @@ public function setParams($params) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -215,7 +213,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -244,7 +242,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -255,14 +253,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -289,4 +288,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchResponse.php index f5adcaad07..cc9398e50d 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchResponse Class Doc Comment @@ -55,7 +55,7 @@ class SearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'queryAfterRemoval' => 'string', 'serverUsed' => 'string', 'userData' => 'object', - 'hits' => '\Algolia\AlgoliaSearch\Model\Record[]' + 'hits' => '\Algolia\AlgoliaSearch\Model\Record[]', ]; /** @@ -90,7 +90,7 @@ class SearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'queryAfterRemoval' => null, 'serverUsed' => null, 'userData' => null, - 'hits' => null + 'hits' => null, ]; /** @@ -144,7 +144,7 @@ public static function openAPIFormats() 'queryAfterRemoval' => 'queryAfterRemoval', 'serverUsed' => 'serverUsed', 'userData' => 'userData', - 'hits' => 'hits' + 'hits' => 'hits', ]; /** @@ -177,7 +177,7 @@ public static function openAPIFormats() 'queryAfterRemoval' => 'setQueryAfterRemoval', 'serverUsed' => 'setServerUsed', 'userData' => 'setUserData', - 'hits' => 'setHits' + 'hits' => 'setHits', ]; /** @@ -210,7 +210,7 @@ public static function openAPIFormats() 'queryAfterRemoval' => 'getQueryAfterRemoval', 'serverUsed' => 'getServerUsed', 'userData' => 'getUserData', - 'hits' => 'getHits' + 'hits' => 'getHits', ]; /** @@ -254,7 +254,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -306,7 +305,7 @@ public function listInvalidProperties() { $invalidProperties = []; - if (!is_null($this->container['aroundLatLng']) && !preg_match("/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/", $this->container['aroundLatLng'])) { + if (!is_null($this->container['aroundLatLng']) && !preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $this->container['aroundLatLng'])) { $invalidProperties[] = "invalid value for 'aroundLatLng', must be conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."; } @@ -340,6 +339,7 @@ public function listInvalidProperties() if ($this->container['hits'] === null) { $invalidProperties[] = "'hits' can't be null"; } + return $invalidProperties; } @@ -354,7 +354,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets abTestID * @@ -368,7 +367,7 @@ public function getAbTestID() /** * Sets abTestID * - * @param int|null $abTestID If a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID. + * @param int|null $abTestID if a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID * * @return self */ @@ -392,7 +391,7 @@ public function getAbTestVariantID() /** * Sets abTestVariantID * - * @param int|null $abTestVariantID If a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used. + * @param int|null $abTestVariantID if a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used * * @return self */ @@ -416,14 +415,13 @@ public function getAroundLatLng() /** * Sets aroundLatLng * - * @param string|null $aroundLatLng The computed geo location. + * @param string|null $aroundLatLng the computed geo location * * @return self */ public function setAroundLatLng($aroundLatLng) { - - if (!is_null($aroundLatLng) && (!preg_match("/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/", $aroundLatLng))) { + if (!is_null($aroundLatLng) && (!preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $aroundLatLng))) { throw new \InvalidArgumentException("invalid value for $aroundLatLng when calling SearchResponse., must conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."); } @@ -469,7 +467,7 @@ public function getExhaustiveFacetsCount() /** * Sets exhaustiveFacetsCount * - * @param bool|null $exhaustiveFacetsCount Whether the facet count is exhaustive or approximate. + * @param bool|null $exhaustiveFacetsCount whether the facet count is exhaustive or approximate * * @return self */ @@ -541,7 +539,7 @@ public function getFacets() /** * Sets facets * - * @param array>|null $facets A mapping of each facet name to the corresponding facet counts. + * @param array>|null $facets a mapping of each facet name to the corresponding facet counts * * @return self */ @@ -565,7 +563,7 @@ public function getFacetsStats() /** * Sets facetsStats * - * @param array|null $facetsStats Statistics for numerical facets. + * @param array|null $facetsStats statistics for numerical facets * * @return self */ @@ -589,7 +587,7 @@ public function getHitsPerPage() /** * Sets hitsPerPage * - * @param int $hitsPerPage Set the number of hits per page. + * @param int $hitsPerPage set the number of hits per page * * @return self */ @@ -613,7 +611,7 @@ public function getIndex() /** * Sets index * - * @param string|null $index Index name used for the query. + * @param string|null $index index name used for the query * * @return self */ @@ -661,7 +659,7 @@ public function getMessage() /** * Sets message * - * @param string|null $message Used to return warnings about the query. + * @param string|null $message used to return warnings about the query * * @return self */ @@ -685,7 +683,7 @@ public function getNbHits() /** * Sets nbHits * - * @param int $nbHits Number of hits that the search query matched. + * @param int $nbHits number of hits that the search query matched * * @return self */ @@ -757,7 +755,7 @@ public function getPage() /** * Sets page * - * @param int $page Specify the page to retrieve. + * @param int $page specify the page to retrieve * * @return self */ @@ -781,7 +779,7 @@ public function getParams() /** * Sets params * - * @param string $params A url-encoded string of all search parameters. + * @param string $params a url-encoded string of all search parameters * * @return self */ @@ -805,7 +803,7 @@ public function getParsedQuery() /** * Sets parsedQuery * - * @param string|null $parsedQuery The query string that will be searched, after normalization. + * @param string|null $parsedQuery the query string that will be searched, after normalization * * @return self */ @@ -829,7 +827,7 @@ public function getProcessingTimeMS() /** * Sets processingTimeMS * - * @param int $processingTimeMS Time the server took to process the request, in milliseconds. + * @param int $processingTimeMS time the server took to process the request, in milliseconds * * @return self */ @@ -853,7 +851,7 @@ public function getQuery() /** * Sets query * - * @param string $query The text to search in the index. + * @param string $query the text to search in the index * * @return self */ @@ -877,7 +875,7 @@ public function getQueryAfterRemoval() /** * Sets queryAfterRemoval * - * @param string|null $queryAfterRemoval A markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set. + * @param string|null $queryAfterRemoval a markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set * * @return self */ @@ -901,7 +899,7 @@ public function getServerUsed() /** * Sets serverUsed * - * @param string|null $serverUsed Actual host name of the server that processed the request. + * @param string|null $serverUsed actual host name of the server that processed the request * * @return self */ @@ -925,7 +923,7 @@ public function getUserData() /** * Sets userData * - * @param object|null $userData Lets you store custom data in your indices. + * @param object|null $userData lets you store custom data in your indices * * @return self */ @@ -962,9 +960,9 @@ public function setHits($hits) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -974,7 +972,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -1003,7 +1001,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -1014,14 +1012,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -1048,4 +1047,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php b/clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php index 604d9db2ea..b679355452 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchRulesParams Class Doc Comment * * @category Class * @description Parameters for the search. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -38,7 +39,7 @@ class SearchRulesParams implements ModelInterface, ArrayAccess, \JsonSerializabl 'page' => 'int', 'hitsPerPage' => 'int', 'enabled' => 'bool', - 'requestOptions' => 'object[]' + 'requestOptions' => 'object[]', ]; /** @@ -55,7 +56,7 @@ class SearchRulesParams implements ModelInterface, ArrayAccess, \JsonSerializabl 'page' => null, 'hitsPerPage' => null, 'enabled' => null, - 'requestOptions' => null + 'requestOptions' => null, ]; /** @@ -91,7 +92,7 @@ public static function openAPIFormats() 'page' => 'page', 'hitsPerPage' => 'hitsPerPage', 'enabled' => 'enabled', - 'requestOptions' => 'requestOptions' + 'requestOptions' => 'requestOptions', ]; /** @@ -106,7 +107,7 @@ public static function openAPIFormats() 'page' => 'setPage', 'hitsPerPage' => 'setHitsPerPage', 'enabled' => 'setEnabled', - 'requestOptions' => 'setRequestOptions' + 'requestOptions' => 'setRequestOptions', ]; /** @@ -121,7 +122,7 @@ public static function openAPIFormats() 'page' => 'getPage', 'hitsPerPage' => 'getHitsPerPage', 'enabled' => 'getEnabled', - 'requestOptions' => 'getRequestOptions' + 'requestOptions' => 'getRequestOptions', ]; /** @@ -165,7 +166,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -213,7 +213,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets query * @@ -227,7 +226,7 @@ public function getQuery() /** * Sets query * - * @param string|null $query Full text query. + * @param string|null $query full text query * * @return self */ @@ -275,7 +274,7 @@ public function getContext() /** * Sets context * - * @param string|null $context Restricts matches to contextual rules with a specific context (exact match). + * @param string|null $context restricts matches to contextual rules with a specific context (exact match) * * @return self */ @@ -299,7 +298,7 @@ public function getPage() /** * Sets page * - * @param int|null $page Requested page (zero-based). + * @param int|null $page requested page (zero-based) * * @return self */ @@ -371,7 +370,7 @@ public function getRequestOptions() /** * Sets requestOptions * - * @param object[]|null $requestOptions A mapping of requestOptions to send along with the request. + * @param object[]|null $requestOptions a mapping of requestOptions to send along with the request * * @return self */ @@ -384,9 +383,9 @@ public function setRequestOptions($requestOptions) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -396,7 +395,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -425,7 +424,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -436,14 +435,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -470,4 +470,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php index 2bfe6387a8..7beafbe40c 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchRulesResponse Class Doc Comment @@ -34,7 +34,7 @@ class SearchRulesResponse implements ModelInterface, ArrayAccess, \JsonSerializa 'hits' => '\Algolia\AlgoliaSearch\Model\Rule[]', 'nbHits' => 'int', 'page' => 'int', - 'nbPages' => 'int' + 'nbPages' => 'int', ]; /** @@ -48,7 +48,7 @@ class SearchRulesResponse implements ModelInterface, ArrayAccess, \JsonSerializa 'hits' => null, 'nbHits' => null, 'page' => null, - 'nbPages' => null + 'nbPages' => null, ]; /** @@ -81,7 +81,7 @@ public static function openAPIFormats() 'hits' => 'hits', 'nbHits' => 'nbHits', 'page' => 'page', - 'nbPages' => 'nbPages' + 'nbPages' => 'nbPages', ]; /** @@ -93,7 +93,7 @@ public static function openAPIFormats() 'hits' => 'setHits', 'nbHits' => 'setNbHits', 'page' => 'setPage', - 'nbPages' => 'setNbPages' + 'nbPages' => 'setNbPages', ]; /** @@ -105,7 +105,7 @@ public static function openAPIFormats() 'hits' => 'getHits', 'nbHits' => 'getNbHits', 'page' => 'getPage', - 'nbPages' => 'getNbPages' + 'nbPages' => 'getNbPages', ]; /** @@ -149,7 +149,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -192,6 +191,7 @@ public function listInvalidProperties() if ($this->container['nbPages'] === null) { $invalidProperties[] = "'nbPages' can't be null"; } + return $invalidProperties; } @@ -206,7 +206,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets hits * @@ -220,7 +219,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\Rule[] $hits Fetched rules. + * @param \Algolia\AlgoliaSearch\Model\Rule[] $hits fetched rules * * @return self */ @@ -244,7 +243,7 @@ public function getNbHits() /** * Sets nbHits * - * @param int $nbHits Number of fetched rules. + * @param int $nbHits number of fetched rules * * @return self */ @@ -268,7 +267,7 @@ public function getPage() /** * Sets page * - * @param int $page Current page. + * @param int $page current page * * @return self */ @@ -292,7 +291,7 @@ public function getNbPages() /** * Sets nbPages * - * @param int $nbPages Number of pages. + * @param int $nbPages number of pages * * @return self */ @@ -305,9 +304,9 @@ public function setNbPages($nbPages) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -317,7 +316,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -346,7 +345,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -357,14 +356,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -391,4 +391,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php index 95e04a6329..d4c5c7b785 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchSynonymsResponse Class Doc Comment @@ -32,7 +32,7 @@ class SearchSynonymsResponse implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPITypes = [ 'hits' => '\Algolia\AlgoliaSearch\Model\SynonymHit[]', - 'nbHits' => 'int' + 'nbHits' => 'int', ]; /** @@ -44,7 +44,7 @@ class SearchSynonymsResponse implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPIFormats = [ 'hits' => null, - 'nbHits' => null + 'nbHits' => null, ]; /** @@ -75,7 +75,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'hits' => 'hits', - 'nbHits' => 'nbHits' + 'nbHits' => 'nbHits', ]; /** @@ -85,7 +85,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'hits' => 'setHits', - 'nbHits' => 'setNbHits' + 'nbHits' => 'setNbHits', ]; /** @@ -95,7 +95,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'hits' => 'getHits', - 'nbHits' => 'getNbHits' + 'nbHits' => 'getNbHits', ]; /** @@ -139,7 +139,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -174,6 +173,7 @@ public function listInvalidProperties() if ($this->container['nbHits'] === null) { $invalidProperties[] = "'nbHits' can't be null"; } + return $invalidProperties; } @@ -188,7 +188,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets hits * @@ -202,7 +201,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\SynonymHit[] $hits Array of synonym objects. + * @param \Algolia\AlgoliaSearch\Model\SynonymHit[] $hits array of synonym objects * * @return self */ @@ -226,7 +225,7 @@ public function getNbHits() /** * Sets nbHits * - * @param int $nbHits Number of hits that the search query matched. + * @param int $nbHits number of hits that the search query matched * * @return self */ @@ -239,9 +238,9 @@ public function setNbHits($nbHits) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -251,7 +250,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -280,7 +279,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -291,14 +290,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -325,4 +325,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php index 2db6a4eb66..b7e8b73076 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchUserIdsObject Class Doc Comment * * @category Class * @description OK + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -35,7 +36,7 @@ class SearchUserIdsObject implements ModelInterface, ArrayAccess, \JsonSerializa 'query' => 'string', 'clusterName' => 'string', 'page' => 'int', - 'hitsPerPage' => 'int' + 'hitsPerPage' => 'int', ]; /** @@ -49,7 +50,7 @@ class SearchUserIdsObject implements ModelInterface, ArrayAccess, \JsonSerializa 'query' => null, 'clusterName' => null, 'page' => null, - 'hitsPerPage' => null + 'hitsPerPage' => null, ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() 'query' => 'query', 'clusterName' => 'clusterName', 'page' => 'page', - 'hitsPerPage' => 'hitsPerPage' + 'hitsPerPage' => 'hitsPerPage', ]; /** @@ -94,7 +95,7 @@ public static function openAPIFormats() 'query' => 'setQuery', 'clusterName' => 'setClusterName', 'page' => 'setPage', - 'hitsPerPage' => 'setHitsPerPage' + 'hitsPerPage' => 'setHitsPerPage', ]; /** @@ -106,7 +107,7 @@ public static function openAPIFormats() 'query' => 'getQuery', 'clusterName' => 'getClusterName', 'page' => 'getPage', - 'hitsPerPage' => 'getHitsPerPage' + 'hitsPerPage' => 'getHitsPerPage', ]; /** @@ -150,7 +151,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -184,6 +184,7 @@ public function listInvalidProperties() if ($this->container['query'] === null) { $invalidProperties[] = "'query' can't be null"; } + return $invalidProperties; } @@ -198,7 +199,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets query * @@ -236,7 +236,7 @@ public function getClusterName() /** * Sets clusterName * - * @param string|null $clusterName Name of the cluster. + * @param string|null $clusterName name of the cluster * * @return self */ @@ -260,7 +260,7 @@ public function getPage() /** * Sets page * - * @param int|null $page Specify the page to retrieve. + * @param int|null $page specify the page to retrieve * * @return self */ @@ -284,7 +284,7 @@ public function getHitsPerPage() /** * Sets hitsPerPage * - * @param int|null $hitsPerPage Set the number of hits per page. + * @param int|null $hitsPerPage set the number of hits per page * * @return self */ @@ -297,9 +297,9 @@ public function setHitsPerPage($hitsPerPage) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -309,7 +309,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -338,7 +338,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -349,14 +349,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -383,4 +384,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php index 3c0a3ddf23..9e3f78f382 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchUserIdsResponse Class Doc Comment * * @category Class * @description userIDs data. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -36,7 +37,7 @@ class SearchUserIdsResponse implements ModelInterface, ArrayAccess, \JsonSeriali 'nbHits' => 'int', 'page' => 'int', 'hitsPerPage' => 'int', - 'updatedAt' => '\DateTime' + 'updatedAt' => '\DateTime', ]; /** @@ -51,7 +52,7 @@ class SearchUserIdsResponse implements ModelInterface, ArrayAccess, \JsonSeriali 'nbHits' => null, 'page' => null, 'hitsPerPage' => null, - 'updatedAt' => 'date-time' + 'updatedAt' => 'date-time', ]; /** @@ -85,7 +86,7 @@ public static function openAPIFormats() 'nbHits' => 'nbHits', 'page' => 'page', 'hitsPerPage' => 'hitsPerPage', - 'updatedAt' => 'updatedAt' + 'updatedAt' => 'updatedAt', ]; /** @@ -98,7 +99,7 @@ public static function openAPIFormats() 'nbHits' => 'setNbHits', 'page' => 'setPage', 'hitsPerPage' => 'setHitsPerPage', - 'updatedAt' => 'setUpdatedAt' + 'updatedAt' => 'setUpdatedAt', ]; /** @@ -111,7 +112,7 @@ public static function openAPIFormats() 'nbHits' => 'getNbHits', 'page' => 'getPage', 'hitsPerPage' => 'getHitsPerPage', - 'updatedAt' => 'getUpdatedAt' + 'updatedAt' => 'getUpdatedAt', ]; /** @@ -155,7 +156,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -202,6 +202,7 @@ public function listInvalidProperties() if ($this->container['updatedAt'] === null) { $invalidProperties[] = "'updatedAt' can't be null"; } + return $invalidProperties; } @@ -216,7 +217,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets hits * @@ -230,7 +230,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHits[] $hits List of user object matching the query. + * @param \Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHits[] $hits list of user object matching the query * * @return self */ @@ -254,7 +254,7 @@ public function getNbHits() /** * Sets nbHits * - * @param int $nbHits Number of hits that the search query matched. + * @param int $nbHits number of hits that the search query matched * * @return self */ @@ -278,7 +278,7 @@ public function getPage() /** * Sets page * - * @param int $page Specify the page to retrieve. + * @param int $page specify the page to retrieve * * @return self */ @@ -326,7 +326,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime $updatedAt Date of last update (ISO-8601 format). + * @param \DateTime $updatedAt date of last update (ISO-8601 format) * * @return self */ @@ -339,9 +339,9 @@ public function setUpdatedAt($updatedAt) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -351,7 +351,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -380,7 +380,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -391,14 +391,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -425,4 +426,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php index c51f5eb88d..70e0bf88c0 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchUserIdsResponseHighlightResult Class Doc Comment @@ -32,7 +32,7 @@ class SearchUserIdsResponseHighlightResult implements ModelInterface, ArrayAcces */ protected static $openAPITypes = [ 'userID' => '\Algolia\AlgoliaSearch\Model\HighlightResult', - 'clusterName' => '\Algolia\AlgoliaSearch\Model\HighlightResult' + 'clusterName' => '\Algolia\AlgoliaSearch\Model\HighlightResult', ]; /** @@ -44,7 +44,7 @@ class SearchUserIdsResponseHighlightResult implements ModelInterface, ArrayAcces */ protected static $openAPIFormats = [ 'userID' => null, - 'clusterName' => null + 'clusterName' => null, ]; /** @@ -75,7 +75,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'userID' => 'userID', - 'clusterName' => 'clusterName' + 'clusterName' => 'clusterName', ]; /** @@ -85,7 +85,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'userID' => 'setUserID', - 'clusterName' => 'setClusterName' + 'clusterName' => 'setClusterName', ]; /** @@ -95,7 +95,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'userID' => 'getUserID', - 'clusterName' => 'getClusterName' + 'clusterName' => 'getClusterName', ]; /** @@ -139,7 +139,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -174,6 +173,7 @@ public function listInvalidProperties() if ($this->container['clusterName'] === null) { $invalidProperties[] = "'clusterName' can't be null"; } + return $invalidProperties; } @@ -188,7 +188,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets userID * @@ -239,9 +238,9 @@ public function setClusterName($clusterName) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -251,7 +250,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -280,7 +279,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -291,14 +290,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -325,4 +325,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php index 66c19bf600..a0c622479c 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SearchUserIdsResponseHits Class Doc Comment @@ -36,7 +36,7 @@ class SearchUserIdsResponseHits implements ModelInterface, ArrayAccess, \JsonSer 'nbRecords' => 'int', 'dataSize' => 'int', 'objectID' => 'string', - 'highlightResult' => '\Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHighlightResult' + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHighlightResult', ]; /** @@ -52,7 +52,7 @@ class SearchUserIdsResponseHits implements ModelInterface, ArrayAccess, \JsonSer 'nbRecords' => null, 'dataSize' => null, 'objectID' => null, - 'highlightResult' => null + 'highlightResult' => null, ]; /** @@ -87,7 +87,7 @@ public static function openAPIFormats() 'nbRecords' => 'nbRecords', 'dataSize' => 'dataSize', 'objectID' => 'objectID', - 'highlightResult' => '_highlightResult' + 'highlightResult' => '_highlightResult', ]; /** @@ -101,7 +101,7 @@ public static function openAPIFormats() 'nbRecords' => 'setNbRecords', 'dataSize' => 'setDataSize', 'objectID' => 'setObjectID', - 'highlightResult' => 'setHighlightResult' + 'highlightResult' => 'setHighlightResult', ]; /** @@ -115,7 +115,7 @@ public static function openAPIFormats() 'nbRecords' => 'getNbRecords', 'dataSize' => 'getDataSize', 'objectID' => 'getObjectID', - 'highlightResult' => 'getHighlightResult' + 'highlightResult' => 'getHighlightResult', ]; /** @@ -159,7 +159,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -210,6 +209,7 @@ public function listInvalidProperties() if ($this->container['highlightResult'] === null) { $invalidProperties[] = "'highlightResult' can't be null"; } + return $invalidProperties; } @@ -224,7 +224,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets userID * @@ -262,7 +261,7 @@ public function getClusterName() /** * Sets clusterName * - * @param string $clusterName Name of the cluster. + * @param string $clusterName name of the cluster * * @return self */ @@ -286,7 +285,7 @@ public function getNbRecords() /** * Sets nbRecords * - * @param int $nbRecords Number of records in the cluster. + * @param int $nbRecords number of records in the cluster * * @return self */ @@ -310,7 +309,7 @@ public function getDataSize() /** * Sets dataSize * - * @param int $dataSize Data size taken by all the users assigned to the cluster. + * @param int $dataSize data size taken by all the users assigned to the cluster * * @return self */ @@ -371,9 +370,9 @@ public function setHighlightResult($highlightResult) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -383,7 +382,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -412,7 +411,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -423,14 +422,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -457,4 +457,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SnippetResult.php b/clients/algoliasearch-client-php/lib/Model/SnippetResult.php index a508bd46e3..7a700a298d 100644 --- a/clients/algoliasearch-client-php/lib/Model/SnippetResult.php +++ b/clients/algoliasearch-client-php/lib/Model/SnippetResult.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SnippetResult Class Doc Comment @@ -32,7 +32,7 @@ class SnippetResult implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'value' => 'string', - 'matchLevel' => 'string' + 'matchLevel' => 'string', ]; /** @@ -44,7 +44,7 @@ class SnippetResult implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'value' => null, - 'matchLevel' => null + 'matchLevel' => null, ]; /** @@ -75,7 +75,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'value' => 'value', - 'matchLevel' => 'matchLevel' + 'matchLevel' => 'matchLevel', ]; /** @@ -85,7 +85,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'value' => 'setValue', - 'matchLevel' => 'setMatchLevel' + 'matchLevel' => 'setMatchLevel', ]; /** @@ -95,7 +95,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'value' => 'getValue', - 'matchLevel' => 'getMatchLevel' + 'matchLevel' => 'getMatchLevel', ]; /** @@ -208,7 +208,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets value * @@ -222,7 +221,7 @@ public function getValue() /** * Sets value * - * @param string|null $value Markup text with occurrences highlighted. + * @param string|null $value markup text with occurrences highlighted * * @return self */ @@ -246,7 +245,7 @@ public function getMatchLevel() /** * Sets matchLevel * - * @param string|null $matchLevel Indicates how well the attribute matched the search query. + * @param string|null $matchLevel indicates how well the attribute matched the search query * * @return self */ @@ -269,9 +268,9 @@ public function setMatchLevel($matchLevel) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -281,7 +280,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -310,7 +309,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -321,14 +320,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -355,4 +355,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/Source.php b/clients/algoliasearch-client-php/lib/Model/Source.php index f78c6ba8fe..7aeceabdb5 100644 --- a/clients/algoliasearch-client-php/lib/Model/Source.php +++ b/clients/algoliasearch-client-php/lib/Model/Source.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * Source Class Doc Comment * * @category Class * @description The source. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -33,7 +34,7 @@ class Source implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'source' => 'string', - 'description' => 'string' + 'description' => 'string', ]; /** @@ -45,7 +46,7 @@ class Source implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'source' => null, - 'description' => null + 'description' => null, ]; /** @@ -76,7 +77,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'source' => 'source', - 'description' => 'description' + 'description' => 'description', ]; /** @@ -86,7 +87,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'source' => 'setSource', - 'description' => 'setDescription' + 'description' => 'setDescription', ]; /** @@ -96,7 +97,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'source' => 'getSource', - 'description' => 'getDescription' + 'description' => 'getDescription', ]; /** @@ -140,7 +141,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -172,6 +172,7 @@ public function listInvalidProperties() if ($this->container['source'] === null) { $invalidProperties[] = "'source' can't be null"; } + return $invalidProperties; } @@ -186,7 +187,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets source * @@ -200,7 +200,7 @@ public function getSource() /** * Sets source * - * @param string $source The IP range of the source. + * @param string $source the IP range of the source * * @return self */ @@ -224,7 +224,7 @@ public function getDescription() /** * Sets description * - * @param string|null $description The description of the source. + * @param string|null $description the description of the source * * @return self */ @@ -237,9 +237,9 @@ public function setDescription($description) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -249,7 +249,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -278,7 +278,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -289,14 +289,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -323,4 +324,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/StandardEntries.php b/clients/algoliasearch-client-php/lib/Model/StandardEntries.php index 88e8918f9f..6f5806400e 100644 --- a/clients/algoliasearch-client-php/lib/Model/StandardEntries.php +++ b/clients/algoliasearch-client-php/lib/Model/StandardEntries.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * StandardEntries Class Doc Comment * * @category Class * @description Map of language ISO code supported by the dictionary (e.g., \"en\" for English) to a boolean value. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -34,7 +35,7 @@ class StandardEntries implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'plurals' => 'array', 'stopwords' => 'array', - 'compounds' => 'array' + 'compounds' => 'array', ]; /** @@ -47,7 +48,7 @@ class StandardEntries implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'plurals' => null, 'stopwords' => null, - 'compounds' => null + 'compounds' => null, ]; /** @@ -79,7 +80,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'plurals' => 'plurals', 'stopwords' => 'stopwords', - 'compounds' => 'compounds' + 'compounds' => 'compounds', ]; /** @@ -90,7 +91,7 @@ public static function openAPIFormats() protected static $setters = [ 'plurals' => 'setPlurals', 'stopwords' => 'setStopwords', - 'compounds' => 'setCompounds' + 'compounds' => 'setCompounds', ]; /** @@ -101,7 +102,7 @@ public static function openAPIFormats() protected static $getters = [ 'plurals' => 'getPlurals', 'stopwords' => 'getStopwords', - 'compounds' => 'getCompounds' + 'compounds' => 'getCompounds', ]; /** @@ -145,7 +146,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -189,7 +189,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets plurals * @@ -203,7 +202,7 @@ public function getPlurals() /** * Sets plurals * - * @param array|null $plurals Language ISO code. + * @param array|null $plurals language ISO code * * @return self */ @@ -227,7 +226,7 @@ public function getStopwords() /** * Sets stopwords * - * @param array|null $stopwords Language ISO code. + * @param array|null $stopwords language ISO code * * @return self */ @@ -251,7 +250,7 @@ public function getCompounds() /** * Sets compounds * - * @param array|null $compounds Language ISO code. + * @param array|null $compounds language ISO code * * @return self */ @@ -264,9 +263,9 @@ public function setCompounds($compounds) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -276,7 +275,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -305,7 +304,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -316,14 +315,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -350,4 +350,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SynonymHit.php b/clients/algoliasearch-client-php/lib/Model/SynonymHit.php index cab013367c..1b049ea917 100644 --- a/clients/algoliasearch-client-php/lib/Model/SynonymHit.php +++ b/clients/algoliasearch-client-php/lib/Model/SynonymHit.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SynonymHit Class Doc Comment * * @category Class * @description Synonym object. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -40,7 +41,7 @@ class SynonymHit implements ModelInterface, ArrayAccess, \JsonSerializable 'corrections' => 'string[]', 'placeholder' => 'string', 'replacements' => 'string[]', - 'highlightResult' => '\Algolia\AlgoliaSearch\Model\SynonymHitHighlightResult' + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\SynonymHitHighlightResult', ]; /** @@ -59,7 +60,7 @@ class SynonymHit implements ModelInterface, ArrayAccess, \JsonSerializable 'corrections' => null, 'placeholder' => null, 'replacements' => null, - 'highlightResult' => null + 'highlightResult' => null, ]; /** @@ -97,7 +98,7 @@ public static function openAPIFormats() 'corrections' => 'corrections', 'placeholder' => 'placeholder', 'replacements' => 'replacements', - 'highlightResult' => '_highlightResult' + 'highlightResult' => '_highlightResult', ]; /** @@ -114,7 +115,7 @@ public static function openAPIFormats() 'corrections' => 'setCorrections', 'placeholder' => 'setPlaceholder', 'replacements' => 'setReplacements', - 'highlightResult' => 'setHighlightResult' + 'highlightResult' => 'setHighlightResult', ]; /** @@ -131,7 +132,7 @@ public static function openAPIFormats() 'corrections' => 'getCorrections', 'placeholder' => 'getPlaceholder', 'replacements' => 'getReplacements', - 'highlightResult' => 'getHighlightResult' + 'highlightResult' => 'getHighlightResult', ]; /** @@ -261,7 +262,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets objectID * @@ -275,7 +275,7 @@ public function getObjectID() /** * Sets objectID * - * @param string $objectID Unique identifier of the synonym object to be created or updated. + * @param string $objectID unique identifier of the synonym object to be created or updated * * @return self */ @@ -299,7 +299,7 @@ public function getType() /** * Sets type * - * @param string $type Type of the synonym object. + * @param string $type type of the synonym object * * @return self */ @@ -333,7 +333,7 @@ public function getSynonyms() /** * Sets synonyms * - * @param string[]|null $synonyms Words or phrases to be considered equivalent. + * @param string[]|null $synonyms words or phrases to be considered equivalent * * @return self */ @@ -357,7 +357,7 @@ public function getInput() /** * Sets input * - * @param string|null $input Word or phrase to appear in query strings (for onewaysynonym). + * @param string|null $input word or phrase to appear in query strings (for onewaysynonym) * * @return self */ @@ -381,7 +381,7 @@ public function getWord() /** * Sets word * - * @param string|null $word Word or phrase to appear in query strings (for altcorrection1 and altcorrection2). + * @param string|null $word word or phrase to appear in query strings (for altcorrection1 and altcorrection2) * * @return self */ @@ -405,7 +405,7 @@ public function getCorrections() /** * Sets corrections * - * @param string[]|null $corrections Words to be matched in records. + * @param string[]|null $corrections words to be matched in records * * @return self */ @@ -429,7 +429,7 @@ public function getPlaceholder() /** * Sets placeholder * - * @param string|null $placeholder Token to be put inside records. + * @param string|null $placeholder token to be put inside records * * @return self */ @@ -453,7 +453,7 @@ public function getReplacements() /** * Sets replacements * - * @param string[]|null $replacements List of query words that will match the token. + * @param string[]|null $replacements list of query words that will match the token * * @return self */ @@ -490,9 +490,9 @@ public function setHighlightResult($highlightResult) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -502,7 +502,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -531,7 +531,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -542,14 +542,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -576,4 +577,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php b/clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php index 5fc7fac8f2..fa78b4ce36 100644 --- a/clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php +++ b/clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * SynonymHitHighlightResult Class Doc Comment * * @category Class * @description Highlighted results + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -33,7 +34,7 @@ class SynonymHitHighlightResult implements ModelInterface, ArrayAccess, \JsonSer */ protected static $openAPITypes = [ 'type' => '\Algolia\AlgoliaSearch\Model\HighlightResult', - 'synonyms' => '\Algolia\AlgoliaSearch\Model\HighlightResult[]' + 'synonyms' => '\Algolia\AlgoliaSearch\Model\HighlightResult[]', ]; /** @@ -45,7 +46,7 @@ class SynonymHitHighlightResult implements ModelInterface, ArrayAccess, \JsonSer */ protected static $openAPIFormats = [ 'type' => null, - 'synonyms' => null + 'synonyms' => null, ]; /** @@ -76,7 +77,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'type' => 'type', - 'synonyms' => 'synonyms' + 'synonyms' => 'synonyms', ]; /** @@ -86,7 +87,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'type' => 'setType', - 'synonyms' => 'setSynonyms' + 'synonyms' => 'setSynonyms', ]; /** @@ -96,7 +97,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'type' => 'getType', - 'synonyms' => 'getSynonyms' + 'synonyms' => 'getSynonyms', ]; /** @@ -140,7 +141,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -183,7 +183,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets type * @@ -234,9 +233,9 @@ public function setSynonyms($synonyms) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -246,7 +245,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -275,7 +274,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -286,14 +285,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -320,4 +320,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/TimeRange.php b/clients/algoliasearch-client-php/lib/Model/TimeRange.php index d9b5b8ff4d..477e431dee 100644 --- a/clients/algoliasearch-client-php/lib/Model/TimeRange.php +++ b/clients/algoliasearch-client-php/lib/Model/TimeRange.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * TimeRange Class Doc Comment @@ -32,7 +32,7 @@ class TimeRange implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'from' => 'int', - 'until' => 'int' + 'until' => 'int', ]; /** @@ -44,7 +44,7 @@ class TimeRange implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'from' => null, - 'until' => null + 'until' => null, ]; /** @@ -75,7 +75,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'from' => 'from', - 'until' => 'until' + 'until' => 'until', ]; /** @@ -85,7 +85,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'from' => 'setFrom', - 'until' => 'setUntil' + 'until' => 'setUntil', ]; /** @@ -95,7 +95,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'from' => 'getFrom', - 'until' => 'getUntil' + 'until' => 'getUntil', ]; /** @@ -139,7 +139,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -174,6 +173,7 @@ public function listInvalidProperties() if ($this->container['until'] === null) { $invalidProperties[] = "'until' can't be null"; } + return $invalidProperties; } @@ -188,7 +188,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets from * @@ -202,7 +201,7 @@ public function getFrom() /** * Sets from * - * @param int $from Lower bound of the time range (Unix timestamp). + * @param int $from lower bound of the time range (Unix timestamp) * * @return self */ @@ -226,7 +225,7 @@ public function getUntil() /** * Sets until * - * @param int $until Upper bound of the time range (Unix timestamp). + * @param int $until upper bound of the time range (Unix timestamp) * * @return self */ @@ -239,9 +238,9 @@ public function setUntil($until) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -251,7 +250,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -280,7 +279,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -291,14 +290,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -325,4 +325,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php index 9030ab6488..6e20bb2dd1 100644 --- a/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * UpdateApiKeyResponse Class Doc Comment @@ -32,7 +32,7 @@ class UpdateApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPITypes = [ 'key' => 'string', - 'updatedAt' => '\DateTime' + 'updatedAt' => '\DateTime', ]; /** @@ -44,7 +44,7 @@ class UpdateApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPIFormats = [ 'key' => null, - 'updatedAt' => 'date-time' + 'updatedAt' => 'date-time', ]; /** @@ -75,7 +75,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'key' => 'key', - 'updatedAt' => 'updatedAt' + 'updatedAt' => 'updatedAt', ]; /** @@ -85,7 +85,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'key' => 'setKey', - 'updatedAt' => 'setUpdatedAt' + 'updatedAt' => 'setUpdatedAt', ]; /** @@ -95,7 +95,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'key' => 'getKey', - 'updatedAt' => 'getUpdatedAt' + 'updatedAt' => 'getUpdatedAt', ]; /** @@ -139,7 +139,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -174,6 +173,7 @@ public function listInvalidProperties() if ($this->container['updatedAt'] === null) { $invalidProperties[] = "'updatedAt' can't be null"; } + return $invalidProperties; } @@ -188,7 +188,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets key * @@ -202,7 +201,7 @@ public function getKey() /** * Sets key * - * @param string $key Key string. + * @param string $key key string * * @return self */ @@ -226,7 +225,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime $updatedAt Date of last update (ISO-8601 format). + * @param \DateTime $updatedAt date of last update (ISO-8601 format) * * @return self */ @@ -239,9 +238,9 @@ public function setUpdatedAt($updatedAt) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -251,7 +250,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -280,7 +279,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -291,14 +290,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -325,4 +325,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php index cc85dcb1ac..506732b308 100644 --- a/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * UpdatedAtResponse Class Doc Comment * * @category Class * @description The response with a taskID and an updatedAt timestamp. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -33,7 +34,7 @@ class UpdatedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPITypes = [ 'taskID' => 'int', - 'updatedAt' => '\DateTime' + 'updatedAt' => '\DateTime', ]; /** @@ -45,7 +46,7 @@ class UpdatedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPIFormats = [ 'taskID' => null, - 'updatedAt' => 'date-time' + 'updatedAt' => 'date-time', ]; /** @@ -76,7 +77,7 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'taskID' => 'taskID', - 'updatedAt' => 'updatedAt' + 'updatedAt' => 'updatedAt', ]; /** @@ -86,7 +87,7 @@ public static function openAPIFormats() */ protected static $setters = [ 'taskID' => 'setTaskID', - 'updatedAt' => 'setUpdatedAt' + 'updatedAt' => 'setUpdatedAt', ]; /** @@ -96,7 +97,7 @@ public static function openAPIFormats() */ protected static $getters = [ 'taskID' => 'getTaskID', - 'updatedAt' => 'getUpdatedAt' + 'updatedAt' => 'getUpdatedAt', ]; /** @@ -140,7 +141,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -175,6 +175,7 @@ public function listInvalidProperties() if ($this->container['updatedAt'] === null) { $invalidProperties[] = "'updatedAt' can't be null"; } + return $invalidProperties; } @@ -189,7 +190,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets taskID * @@ -203,7 +203,7 @@ public function getTaskID() /** * Sets taskID * - * @param int $taskID taskID of the indexing task to wait for. + * @param int $taskID taskID of the indexing task to wait for * * @return self */ @@ -227,7 +227,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime $updatedAt Date of last update (ISO-8601 format). + * @param \DateTime $updatedAt date of last update (ISO-8601 format) * * @return self */ @@ -240,9 +240,9 @@ public function setUpdatedAt($updatedAt) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -252,7 +252,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -281,7 +281,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -292,14 +292,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -326,4 +327,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php index 49fafad1cf..99ecebb94b 100644 --- a/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * UpdatedAtWithObjectIdResponse Class Doc Comment * * @category Class * @description The response with a taskID, an objectID and an updatedAt timestamp. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -34,7 +35,7 @@ class UpdatedAtWithObjectIdResponse implements ModelInterface, ArrayAccess, \Jso protected static $openAPITypes = [ 'taskID' => 'int', 'updatedAt' => '\DateTime', - 'objectID' => 'string' + 'objectID' => 'string', ]; /** @@ -47,7 +48,7 @@ class UpdatedAtWithObjectIdResponse implements ModelInterface, ArrayAccess, \Jso protected static $openAPIFormats = [ 'taskID' => null, 'updatedAt' => 'date-time', - 'objectID' => null + 'objectID' => null, ]; /** @@ -79,7 +80,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'taskID' => 'taskID', 'updatedAt' => 'updatedAt', - 'objectID' => 'objectID' + 'objectID' => 'objectID', ]; /** @@ -90,7 +91,7 @@ public static function openAPIFormats() protected static $setters = [ 'taskID' => 'setTaskID', 'updatedAt' => 'setUpdatedAt', - 'objectID' => 'setObjectID' + 'objectID' => 'setObjectID', ]; /** @@ -101,7 +102,7 @@ public static function openAPIFormats() protected static $getters = [ 'taskID' => 'getTaskID', 'updatedAt' => 'getUpdatedAt', - 'objectID' => 'getObjectID' + 'objectID' => 'getObjectID', ]; /** @@ -145,7 +146,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -189,7 +189,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets taskID * @@ -203,7 +202,7 @@ public function getTaskID() /** * Sets taskID * - * @param int|null $taskID taskID of the indexing task to wait for. + * @param int|null $taskID taskID of the indexing task to wait for * * @return self */ @@ -227,7 +226,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime|null $updatedAt Date of last update (ISO-8601 format). + * @param \DateTime|null $updatedAt date of last update (ISO-8601 format) * * @return self */ @@ -251,7 +250,7 @@ public function getObjectID() /** * Sets objectID * - * @param string|null $objectID Unique identifier of the object. + * @param string|null $objectID unique identifier of the object * * @return self */ @@ -264,9 +263,9 @@ public function setObjectID($objectID) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -276,7 +275,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -305,7 +304,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -316,14 +315,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -350,4 +350,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php index 2cc041c7a4..9c649c82d5 100644 --- a/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php @@ -2,8 +2,8 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * UpdatedRuleResponse Class Doc Comment @@ -33,7 +33,7 @@ class UpdatedRuleResponse implements ModelInterface, ArrayAccess, \JsonSerializa protected static $openAPITypes = [ 'objectID' => 'string', 'updatedAt' => '\DateTime', - 'taskID' => 'int' + 'taskID' => 'int', ]; /** @@ -46,7 +46,7 @@ class UpdatedRuleResponse implements ModelInterface, ArrayAccess, \JsonSerializa protected static $openAPIFormats = [ 'objectID' => null, 'updatedAt' => 'date-time', - 'taskID' => null + 'taskID' => null, ]; /** @@ -78,7 +78,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'objectID' => 'objectID', 'updatedAt' => 'updatedAt', - 'taskID' => 'taskID' + 'taskID' => 'taskID', ]; /** @@ -89,7 +89,7 @@ public static function openAPIFormats() protected static $setters = [ 'objectID' => 'setObjectID', 'updatedAt' => 'setUpdatedAt', - 'taskID' => 'setTaskID' + 'taskID' => 'setTaskID', ]; /** @@ -100,7 +100,7 @@ public static function openAPIFormats() protected static $getters = [ 'objectID' => 'getObjectID', 'updatedAt' => 'getUpdatedAt', - 'taskID' => 'getTaskID' + 'taskID' => 'getTaskID', ]; /** @@ -144,7 +144,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -183,6 +182,7 @@ public function listInvalidProperties() if ($this->container['taskID'] === null) { $invalidProperties[] = "'taskID' can't be null"; } + return $invalidProperties; } @@ -197,7 +197,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets objectID * @@ -211,7 +210,7 @@ public function getObjectID() /** * Sets objectID * - * @param string $objectID Unique identifier of the object. + * @param string $objectID unique identifier of the object * * @return self */ @@ -235,7 +234,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime $updatedAt Date of last update (ISO-8601 format). + * @param \DateTime $updatedAt date of last update (ISO-8601 format) * * @return self */ @@ -259,7 +258,7 @@ public function getTaskID() /** * Sets taskID * - * @param int $taskID taskID of the indexing task to wait for. + * @param int $taskID taskID of the indexing task to wait for * * @return self */ @@ -272,9 +271,9 @@ public function setTaskID($taskID) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -284,7 +283,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -313,7 +312,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -324,14 +323,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -358,4 +358,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/Model/UserId.php b/clients/algoliasearch-client-php/lib/Model/UserId.php index 84d828f010..a38f50c958 100644 --- a/clients/algoliasearch-client-php/lib/Model/UserId.php +++ b/clients/algoliasearch-client-php/lib/Model/UserId.php @@ -2,14 +2,15 @@ namespace Algolia\AlgoliaSearch\Model; -use \ArrayAccess; use \Algolia\AlgoliaSearch\ObjectSerializer; +use \ArrayAccess; /** * UserId Class Doc Comment * * @category Class * @description A userID. + * * @package Algolia\AlgoliaSearch * @implements \ArrayAccess * @template TKey int|null @@ -35,7 +36,7 @@ class UserId implements ModelInterface, ArrayAccess, \JsonSerializable 'userID' => 'string', 'clusterName' => 'string', 'nbRecords' => 'int', - 'dataSize' => 'int' + 'dataSize' => 'int', ]; /** @@ -49,7 +50,7 @@ class UserId implements ModelInterface, ArrayAccess, \JsonSerializable 'userID' => null, 'clusterName' => null, 'nbRecords' => null, - 'dataSize' => null + 'dataSize' => null, ]; /** @@ -82,7 +83,7 @@ public static function openAPIFormats() 'userID' => 'userID', 'clusterName' => 'clusterName', 'nbRecords' => 'nbRecords', - 'dataSize' => 'dataSize' + 'dataSize' => 'dataSize', ]; /** @@ -94,7 +95,7 @@ public static function openAPIFormats() 'userID' => 'setUserID', 'clusterName' => 'setClusterName', 'nbRecords' => 'setNbRecords', - 'dataSize' => 'setDataSize' + 'dataSize' => 'setDataSize', ]; /** @@ -106,7 +107,7 @@ public static function openAPIFormats() 'userID' => 'getUserID', 'clusterName' => 'getClusterName', 'nbRecords' => 'getNbRecords', - 'dataSize' => 'getDataSize' + 'dataSize' => 'getDataSize', ]; /** @@ -150,7 +151,6 @@ public function getModelName() return self::$openAPIModelName; } - /** * Associative array for storing property values * @@ -193,6 +193,7 @@ public function listInvalidProperties() if ($this->container['dataSize'] === null) { $invalidProperties[] = "'dataSize' can't be null"; } + return $invalidProperties; } @@ -207,7 +208,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets userID * @@ -221,7 +221,7 @@ public function getUserID() /** * Sets userID * - * @param string $userID userID of the user. + * @param string $userID userID of the user * * @return self */ @@ -245,7 +245,7 @@ public function getClusterName() /** * Sets clusterName * - * @param string $clusterName Cluster on which the user is assigned. + * @param string $clusterName cluster on which the user is assigned * * @return self */ @@ -269,7 +269,7 @@ public function getNbRecords() /** * Sets nbRecords * - * @param int $nbRecords Number of records belonging to the user. + * @param int $nbRecords number of records belonging to the user * * @return self */ @@ -293,7 +293,7 @@ public function getDataSize() /** * Sets dataSize * - * @param int $dataSize Data size used by the user. + * @param int $dataSize data size used by the user * * @return self */ @@ -306,9 +306,9 @@ public function setDataSize($dataSize) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param int $offset Offset * - * @return boolean + * @return bool */ public function offsetExists($offset) { @@ -318,7 +318,7 @@ public function offsetExists($offset) /** * Gets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return mixed|null */ @@ -347,7 +347,7 @@ public function offsetSet($offset, $value) /** * Unsets offset. * - * @param integer $offset Offset + * @param int $offset Offset * * @return void */ @@ -358,14 +358,15 @@ public function offsetUnset($offset) /** * Serializes the object to a value that can be serialized natively by json_encode(). + * * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource */ public function jsonSerialize() { - return ObjectSerializer::sanitizeForSerialization($this); + return ObjectSerializer::sanitizeForSerialization($this); } /** @@ -392,4 +393,3 @@ public function toHeaderValue() } } - diff --git a/clients/algoliasearch-client-php/lib/ObjectSerializer.php b/clients/algoliasearch-client-php/lib/ObjectSerializer.php index 25900ca3fa..b390c5fad0 100644 --- a/clients/algoliasearch-client-php/lib/ObjectSerializer.php +++ b/clients/algoliasearch-client-php/lib/ObjectSerializer.php @@ -48,6 +48,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); } + return $data; } @@ -65,6 +66,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n $allowedEnumTypes = $callable(); if (!in_array($value, $allowedEnumTypes, true)) { $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); } } @@ -74,14 +76,15 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } - return (object)$values; - } else { - return (string)$data; + + return (object) $values; } + + return (string) $data; } /** @@ -96,9 +99,9 @@ public static function sanitizeFilename($filename) { if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { return $match[1]; - } else { - return $filename; } + + return $filename; } /** @@ -128,9 +131,9 @@ public static function toQueryValue($object) { if (is_array($object)) { return implode(',', $object); - } else { - return self::toString($object); } + + return self::toString($object); } /** @@ -165,9 +168,9 @@ public static function toFormValue($value) { if ($value instanceof \SplFileObject) { return $value->getRealPath(); - } else { - return self::toString($value); } + + return self::toString($value); } /** @@ -186,9 +189,9 @@ public static function toString($value) return $value->format(self::$dateTimeFormat); } elseif (is_bool($value)) { return $value ? 'true' : 'false'; - } else { - return $value; } + + return $value; } /** @@ -244,41 +247,45 @@ public static function deserialize($data, $class, $httpHeaders = null) return null; } - if (strcasecmp(substr($class, -2), '[]') === 0) { + if (strcasecmp(mb_substr($class, -2), '[]') === 0) { $data = is_string($data) ? json_decode($data) : $data; if (!is_array($data)) { throw new \InvalidArgumentException("Invalid array '$class'"); } - $subClass = substr($class, 0, -2); + $subClass = mb_substr($class, 0, -2); $values = []; foreach ($data as $key => $value) { $values[] = self::deserialize($value, $subClass, null); } + return $values; } if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array $data = is_string($data) ? json_decode($data) : $data; settype($data, 'array'); - $inner = substr($class, 4, -1); + $inner = mb_substr($class, 4, -1); $deserialized = []; - if (strrpos($inner, ",") !== false) { + if (mb_strrpos($inner, ',') !== false) { $subClass_array = explode(',', $inner, 2); $subClass = $subClass_array[1]; foreach ($data as $key => $value) { $deserialized[$key] = self::deserialize($value, $subClass, null); } } + return $deserialized; } if ($class === 'object') { settype($data, 'array'); + return $data; - } else if ($class === 'mixed') { + } elseif ($class === 'mixed') { settype($data, gettype($data)); + return $data; } @@ -307,6 +314,7 @@ public static function deserialize($data, $class, $httpHeaders = null) /** @psalm-suppress ParadoxicalCondition */ if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); + return $data; } @@ -331,35 +339,37 @@ public static function deserialize($data, $class, $httpHeaders = null) } elseif (method_exists($class, 'getAllowableEnumValues')) { if (!in_array($data, $class::getAllowableEnumValues(), true)) { $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); } + return $data; - } else { - $data = is_string($data) ? json_decode($data) : $data; - // If a discriminator is defined and points to a valid subclass, use it. - $discriminator = $class::DISCRIMINATOR; - if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { - $subclass = '\Algolia\AlgoliaSearch\Model\\' . $data->{$discriminator}; - if (is_subclass_of($subclass, $class)) { - $class = $subclass; - } + } + $data = is_string($data) ? json_decode($data) : $data; + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Algolia\AlgoliaSearch\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; } + } - /** @var ModelInterface $instance */ - $instance = new $class(); - foreach ($instance::openAPITypes() as $property => $type) { - $propertySetter = $instance::setters()[$property]; + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; - if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { - continue; - } + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + continue; + } - if (isset($data->{$instance::attributeMap()[$property]})) { - $propertyValue = $data->{$instance::attributeMap()[$property]}; - $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); - } + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); } - return $instance; } + + return $instance; } } diff --git a/openapitools.json b/openapitools.json index 1d6f4ed672..4b292eb426 100644 --- a/openapitools.json +++ b/openapitools.json @@ -188,7 +188,8 @@ "gitRepoId": "algoliasearch-client-php", "invokerPackage": "Algolia\\AlgoliaSearch", "additionalProperties": { - "variableNamingConvention": "camelCase" + "variableNamingConvention": "camelCase", + "packageName": "algoliasearch-client-php" } } } diff --git a/scripts/post-gen/php.sh b/scripts/post-gen/php.sh new file mode 100755 index 0000000000..ced475c742 --- /dev/null +++ b/scripts/post-gen/php.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e +export GENERATOR=$1 +export CLIENT=$(cat openapitools.json | jq -r --arg generator "$GENERATOR" '."generator-cli".generators[$generator].output' | sed 's/#{cwd}\///g') + +lint_client() { + + echo "> Linting ${GENERATOR}..." + cd $CLIENT + composer install + PHP_CS_FIXER_IGNORE_ENV=1 php vendor/bin/php-cs-fixer fix lib/ -v --using-cache=no --allow-risky=yes + +} + +lint_client diff --git a/templates/php/.php-cs-fixer.php b/templates/php/.php-cs-fixer.php new file mode 100644 index 0000000000..96dde31c05 --- /dev/null +++ b/templates/php/.php-cs-fixer.php @@ -0,0 +1,63 @@ +setUsingCache(true) + ->setRules([ + 'array_syntax' => [ 'syntax' => 'short' ], + 'blank_line_after_namespace' => false, + 'blank_line_after_opening_tag' => true, + 'blank_line_before_statement' => true, + 'braces' => false, + 'cast_spaces' => true, + 'combine_consecutive_unsets' => true, + 'echo_tag_syntax' => true, + 'general_phpdoc_tag_rename' => true, + 'mb_str_functions' => true, + 'no_blank_lines_after_class_opening' => true, + 'no_empty_phpdoc' => true, + 'no_empty_statement' => true, + 'no_extra_blank_lines' => true, + 'no_multiline_whitespace_around_double_arrow' => true, + 'no_short_bool_cast' => true, + 'no_trailing_whitespace' => true, + 'no_trailing_whitespace_in_comment' => false, + 'no_unneeded_control_parentheses' => true, + 'no_unreachable_default_argument_value' => true, + 'no_unused_imports' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, + 'no_whitespace_before_comma_in_array' => true, + 'no_whitespace_in_blank_line' => true, + 'normalize_index_brace' => true, + 'not_operator_with_space' => false, + 'object_operator_without_whitespace' => true, + 'ordered_imports' => true, + 'phpdoc_annotation_without_dot' => true, + 'phpdoc_inline_tag_normalizer' => true, + 'phpdoc_order' => true, + 'phpdoc_scalar' => true, + 'phpdoc_separation' => true, + 'phpdoc_single_line_var_spacing' => true, + 'phpdoc_tag_type' => true, + 'protected_to_private' => true, + '@PSR2' => true, + 'short_scalar_cast' => true, + 'single_blank_line_at_eof' => false, + 'single_blank_line_before_namespace' => true, + 'single_quote' => true, + 'space_after_semicolon' => true, + 'standardize_not_equals' => true, + 'strict_comparison' => true, + 'strict_param' => true, + 'ternary_operator_spaces' => true, + 'trailing_comma_in_multiline' => true, + 'trim_array_spaces' => true, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->exclude('test') + ->exclude('tests') + ->in(__DIR__) + ); diff --git a/templates/php/.php_cs b/templates/php/.php_cs deleted file mode 100644 index 4fbe53ec5f..0000000000 --- a/templates/php/.php_cs +++ /dev/null @@ -1,23 +0,0 @@ -setUsingCache(true) - ->setRules([ - '@PSR2' => true, - 'ordered_imports' => true, - 'phpdoc_order' => true, - 'array_syntax' => [ 'syntax' => 'short' ], - 'strict_comparison' => true, - 'strict_param' => true, - 'no_trailing_whitespace' => false, - 'no_trailing_whitespace_in_comment' => false, - 'braces' => false, - 'single_blank_line_at_eof' => false, - 'blank_line_after_namespace' => false, - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude('test') - ->exclude('tests') - ->in(__DIR__) - ); diff --git a/templates/php/gitignore b/templates/php/gitignore index 3d513912a6..aa44c17b5e 100644 --- a/templates/php/gitignore +++ b/templates/php/gitignore @@ -10,3 +10,4 @@ composer.phar .phpunit.result.cache .openapi-generator/ +composer.lock From 0fc486fc041c705620d6dd7f2b179cdfa476cd7c Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Mon, 24 Jan 2022 17:49:12 +0100 Subject: [PATCH 08/26] feat(php): Add Retry Strategy & cache for the PHP client (#95) --- Dockerfile | 3 + .../algoliasearch-client-php/composer.json | 13 +- .../algoliasearch-client-php/lib/Algolia.php | 118 + .../lib/Api/SearchApi.php | 1700 ++--------- .../lib/Cache/FileCacheDriver.php | 117 + .../lib/Cache/NullCacheDriver.php | 78 + .../lib/Configuration.php | 475 --- .../lib/Configuration/AbstractConfig.php | 164 ++ .../lib/Configuration/Configuration.php | 255 ++ .../lib/Exceptions/AlgoliaException.php | 7 + .../lib/Exceptions/BadRequestException.php | 7 + .../lib/Exceptions/CannotWaitException.php | 7 + .../lib/Exceptions/MissingObjectId.php | 7 + .../lib/Exceptions/NotFoundException.php | 7 + .../Exceptions/ObjectNotFoundException.php | 7 + .../lib/Exceptions/RequestException.php | 22 + .../lib/Exceptions/RetriableException.php | 7 + .../lib/Exceptions/UnreachableException.php | 15 + .../ValidUntilNotFoundException.php | 7 + .../lib/Http/CurlHttpClient.php | 131 + .../lib/Http/GuzzleHttpClient.php | 62 + .../lib/Http/HttpClientInterface.php | 24 + .../lib/Http/Psr7/BufferStream.php | 141 + .../lib/Http/Psr7/PumpStream.php | 169 ++ .../lib/Http/Psr7/Request.php | 308 ++ .../lib/Http/Psr7/Response.php | 314 ++ .../lib/Http/Psr7/Stream.php | 278 ++ .../lib/Http/Psr7/Uri.php | 716 +++++ .../lib/Http/Psr7/UriResolver.php | 227 ++ .../lib/Http/Psr7/functions.php | 82 + .../lib/Log/DebugLogger.php | 57 + .../lib/Model/AddApiKeyResponse.php | 8 +- .../lib/Model/BatchResponse.php | 2 +- .../lib/Model/CreatedAtObject.php | 8 +- .../lib/Model/CreatedAtResponse.php | 8 +- .../lib/Model/DeleteApiKeyResponse.php | 8 +- .../lib/Model/DeleteSourceResponse.php | 8 +- .../lib/Model/DeletedAtResponse.php | 10 +- .../lib/Model/Index.php | 16 +- .../lib/Model/KeyObject.php | 8 +- .../lib/Model/RemoveUserIdResponse.php | 8 +- .../lib/Model/ReplaceSourceResponse.php | 8 +- .../lib/Model/SaveObjectResponse.php | 2 +- .../lib/Model/SaveSynonymResponse.php | 10 +- .../lib/Model/SearchUserIdsResponse.php | 8 +- .../lib/Model/UpdateApiKeyResponse.php | 8 +- .../lib/Model/UpdatedAtResponse.php | 10 +- .../Model/UpdatedAtWithObjectIdResponse.php | 10 +- .../lib/Model/UpdatedRuleResponse.php | 10 +- .../lib/RequestOptions/RequestOptions.php | 368 +++ .../RequestOptions/RequestOptionsFactory.php | 132 + .../lib/RetryStrategy/ApiWrapper.php | 269 ++ .../lib/RetryStrategy/ApiWrapperInterface.php | 12 + .../lib/RetryStrategy/ClusterHosts.php | 181 ++ .../lib/RetryStrategy/Host.php | 65 + .../lib/RetryStrategy/HostCollection.php | 85 + .../lib/Support/Helpers.php | 144 + .../lib/Support/UserAgent.php | 59 + playground/php/composer.json | 6 +- playground/php/composer.lock | 2545 ++--------------- playground/php/src/search.php | 9 +- scripts/builds/clients.sh | 3 + scripts/playground.sh | 6 + scripts/post-gen/php.sh | 15 +- templates/php/Configuration.mustache | 268 +- templates/php/api.mustache | 286 +- templates/php/composer.mustache | 13 +- 67 files changed, 5330 insertions(+), 4811 deletions(-) create mode 100644 clients/algoliasearch-client-php/lib/Algolia.php create mode 100644 clients/algoliasearch-client-php/lib/Cache/FileCacheDriver.php create mode 100644 clients/algoliasearch-client-php/lib/Cache/NullCacheDriver.php delete mode 100644 clients/algoliasearch-client-php/lib/Configuration.php create mode 100644 clients/algoliasearch-client-php/lib/Configuration/AbstractConfig.php create mode 100644 clients/algoliasearch-client-php/lib/Configuration/Configuration.php create mode 100644 clients/algoliasearch-client-php/lib/Exceptions/AlgoliaException.php create mode 100644 clients/algoliasearch-client-php/lib/Exceptions/BadRequestException.php create mode 100644 clients/algoliasearch-client-php/lib/Exceptions/CannotWaitException.php create mode 100644 clients/algoliasearch-client-php/lib/Exceptions/MissingObjectId.php create mode 100644 clients/algoliasearch-client-php/lib/Exceptions/NotFoundException.php create mode 100644 clients/algoliasearch-client-php/lib/Exceptions/ObjectNotFoundException.php create mode 100644 clients/algoliasearch-client-php/lib/Exceptions/RequestException.php create mode 100644 clients/algoliasearch-client-php/lib/Exceptions/RetriableException.php create mode 100644 clients/algoliasearch-client-php/lib/Exceptions/UnreachableException.php create mode 100644 clients/algoliasearch-client-php/lib/Exceptions/ValidUntilNotFoundException.php create mode 100644 clients/algoliasearch-client-php/lib/Http/CurlHttpClient.php create mode 100644 clients/algoliasearch-client-php/lib/Http/GuzzleHttpClient.php create mode 100644 clients/algoliasearch-client-php/lib/Http/HttpClientInterface.php create mode 100644 clients/algoliasearch-client-php/lib/Http/Psr7/BufferStream.php create mode 100644 clients/algoliasearch-client-php/lib/Http/Psr7/PumpStream.php create mode 100644 clients/algoliasearch-client-php/lib/Http/Psr7/Request.php create mode 100644 clients/algoliasearch-client-php/lib/Http/Psr7/Response.php create mode 100644 clients/algoliasearch-client-php/lib/Http/Psr7/Stream.php create mode 100644 clients/algoliasearch-client-php/lib/Http/Psr7/Uri.php create mode 100644 clients/algoliasearch-client-php/lib/Http/Psr7/UriResolver.php create mode 100644 clients/algoliasearch-client-php/lib/Http/Psr7/functions.php create mode 100644 clients/algoliasearch-client-php/lib/Log/DebugLogger.php create mode 100644 clients/algoliasearch-client-php/lib/RequestOptions/RequestOptions.php create mode 100644 clients/algoliasearch-client-php/lib/RequestOptions/RequestOptionsFactory.php create mode 100644 clients/algoliasearch-client-php/lib/RetryStrategy/ApiWrapper.php create mode 100644 clients/algoliasearch-client-php/lib/RetryStrategy/ApiWrapperInterface.php create mode 100644 clients/algoliasearch-client-php/lib/RetryStrategy/ClusterHosts.php create mode 100644 clients/algoliasearch-client-php/lib/RetryStrategy/Host.php create mode 100644 clients/algoliasearch-client-php/lib/RetryStrategy/HostCollection.php create mode 100644 clients/algoliasearch-client-php/lib/Support/Helpers.php create mode 100644 clients/algoliasearch-client-php/lib/Support/UserAgent.php diff --git a/Dockerfile b/Dockerfile index a624d90565..422bd8ba70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,9 @@ ENV DOCKER=true RUN apk add openjdk11 maven jq bash perl curl +# PHP dependencies +RUN apk add composer php8 php8-tokenizer + WORKDIR /app CMD ["bash"] diff --git a/clients/algoliasearch-client-php/composer.json b/clients/algoliasearch-client-php/composer.json index 4dbf465eca..f7ff1822e9 100644 --- a/clients/algoliasearch-client-php/composer.json +++ b/clients/algoliasearch-client-php/composer.json @@ -24,14 +24,19 @@ "ext-json": "*", "ext-mbstring": "*", "guzzlehttp/guzzle": "^7.3", - "guzzlehttp/psr7": "^2.0" + "guzzlehttp/psr7": "^2.0", + "psr/http-message": "^1.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" }, "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0", - "friendsofphp/php-cs-fixer": "^2.12" + "friendsofphp/php-cs-fixer": "^3.5.0" }, "autoload": { - "psr-4": { "Algolia\\AlgoliaSearch\\" : "lib/" } + "psr-4": { "Algolia\\AlgoliaSearch\\" : "lib/" }, + "files": [ + "lib/Http/Psr7/functions.php" + ] }, "autoload-dev": { "psr-4": { "Algolia\\AlgoliaSearch\\Test\\" : "test/" } diff --git a/clients/algoliasearch-client-php/lib/Algolia.php b/clients/algoliasearch-client-php/lib/Algolia.php new file mode 100644 index 0000000000..12d02e0e5b --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Algolia.php @@ -0,0 +1,118 @@ +config = $config ?: new Configuration(); + $this->config = $config; - $this->client = new Client(); + $this->api = $apiWrapper; $this->headerSelector = new HeaderSelector(); - $this->hostIndex = 0; } /** - * Set the host index + * Instantiate the client with basic credentials * - * @param int $hostIndex Host index (required) + * @param string $appId Application ID + * @param string $apiKey Algolia API Key */ - public function setHostIndex($hostIndex): void + public static function create($appId = null, $apiKey = null) { - $this->hostIndex = $hostIndex; + return static::createWithConfig(Configuration::create($appId, $apiKey)); } /** - * Get the host index + * Instantiate the client with congiguration * - * @return int Host index + * @param Configuration $config Configuration */ - public function getHostIndex() + public static function createWithConfig(Configuration $config) { - return $this->hostIndex; + $config = clone $config; + + $cacheKey = sprintf('%s-clusterHosts-%s', __CLASS__, $config->getAppId()); + + if ($hosts = $config->getHosts()) { + // If a list of hosts was passed, we ignore the cache + $clusterHosts = ClusterHosts::create($hosts); + } elseif (false === ($clusterHosts = ClusterHosts::createFromCache($cacheKey))) { + // We'll try to restore the ClusterHost from cache, if we cannot + // we create a new instance and set the cache key + $clusterHosts = ClusterHosts::createFromAppId($config->getAppId()) + ->setCacheKey($cacheKey); + } + + $apiWrapper = new ApiWrapper( + Algolia::getHttpClient(), + $config, + $clusterHosts + ); + + return new static($apiWrapper, $config); } /** @@ -105,23 +118,13 @@ public function addApiKey($apiKey) $resourcePath = '/1/keys'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); if (isset($apiKey)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($apiKey)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $apiKey; } $defaultHeaders = []; @@ -136,18 +139,8 @@ public function addApiKey($apiKey) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\AddApiKeyResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation addOrUpdateObject @@ -187,7 +180,7 @@ public function addOrUpdateObject($indexName, $objectID, $body) $resourcePath = '/1/indexes/{indexName}/{objectID}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -209,17 +202,7 @@ public function addOrUpdateObject($indexName, $objectID, $body) ['application/json'] ); if (isset($body)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $body; } $defaultHeaders = []; @@ -234,18 +217,8 @@ public function addOrUpdateObject($indexName, $objectID, $body) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('PUT', $resourcePath, $query, $httpBody); } /** * Operation appendSource @@ -269,23 +242,13 @@ public function appendSource($source) $resourcePath = '/1/security/sources/append'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); if (isset($source)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($source)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $source; } $defaultHeaders = []; @@ -300,18 +263,8 @@ public function appendSource($source) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\CreatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation assignUserId @@ -348,7 +301,7 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdObject) $resourcePath = '/1/clusters/mapping'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($xAlgoliaUserID)) { $xAlgoliaUserID = ObjectSerializer::serializeCollection($xAlgoliaUserID, '', true); @@ -361,17 +314,7 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdObject) ['application/json'] ); if (isset($assignUserIdObject)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($assignUserIdObject)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $assignUserIdObject; } $defaultHeaders = []; @@ -386,18 +329,8 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdObject) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\CreatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation batch @@ -428,7 +361,7 @@ public function batch($indexName, $batchWriteObject) $resourcePath = '/1/indexes/{indexName}/batch'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -442,17 +375,7 @@ public function batch($indexName, $batchWriteObject) ['application/json'] ); if (isset($batchWriteObject)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($batchWriteObject)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $batchWriteObject; } $defaultHeaders = []; @@ -467,18 +390,8 @@ public function batch($indexName, $batchWriteObject) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\BatchResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation batchAssignUserIds @@ -515,7 +428,7 @@ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject) $resourcePath = '/1/clusters/mapping/batch'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($xAlgoliaUserID)) { $xAlgoliaUserID = ObjectSerializer::serializeCollection($xAlgoliaUserID, '', true); @@ -528,17 +441,7 @@ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject) ['application/json'] ); if (isset($batchAssignUserIdsObject)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($batchAssignUserIdsObject)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $batchAssignUserIdsObject; } $defaultHeaders = []; @@ -553,18 +456,8 @@ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\CreatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation batchDictionaryEntries @@ -597,7 +490,7 @@ public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntries) $resourcePath = '/1/dictionaries/{dictionaryName}/batch'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($dictionaryName !== null) { $resourcePath = str_replace( @@ -611,17 +504,7 @@ public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntries) ['application/json'] ); if (isset($batchDictionaryEntries)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($batchDictionaryEntries)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $batchDictionaryEntries; } $defaultHeaders = []; @@ -636,18 +519,8 @@ public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntries) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation batchRules @@ -682,7 +555,7 @@ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearE $resourcePath = '/1/indexes/{indexName}/rules/batch'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($forwardToReplicas)) { $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); @@ -710,17 +583,7 @@ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearE ['application/json'] ); if (isset($rule)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($rule)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $rule; } $defaultHeaders = []; @@ -735,18 +598,8 @@ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearE ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation browse @@ -773,7 +626,7 @@ public function browse($indexName, $browseRequest = null) $resourcePath = '/1/indexes/{indexName}/browse'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -787,17 +640,7 @@ public function browse($indexName, $browseRequest = null) ['application/json'] ); if (isset($browseRequest)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($browseRequest)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $browseRequest; } $defaultHeaders = []; @@ -812,18 +655,8 @@ public function browse($indexName, $browseRequest = null) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\BrowseResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation clearAllSynonyms @@ -850,7 +683,7 @@ public function clearAllSynonyms($indexName, $forwardToReplicas = null) $resourcePath = '/1/indexes/{indexName}/synonyms/clear'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($forwardToReplicas)) { $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); @@ -870,16 +703,6 @@ public function clearAllSynonyms($indexName, $forwardToReplicas = null) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -893,18 +716,8 @@ public function clearAllSynonyms($indexName, $forwardToReplicas = null) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation clearObjects @@ -930,7 +743,7 @@ public function clearObjects($indexName) $resourcePath = '/1/indexes/{indexName}/clear'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -943,16 +756,6 @@ public function clearObjects($indexName) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -966,18 +769,8 @@ public function clearObjects($indexName) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation clearRules @@ -1004,7 +797,7 @@ public function clearRules($indexName, $forwardToReplicas = null) $resourcePath = '/1/indexes/{indexName}/rules/clear'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($forwardToReplicas)) { $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); @@ -1024,16 +817,6 @@ public function clearRules($indexName, $forwardToReplicas = null) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1047,18 +830,8 @@ public function clearRules($indexName, $forwardToReplicas = null) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation deleteApiKey @@ -1084,7 +857,7 @@ public function deleteApiKey($key) $resourcePath = '/1/keys/{key}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($key !== null) { $resourcePath = str_replace( @@ -1097,16 +870,6 @@ public function deleteApiKey($key) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1120,18 +883,8 @@ public function deleteApiKey($key) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeleteApiKeyResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('DELETE', $resourcePath, $query, $httpBody); } /** * Operation deleteBy @@ -1164,7 +917,7 @@ public function deleteBy($indexName, $searchParams) $resourcePath = '/1/indexes/{indexName}/deleteByQuery'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -1178,17 +931,7 @@ public function deleteBy($indexName, $searchParams) ['application/json'] ); if (isset($searchParams)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchParams)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $searchParams; } $defaultHeaders = []; @@ -1203,18 +946,8 @@ public function deleteBy($indexName, $searchParams) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeletedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation deleteIndex @@ -1240,7 +973,7 @@ public function deleteIndex($indexName) $resourcePath = '/1/indexes/{indexName}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -1253,16 +986,6 @@ public function deleteIndex($indexName) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1276,18 +999,8 @@ public function deleteIndex($indexName) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeletedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('DELETE', $resourcePath, $query, $httpBody); } /** * Operation deleteObject @@ -1320,7 +1033,7 @@ public function deleteObject($indexName, $objectID) $resourcePath = '/1/indexes/{indexName}/{objectID}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -1341,16 +1054,6 @@ public function deleteObject($indexName, $objectID) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1364,18 +1067,8 @@ public function deleteObject($indexName, $objectID) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeletedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('DELETE', $resourcePath, $query, $httpBody); } /** * Operation deleteRule @@ -1409,7 +1102,7 @@ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) $resourcePath = '/1/indexes/{indexName}/rules/{objectID}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($forwardToReplicas)) { $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); @@ -1437,16 +1130,6 @@ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1460,18 +1143,8 @@ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('DELETE', $resourcePath, $query, $httpBody); } /** * Operation deleteSource @@ -1495,7 +1168,7 @@ public function deleteSource($source) $resourcePath = '/1/security/sources/{source}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($source !== null) { $resourcePath = str_replace( @@ -1508,16 +1181,6 @@ public function deleteSource($source) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1531,18 +1194,8 @@ public function deleteSource($source) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeleteSourceResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('DELETE', $resourcePath, $query, $httpBody); } /** * Operation deleteSynonym @@ -1576,7 +1229,7 @@ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) $resourcePath = '/1/indexes/{indexName}/synonyms/{objectID}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($forwardToReplicas)) { $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); @@ -1604,16 +1257,6 @@ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1627,18 +1270,8 @@ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\DeletedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('DELETE', $resourcePath, $query, $httpBody); } /** * Operation getApiKey @@ -1664,7 +1297,7 @@ public function getApiKey($key) $resourcePath = '/1/keys/{key}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($key !== null) { $resourcePath = str_replace( @@ -1677,16 +1310,6 @@ public function getApiKey($key) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1700,18 +1323,8 @@ public function getApiKey($key) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\KeyObject'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation getDictionaryLanguages @@ -1729,21 +1342,11 @@ public function getDictionaryLanguages() $resourcePath = '/1/dictionaries/*/languages'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; $headers = $this->headerSelector->selectHeaders( ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1757,18 +1360,8 @@ public function getDictionaryLanguages() ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = 'array<string,\Algolia\AlgoliaSearch\Model\Languages>'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation getDictionarySettings @@ -1786,21 +1379,11 @@ public function getDictionarySettings() $resourcePath = '/1/dictionaries/*/settings'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; $headers = $this->headerSelector->selectHeaders( ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1814,18 +1397,8 @@ public function getDictionarySettings() ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetDictionarySettingsResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation getLogs @@ -1849,7 +1422,7 @@ public function getLogs($offset = 0, $length = 10, $indexName = null, $type = 'a $resourcePath = '/1/logs'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($offset)) { $offset = ObjectSerializer::serializeCollection($offset, '', true); @@ -1882,16 +1455,6 @@ public function getLogs($offset = 0, $length = 10, $indexName = null, $type = 'a ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1905,18 +1468,8 @@ public function getLogs($offset = 0, $length = 10, $indexName = null, $type = 'a ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetLogsResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation getObject @@ -1925,7 +1478,7 @@ public function getLogs($offset = 0, $length = 10, $indexName = null, $type = 'a * * @param string $indexName The index in which to perform the request. (required) * @param string $objectID Unique identifier of an object. (required) - * @param string[] $attributesToRetrieve attributesToRetrieve (optional) + * @param string[] $attributesToRetrieve List of attributes to retrieve. If not specified, all retrievable attributes are returned. (optional) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -1950,7 +1503,7 @@ public function getObject($indexName, $objectID, $attributesToRetrieve = null) $resourcePath = '/1/indexes/{indexName}/{objectID}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($attributesToRetrieve)) { $attributesToRetrieve = ObjectSerializer::serializeCollection($attributesToRetrieve, 'csv', true); @@ -1978,16 +1531,6 @@ public function getObject($indexName, $objectID, $attributesToRetrieve = null) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2001,18 +1544,8 @@ public function getObject($indexName, $objectID, $attributesToRetrieve = null) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = 'array<string,string>'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation getObjects @@ -2038,23 +1571,13 @@ public function getObjects($getObjectsObject) $resourcePath = '/1/indexes/*/objects'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); if (isset($getObjectsObject)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($getObjectsObject)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $getObjectsObject; } $defaultHeaders = []; @@ -2069,18 +1592,8 @@ public function getObjects($getObjectsObject) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetObjectsResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation getRule @@ -2113,7 +1626,7 @@ public function getRule($indexName, $objectID) $resourcePath = '/1/indexes/{indexName}/rules/{objectID}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -2134,16 +1647,6 @@ public function getRule($indexName, $objectID) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2157,18 +1660,8 @@ public function getRule($indexName, $objectID) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\Rule'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation getSettings @@ -2192,7 +1685,7 @@ public function getSettings($indexName) $resourcePath = '/1/indexes/{indexName}/settings'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -2205,16 +1698,6 @@ public function getSettings($indexName) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2228,18 +1711,8 @@ public function getSettings($indexName) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\IndexSettings'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation getSources @@ -2255,21 +1728,11 @@ public function getSources() $resourcePath = '/1/security/sources'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; $headers = $this->headerSelector->selectHeaders( ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2283,18 +1746,8 @@ public function getSources() ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\Source[]'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation getSynonym @@ -2327,7 +1780,7 @@ public function getSynonym($indexName, $objectID) $resourcePath = '/1/indexes/{indexName}/synonyms/{objectID}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -2348,16 +1801,6 @@ public function getSynonym($indexName, $objectID) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2371,18 +1814,8 @@ public function getSynonym($indexName, $objectID) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\SynonymHit'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation getTask @@ -2413,7 +1846,7 @@ public function getTask($indexName, $taskID) $resourcePath = '/1/indexes/{indexName}/task/{taskID}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -2434,16 +1867,6 @@ public function getTask($indexName, $taskID) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2457,18 +1880,8 @@ public function getTask($indexName, $taskID) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetTaskResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation getTopUserIds @@ -2486,21 +1899,11 @@ public function getTopUserIds() $resourcePath = '/1/clusters/mapping/top'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; $headers = $this->headerSelector->selectHeaders( ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2514,18 +1917,8 @@ public function getTopUserIds() ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\GetTopUserIdsResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation getUserId @@ -2554,7 +1947,7 @@ public function getUserId($userID) $resourcePath = '/1/clusters/mapping/{userID}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($userID !== null) { $resourcePath = str_replace( @@ -2567,16 +1960,6 @@ public function getUserId($userID) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2590,25 +1973,15 @@ public function getUserId($userID) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UserId'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation hasPendingMappings * * Has pending mappings * - * @param bool $getClusters getClusters (optional) + * @param bool $getClusters Whether to get clusters or not. (optional) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2620,7 +1993,7 @@ public function hasPendingMappings($getClusters = null) $resourcePath = '/1/clusters/mapping/pending'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($getClusters)) { $getClusters = ObjectSerializer::serializeCollection($getClusters, '', true); @@ -2632,16 +2005,6 @@ public function hasPendingMappings($getClusters = null) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2655,18 +2018,8 @@ public function hasPendingMappings($getClusters = null) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\CreatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation listApiKeys @@ -2684,21 +2037,11 @@ public function listApiKeys() $resourcePath = '/1/keys'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; $headers = $this->headerSelector->selectHeaders( ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2712,18 +2055,8 @@ public function listApiKeys() ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\ListApiKeysResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation listClusters @@ -2741,21 +2074,11 @@ public function listClusters() $resourcePath = '/1/clusters'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; $headers = $this->headerSelector->selectHeaders( ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2769,18 +2092,8 @@ public function listClusters() ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\ListClustersResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation listIndices @@ -2799,7 +2112,7 @@ public function listIndices($page = null) $resourcePath = '/1/indexes'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($page)) { $page = ObjectSerializer::serializeCollection($page, '', true); @@ -2811,16 +2124,6 @@ public function listIndices($page = null) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2834,18 +2137,8 @@ public function listIndices($page = null) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\ListIndicesResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation listUserIds @@ -2865,7 +2158,7 @@ public function listUserIds($page = null, $hitsPerPage = 100) $resourcePath = '/1/clusters/mapping'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($page)) { $page = ObjectSerializer::serializeCollection($page, '', true); @@ -2884,16 +2177,6 @@ public function listUserIds($page = null, $hitsPerPage = 100) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2907,18 +2190,8 @@ public function listUserIds($page = null, $hitsPerPage = 100) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\ListUserIdsResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); } /** * Operation multipleBatch @@ -2942,23 +2215,13 @@ public function multipleBatch($batchObject) $resourcePath = '/1/indexes/*/batch'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); if (isset($batchObject)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($batchObject)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $batchObject; } $defaultHeaders = []; @@ -2973,18 +2236,8 @@ public function multipleBatch($batchObject) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\MultipleBatchResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation multipleQueries @@ -3008,23 +2261,13 @@ public function multipleQueries($multipleQueriesObject) $resourcePath = '/1/indexes/*/queries'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); if (isset($multipleQueriesObject)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($multipleQueriesObject)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $multipleQueriesObject; } $defaultHeaders = []; @@ -3039,18 +2282,8 @@ public function multipleQueries($multipleQueriesObject) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\MultipleQueriesResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation operationIndex @@ -3083,7 +2316,7 @@ public function operationIndex($indexName, $operationIndexObject) $resourcePath = '/1/indexes/{indexName}/operation'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -3097,17 +2330,7 @@ public function operationIndex($indexName, $operationIndexObject) ['application/json'] ); if (isset($operationIndexObject)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($operationIndexObject)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $operationIndexObject; } $defaultHeaders = []; @@ -3122,18 +2345,8 @@ public function operationIndex($indexName, $operationIndexObject) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation partialUpdateObject @@ -3142,7 +2355,7 @@ public function operationIndex($indexName, $operationIndexObject) * * @param string $indexName The index in which to perform the request. (required) * @param string $objectID Unique identifier of an object. (required) - * @param array[] $oneOfStringBuildInOperation The Algolia object. (required) + * @param array[] $oneOfStringBuildInOperation List of attributes to update. (required) * @param bool $createIfNotExists Creates the record if it does not exist yet. (optional, default to true) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response @@ -3174,7 +2387,7 @@ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOp $resourcePath = '/1/indexes/{indexName}/{objectID}/partial'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($createIfNotExists)) { $createIfNotExists = ObjectSerializer::serializeCollection($createIfNotExists, '', true); @@ -3203,17 +2416,7 @@ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOp ['application/json'] ); if (isset($oneOfStringBuildInOperation)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($oneOfStringBuildInOperation)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $oneOfStringBuildInOperation; } $defaultHeaders = []; @@ -3228,18 +2431,8 @@ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOp ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation removeUserId @@ -3268,7 +2461,7 @@ public function removeUserId($userID) $resourcePath = '/1/clusters/mapping/{userID}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($userID !== null) { $resourcePath = str_replace( @@ -3281,16 +2474,6 @@ public function removeUserId($userID) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -3304,18 +2487,8 @@ public function removeUserId($userID) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\RemoveUserIdResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('DELETE', $resourcePath, $query, $httpBody); } /** * Operation replaceSources @@ -3339,23 +2512,13 @@ public function replaceSources($source) $resourcePath = '/1/security/sources'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); if (isset($source)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($source)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $source; } $defaultHeaders = []; @@ -3370,18 +2533,8 @@ public function replaceSources($source) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\ReplaceSourceResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('PUT', $resourcePath, $query, $httpBody); } /** * Operation restoreApiKey @@ -3407,7 +2560,7 @@ public function restoreApiKey($key) $resourcePath = '/1/keys/{key}/restore'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($key !== null) { $resourcePath = str_replace( @@ -3420,16 +2573,6 @@ public function restoreApiKey($key) ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -3443,18 +2586,8 @@ public function restoreApiKey($key) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\AddApiKeyResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation saveObject @@ -3485,7 +2618,7 @@ public function saveObject($indexName, $body) $resourcePath = '/1/indexes/{indexName}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -3499,17 +2632,7 @@ public function saveObject($indexName, $body) ['application/json'] ); if (isset($body)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($body)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $body; } $defaultHeaders = []; @@ -3524,18 +2647,8 @@ public function saveObject($indexName, $body) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\SaveObjectResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation saveRule @@ -3576,7 +2689,7 @@ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null $resourcePath = '/1/indexes/{indexName}/rules/{objectID}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($forwardToReplicas)) { $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); @@ -3605,17 +2718,7 @@ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null ['application/json'] ); if (isset($rule)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($rule)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $rule; } $defaultHeaders = []; @@ -3630,18 +2733,8 @@ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedRuleResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('PUT', $resourcePath, $query, $httpBody); } /** * Operation saveSynonym @@ -3682,7 +2775,7 @@ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplic $resourcePath = '/1/indexes/{indexName}/synonyms/{objectID}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($forwardToReplicas)) { $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); @@ -3711,17 +2804,7 @@ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplic ['application/json'] ); if (isset($synonymHit)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($synonymHit)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $synonymHit; } $defaultHeaders = []; @@ -3736,18 +2819,8 @@ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplic ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\SaveSynonymResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('PUT', $resourcePath, $query, $httpBody); } /** * Operation saveSynonyms @@ -3782,7 +2855,7 @@ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, $resourcePath = '/1/indexes/{indexName}/synonyms/batch'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($forwardToReplicas)) { $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); @@ -3810,17 +2883,7 @@ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, ['application/json'] ); if (isset($synonymHit)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($synonymHit)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $synonymHit; } $defaultHeaders = []; @@ -3835,18 +2898,8 @@ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation search @@ -3877,7 +2930,7 @@ public function search($indexName, $searchParams) $resourcePath = '/1/indexes/{indexName}/query'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -3891,17 +2944,7 @@ public function search($indexName, $searchParams) ['application/json'] ); if (isset($searchParams)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchParams)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $searchParams; } $defaultHeaders = []; @@ -3916,18 +2959,8 @@ public function search($indexName, $searchParams) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation searchDictionaryEntries @@ -3960,7 +2993,7 @@ public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntrie $resourcePath = '/1/dictionaries/{dictionaryName}/search'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($dictionaryName !== null) { $resourcePath = str_replace( @@ -3974,17 +3007,7 @@ public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntrie ['application/json'] ); if (isset($searchDictionaryEntries)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchDictionaryEntries)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $searchDictionaryEntries; } $defaultHeaders = []; @@ -3999,18 +3022,8 @@ public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntrie ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation searchForFacetValues @@ -4044,7 +3057,7 @@ public function searchForFacetValues($indexName, $facetName, $searchForFacetValu $resourcePath = '/1/indexes/{indexName}/facets/{facetName}/query'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -4066,17 +3079,7 @@ public function searchForFacetValues($indexName, $facetName, $searchForFacetValu ['application/json'] ); if (isset($searchForFacetValuesRequest)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchForFacetValuesRequest)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $searchForFacetValuesRequest; } $defaultHeaders = []; @@ -4091,18 +3094,8 @@ public function searchForFacetValues($indexName, $facetName, $searchForFacetValu ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation searchRules @@ -4135,7 +3128,7 @@ public function searchRules($indexName, $searchRulesParams) $resourcePath = '/1/indexes/{indexName}/rules/search'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($indexName !== null) { $resourcePath = str_replace( @@ -4149,17 +3142,7 @@ public function searchRules($indexName, $searchRulesParams) ['application/json'] ); if (isset($searchRulesParams)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchRulesParams)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $searchRulesParams; } $defaultHeaders = []; @@ -4174,18 +3157,8 @@ public function searchRules($indexName, $searchRulesParams) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchRulesResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation searchSynonyms @@ -4215,7 +3188,7 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $resourcePath = '/1/indexes/{indexName}/synonyms/search'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($query)) { $query = ObjectSerializer::serializeCollection($query, '', true); @@ -4256,16 +3229,6 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, ['application/json'], [] ); - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -4279,18 +3242,8 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchSynonymsResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation searchUserIds @@ -4316,23 +3269,13 @@ public function searchUserIds($searchUserIdsObject) $resourcePath = '/1/clusters/mapping/search'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); if (isset($searchUserIdsObject)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($searchUserIdsObject)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $searchUserIdsObject; } $defaultHeaders = []; @@ -4347,18 +3290,8 @@ public function searchUserIds($searchUserIdsObject) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\SearchUserIdsResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); } /** * Operation setDictionarySettings @@ -4384,23 +3317,13 @@ public function setDictionarySettings($dictionarySettingsRequest) $resourcePath = '/1/dictionaries/*/settings'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); if (isset($dictionarySettingsRequest)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($dictionarySettingsRequest)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $dictionarySettingsRequest; } $defaultHeaders = []; @@ -4415,18 +3338,8 @@ public function setDictionarySettings($dictionarySettingsRequest) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('PUT', $resourcePath, $query, $httpBody); } /** * Operation setSettings @@ -4458,7 +3371,7 @@ public function setSettings($indexName, $indexSettings, $forwardToReplicas = nul $resourcePath = '/1/indexes/{indexName}/settings'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // query params if (is_array($forwardToReplicas)) { $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); @@ -4479,17 +3392,7 @@ public function setSettings($indexName, $indexSettings, $forwardToReplicas = nul ['application/json'] ); if (isset($indexSettings)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($indexSettings)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $indexSettings; } $defaultHeaders = []; @@ -4504,18 +3407,8 @@ public function setSettings($indexName, $indexSettings, $forwardToReplicas = nul ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdatedAtResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; + return $this->sendRequest('PUT', $resourcePath, $query, $httpBody); } /** * Operation updateApiKey @@ -4548,7 +3441,7 @@ public function updateApiKey($key, $apiKey) $resourcePath = '/1/keys/{key}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; // path params if ($key !== null) { $resourcePath = str_replace( @@ -4562,17 +3455,7 @@ public function updateApiKey($key, $apiKey) ['application/json'] ); if (isset($apiKey)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($apiKey)); - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-API-Key'); - if ($apiKey !== null) { - $headers['X-Algolia-API-Key'] = $apiKey; - } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('X-Algolia-Application-Id'); - if ($apiKey !== null) { - $headers['X-Algolia-Application-Id'] = $apiKey; + $httpBody = $apiKey; } $defaultHeaders = []; @@ -4587,210 +3470,25 @@ public function updateApiKey($key, $apiKey) ); $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - $expectedResponse = '\Algolia\AlgoliaSearch\Model\UpdateApiKeyResponse'; - list($response) = $this->sendRequest($request, $expectedResponse); - return $response; - } - /** - * Create http client option - * - * @throws \RuntimeException on file opening failure - * - * @return array of http client options - */ - protected function createHttpClientOption() - { - $options = []; - if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); - if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); - } - } - - return $options; + return $this->sendRequest('PUT', $resourcePath, $query, $httpBody); } - /** - * Send the request and handle the response - * - * @throws \RuntimeException on file opening failure - * - * @return array - */ - protected function sendRequest($request, $expectedResponse) + private function sendRequest($method, $resourcePath, $query, $httpBody) { - try { - $options = $this->createHttpClientOption(); - - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - switch ($statusCode) { - case 200: - if ($expectedResponse === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, $expectedResponse, []), - $response->getStatusCode(), - $response->getHeaders(), - ]; - case 400: - if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; - case 402: - if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; - case 403: - if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; - case 404: - if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), - $response->getStatusCode(), - $response->getHeaders(), - ]; - - } - - $returnType = $expectedResponse; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders(), - ]; - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - $expectedResponse, - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Algolia\AlgoliaSearch\Model\ErrorBase', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - - break; - case 402: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Algolia\AlgoliaSearch\Model\ErrorBase', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - - break; - case 403: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Algolia\AlgoliaSearch\Model\ErrorBase', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Algolia\AlgoliaSearch\Model\ErrorBase', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - - break; - } - - throw $e; + if ($method === 'GET') { + $request = $this->api->read( + $method, + $resourcePath . ($query ? "?{$query}" : '') + ); + } else { + $request = $this->api->write( + $method, + $resourcePath . ($query ? "?{$query}" : ''), + $httpBody + ); } + + return $request; } } diff --git a/clients/algoliasearch-client-php/lib/Cache/FileCacheDriver.php b/clients/algoliasearch-client-php/lib/Cache/FileCacheDriver.php new file mode 100644 index 0000000000..86bcba64c9 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Cache/FileCacheDriver.php @@ -0,0 +1,117 @@ +directory = rtrim($directory, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; + } + + /** + * @inheritdoc + */ + public function get($key, $default = null) + { + if (!$this->has($key)) { + return $default; + } + + return file_get_contents($this->getFilenameFromKey($key)); + } + + /** + * @inheritdoc + */ + public function set($key, $value, $ttl = null) + { + return file_put_contents($this->getFilenameFromKey($key), $value); + } + + /** + * @inheritdoc + */ + public function delete($key) + { + return @unlink($this->getFilenameFromKey($key)); + } + + /** + * @inheritdoc + */ + public function clear() + { + $result = true; + foreach (glob($this->directory.self::PREFIX.'*') as $file) { + $result &= @unlink($file); + } + + return $result; + } + + /** + * @inheritdoc + */ + public function getMultiple($keys, $default = null) + { + $result = []; + foreach ($keys as $key) { + $result[$key] = $this->get($key, $default); + } + + return $result; + } + + /** + * @inheritdoc + */ + public function setMultiple($values, $ttl = null) + { + $result = true; + foreach ($values as $key => $value) { + $result &= $this->set($key, $value, $ttl); + } + + return $result; + } + + /** + * @inheritdoc + */ + public function deleteMultiple($keys) + { + $result = true; + foreach ($keys as $key) { + $result &= $this->delete($key); + } + + return $result; + } + + /** + * @inheritdoc + */ + public function has($key) + { + return file_exists($this->getFilenameFromKey($key)); + } + + /** + * @param string $key + * + * @return string + */ + private function getFilenameFromKey($key) + { + $name = $this->directory.self::PREFIX.$key; + + return str_replace('\\', '-', $name); + } +} diff --git a/clients/algoliasearch-client-php/lib/Cache/NullCacheDriver.php b/clients/algoliasearch-client-php/lib/Cache/NullCacheDriver.php new file mode 100644 index 0000000000..ffb8dc6a5a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Cache/NullCacheDriver.php @@ -0,0 +1,78 @@ +tempFolderPath = sys_get_temp_dir(); - - $this->setAlgoliaApiKey($algoliaApiKey); - $this->setApiKey('X-Algolia-API-Key', $algoliaApiKey); - - $this->setAppId($appId); - $this->setApiKey('X-Algolia-Application-Id', $appId); - - $this->setHost("https://{$appId}-1.algolianet.com"); - } - - /** - * Sets API key - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * @param string $key API key or token - * - * @return $this - */ - public function setApiKey($apiKeyIdentifier, $key) - { - $this->apiKeys[$apiKeyIdentifier] = $key; - - return $this; - } - - /** - * Gets API key - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * - * @return null|string API key or token - */ - public function getApiKey($apiKeyIdentifier) - { - return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; - } - - /** - * Sets the prefix for API key (e.g. Bearer) - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * @param string $prefix API key prefix, e.g. Bearer - * - * @return $this - */ - public function setApiKeyPrefix($apiKeyIdentifier, $prefix) - { - $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; - - return $this; - } - - /** - * Gets API key prefix - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * - * @return null|string - */ - public function getApiKeyPrefix($apiKeyIdentifier) - { - return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; - } - - /** - * Sets the access token for OAuth - * - * @param string $accessToken Token for OAuth - * - * @return $this - */ - public function setAccessToken($accessToken) - { - $this->accessToken = $accessToken; - - return $this; - } - - /** - * Gets the access token for OAuth - * - * @return string Access token for OAuth - */ - public function getAccessToken() - { - return $this->accessToken; - } - - /** - * Sets the Algolia Application ID - * - * @param string $appId Application ID - * - * @return $this - */ - public function setAppId($appId = '') - { - $this->appId = $appId; - } - - /** - * Gets the Algolia application ID - * - * @return string - */ - public function getAppId() - { - return $this->appId; - } - - /** - * Sets the Algolia API Key - * - * @param string $algoliaApiKey Algolia API Key - * - * @return $this - */ - public function setAlgoliaApiKey($algoliaApiKey = '') - { - $this->algoliaApiKey = $algoliaApiKey; - } - - /** - * Gets the Algolia API Key - * - * @return string - */ - public function getAlgoliaApiKey() - { - return $this->algoliaApiKey; - } - - /** - * Sets the host - * - * @param string $host Host - * - * @return $this - */ - public function setHost($host) - { - $this->host = $host; - - return $this; - } - - /** - * Gets the host - * - * @return string Host - */ - public function getHost() - { - return $this->host; - } - - /** - * Sets the user agent of the api client - * - * @param string $userAgent the user agent of the api client - * - * @throws \InvalidArgumentException - * - * @return $this - */ - public function setUserAgent($userAgent) - { - if (!is_string($userAgent)) { - throw new \InvalidArgumentException('User-agent must be a string.'); - } - - $this->userAgent = $userAgent; - - return $this; - } - - /** - * Gets the user agent of the api client - * - * @return string user agent - */ - public function getUserAgent() - { - return $this->userAgent; - } - - /** - * Sets debug flag - * - * @param bool $debug Debug flag - * - * @return $this - */ - public function setDebug($debug) - { - $this->debug = $debug; - - return $this; - } - - /** - * Gets the debug flag - * - * @return bool - */ - public function getDebug() - { - return $this->debug; - } - - /** - * Sets the debug file - * - * @param string $debugFile Debug file - * - * @return $this - */ - public function setDebugFile($debugFile) - { - $this->debugFile = $debugFile; - - return $this; - } - - /** - * Gets the debug file - * - * @return string - */ - public function getDebugFile() - { - return $this->debugFile; - } - - /** - * Sets the temp folder path - * - * @param string $tempFolderPath Temp folder path - * - * @return $this - */ - public function setTempFolderPath($tempFolderPath) - { - $this->tempFolderPath = $tempFolderPath; - - return $this; - } - - /** - * Gets the temp folder path - * - * @return string Temp folder path - */ - public function getTempFolderPath() - { - return $this->tempFolderPath; - } - - /** - * Gets the default configuration instance - * - * @return Configuration - */ - public static function getDefaultConfiguration() - { - if (self::$defaultConfiguration === null) { - self::$defaultConfiguration = new Configuration(); - } - - return self::$defaultConfiguration; - } - - /** - * Sets the default configuration instance - * - * @param Configuration $config An instance of the Configuration Object - * - * @return void - */ - public static function setDefaultConfiguration(Configuration $config) - { - self::$defaultConfiguration = $config; - } - - /** - * Gets the essential information for debugging - * - * @return string The report for debugging - */ - public static function toDebugReport() - { - $report = 'PHP SDK (Algolia\AlgoliaSearch) Debug Report:' . PHP_EOL; - $report .= ' OS: ' . php_uname() . PHP_EOL; - $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 0.1.0' . PHP_EOL; - $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; - - return $report; - } - - /** - * Get API key (with prefix if set) - * - * @param string $apiKeyIdentifier name of apikey - * - * @return null|string API key with the prefix - */ - public function getApiKeyWithPrefix($apiKeyIdentifier) - { - $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); - $apiKey = $this->getApiKey($apiKeyIdentifier); - - if ($apiKey === null) { - return null; - } - - if ($prefix === null) { - $keyWithPrefix = $apiKey; - } else { - $keyWithPrefix = $prefix . ' ' . $apiKey; - } - - return $keyWithPrefix; - } - - /** - * Returns an array of host settings - * - * @return array an array of host settings - */ - public function getHostSettings() - { - return [ - [ - 'url' => '', - 'description' => 'No description provided', - ], - ]; - } - - /** - * Returns URL based on the index and variables - * - * @param int $index index of the host settings - * @param array|null $variables hash of variable and the corresponding value (optional) - * - * @return string URL based on host settings - */ - public function getHostFromSettings($index, $variables = null) - { - if (null === $variables) { - $variables = []; - } - - $hosts = $this->getHostSettings(); - - // check array index out of bound - if ($index < 0 || $index >= sizeof($hosts)) { - throw new \InvalidArgumentException("Invalid index $index when selecting the host. Must be less than ".sizeof($hosts)); - } - - $host = $hosts[$index]; - $url = $host['url']; - - // go through variable and assign a value - foreach ($host['variables'] ?? [] as $name => $variable) { - if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user - if (in_array($variables[$name], $variable['enum_values'], true)) { // check to see if the value is in the enum - $url = str_replace('{'.$name.'}', $variables[$name], $url); - } else { - throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].'. Must be '.join(',', $variable['enum_values']).'.'); - } - } else { - // use default value - $url = str_replace('{'.$name.'}', $variable['default_value'], $url); - } - } - - return $url; - } -} diff --git a/clients/algoliasearch-client-php/lib/Configuration/AbstractConfig.php b/clients/algoliasearch-client-php/lib/Configuration/AbstractConfig.php new file mode 100644 index 0000000000..6e62e41d37 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Configuration/AbstractConfig.php @@ -0,0 +1,164 @@ +getDefaultConfiguration(); + $this->config = $config; + } + + public static function create($appId = null, $apiKey = null) + { + $config = [ + 'appId' => null !== $appId ? $appId : getenv('ALGOLIA_APP_ID'), + 'apiKey' => null !== $apiKey ? $apiKey : getenv('ALGOLIA_API_KEY'), + ]; + + return new static($config); + } + + public function getDefaultConfiguration() + { + return [ + 'appId' => '', + 'apiKey' => '', + 'hosts' => null, + 'readTimeout' => $this->defaultReadTimeout, + 'writeTimeout' => $this->defaultWriteTimeout, + 'connectTimeout' => $this->defaultConnectTimeout, + 'defaultHeaders' => [], + ]; + } + + public function getAppId() + { + return $this->config['appId']; + } + + public function setAppId($appId) + { + $this->config['appId'] = $appId; + + return $this; + } + + public function getAlgoliaApiKey() + { + return $this->config['apiKey']; + } + + public function setAlgoliaApiKey($apiKey) + { + $this->config['apiKey'] = $apiKey; + + return $this; + } + + public function getHosts() + { + return $this->config['hosts']; + } + + public function setHosts($hosts) + { + $this->config['hosts'] = $hosts; + + return $this; + } + + public function getReadTimeout() + { + return $this->config['readTimeout']; + } + + public function setReadTimeout($readTimeout) + { + $this->config['readTimeout'] = $readTimeout; + + return $this; + } + + public function getWriteTimeout() + { + return $this->config['writeTimeout']; + } + + public function setWriteTimeout($writeTimeout) + { + $this->config['writeTimeout'] = $writeTimeout; + + return $this; + } + + public function getConnectTimeout() + { + return $this->config['connectTimeout']; + } + + public function setConnectTimeout($connectTimeout) + { + $this->config['connectTimeout'] = $connectTimeout; + + return $this; + } + + public function getDefaultHeaders() + { + return $this->config['defaultHeaders']; + } + + public function setDefaultHeaders(array $defaultHeaders) + { + $this->config['defaultHeaders'] = $defaultHeaders; + + return $this; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } +} diff --git a/clients/algoliasearch-client-php/lib/Configuration/Configuration.php b/clients/algoliasearch-client-php/lib/Configuration/Configuration.php new file mode 100644 index 0000000000..d7cbebc643 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Configuration/Configuration.php @@ -0,0 +1,255 @@ +tempFolderPath = sys_get_temp_dir(); + + if (isset($config['apiKey'])) { + $this->setAlgoliaApiKey($config['apiKey']); + $this->setApiKey('X-Algolia-API-Key', $config['apiKey']); + } + + if (isset($config['appId'])) { + $this->setAppId($config['appId']); + $this->setApiKey('X-Algolia-Application-Id', $config['appId']); + } + + $config += $this->getDefaultConfiguration(); + $this->config = $config; + } + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug($debug) + { + $this->debug = $debug; + + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile($debugFile) + { + $this->debugFile = $debugFile; + + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile() + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return null|string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } +} diff --git a/clients/algoliasearch-client-php/lib/Exceptions/AlgoliaException.php b/clients/algoliasearch-client-php/lib/Exceptions/AlgoliaException.php new file mode 100644 index 0000000000..0334990688 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Exceptions/AlgoliaException.php @@ -0,0 +1,7 @@ +request = $request; + + return $this; + } + + public function getRequest() + { + return $this->request; + } +} diff --git a/clients/algoliasearch-client-php/lib/Exceptions/RetriableException.php b/clients/algoliasearch-client-php/lib/Exceptions/RetriableException.php new file mode 100644 index 0000000000..71ff5d4b09 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Exceptions/RetriableException.php @@ -0,0 +1,7 @@ +curlOptions = $curlOptions; + } + + public function sendRequest(RequestInterface $request, $timeout, $connectTimeout) + { + $curlHandle = curl_init(); + + // set curl options + try { + foreach ($this->curlOptions as $curlOption => $optionValue) { + curl_setopt($curlHandle, constant($curlOption), $optionValue); + } + } catch (\Exception $e) { + $this->invalidOptions($this->curlOptions, $e->getMessage()); + } + + $curlHeaders = []; + foreach ($request->getHeaders() as $key => $values) { + $curlHeaders[] = $key.': '.implode(',', $values); + } + + curl_setopt($curlHandle, CURLOPT_HTTPHEADER, $curlHeaders); + + curl_setopt($curlHandle, CURLOPT_USERAGENT, implode(',', $request->getHeader('User-Agent'))); + //Return the output instead of printing it + curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curlHandle, CURLOPT_FAILONERROR, true); + curl_setopt($curlHandle, CURLOPT_ENCODING, ''); + curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($curlHandle, CURLOPT_SSL_VERIFYHOST, 2); + // TODO: look into cert +// curl_setopt($curlHandle, CURLOPT_CAINFO, $this->caInfoPath); + + curl_setopt($curlHandle, CURLOPT_URL, (string) $request->getUri()); + $version = curl_version(); + if (version_compare($version['version'], '7.16.2', '>=') && $connectTimeout < 1) { + curl_setopt($curlHandle, CURLOPT_CONNECTTIMEOUT_MS, $connectTimeout * 1000); + curl_setopt($curlHandle, CURLOPT_TIMEOUT_MS, $timeout * 1000); + } else { + curl_setopt($curlHandle, CURLOPT_CONNECTTIMEOUT, $connectTimeout); + curl_setopt($curlHandle, CURLOPT_TIMEOUT, $timeout); + } + + // The problem is that on (Li|U)nix, when libcurl uses the standard name resolver, + // a SIGALRM is raised during name resolution which libcurl thinks is the timeout alarm. + curl_setopt($curlHandle, CURLOPT_NOSIGNAL, 1); + curl_setopt($curlHandle, CURLOPT_FAILONERROR, false); + + $method = $request->getMethod(); + if ('GET' === $method) { + curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'GET'); + curl_setopt($curlHandle, CURLOPT_HTTPGET, true); + curl_setopt($curlHandle, CURLOPT_POST, false); + } else { + if ('POST' === $method) { + $body = (string) $request->getBody(); + curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'POST'); + curl_setopt($curlHandle, CURLOPT_POST, true); + curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $body); + } elseif ('DELETE' === $method) { + curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'DELETE'); + curl_setopt($curlHandle, CURLOPT_POST, false); + } elseif ('PUT' === $method) { + $body = (string) $request->getBody(); + curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'PUT'); + curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $body); + curl_setopt($curlHandle, CURLOPT_POST, true); + } + } + $mhandle = $this->getMHandle($curlHandle); + + // Do all the processing. + $running = null; + do { + $mrc = curl_multi_exec($mhandle, $running); + } while (CURLM_CALL_MULTI_PERFORM === $mrc); + + while ($running && CURLM_OK === $mrc) { + if (-1 === curl_multi_select($mhandle, 0.1)) { + usleep(100); + } + do { + $mrc = curl_multi_exec($mhandle, $running); + } while (CURLM_CALL_MULTI_PERFORM === $mrc); + } + + $statusCode = (int) curl_getinfo($curlHandle, CURLINFO_HTTP_CODE); + $responseBody = curl_multi_getcontent($curlHandle); + $error = curl_error($curlHandle); + + $this->releaseMHandle($curlHandle); + curl_close($curlHandle); + + return new Response($statusCode, [], $responseBody, '1.1', $error); + } + + private function getMHandle($curlHandle) + { + if (!is_resource($this->curlMHandle)) { + $this->curlMHandle = curl_multi_init(); + } + curl_multi_add_handle($this->curlMHandle, $curlHandle); + + return $this->curlMHandle; + } + + private function releaseMHandle($curlHandle) + { + curl_multi_remove_handle($this->curlMHandle, $curlHandle); + } + + private function invalidOptions(array $curlOptions = [], $errorMsg = '') + { + throw new \OutOfBoundsException(sprintf('AlgoliaSearch curloptions options keys are invalid. %s given. error message : %s', json_encode($curlOptions), $errorMsg)); + } +} diff --git a/clients/algoliasearch-client-php/lib/Http/GuzzleHttpClient.php b/clients/algoliasearch-client-php/lib/Http/GuzzleHttpClient.php new file mode 100644 index 0000000000..03677d6730 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Http/GuzzleHttpClient.php @@ -0,0 +1,62 @@ +client = $client ?: static::buildClient(); + } + + public function sendRequest(RequestInterface $request, $timeout, $connectTimeout) + { + try { + $response = $this->client->send($request, [ + 'timeout' => $timeout, + 'connect_timeout' => $connectTimeout, + ]); + } catch (RequestException $e) { + if ($e->hasResponse()) { + return $e->getResponse(); + } + + return new Response( + 0, + [], + null, + '1.1', + $e->getMessage() + ); + } catch (ConnectException $e) { + return new Response( + 0, + [], + null, + '1.1', + $e->getMessage() + ); + } + + return $response; + } + + private static function buildClient(array $config = []) + { + $handlerStack = new HandlerStack(\GuzzleHttp\choose_handler()); + $handlerStack->push(Middleware::prepareBody(), 'prepare_body'); + $config = array_merge(['handler' => $handlerStack], $config); + + return new GuzzleClient($config); + } +} diff --git a/clients/algoliasearch-client-php/lib/Http/HttpClientInterface.php b/clients/algoliasearch-client-php/lib/Http/HttpClientInterface.php new file mode 100644 index 0000000000..1e4985365d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Http/HttpClientInterface.php @@ -0,0 +1,24 @@ +hwm = $hwm; + } + + public function __toString() + { + return $this->getContents(); + } + + public function getContents() + { + $buffer = $this->buffer; + $this->buffer = ''; + + return $buffer; + } + + public function close() + { + $this->buffer = ''; + } + + public function detach() + { + $this->close(); + } + + public function getSize() + { + return mb_strlen($this->buffer); + } + + public function isReadable() + { + return true; + } + + public function isWritable() + { + return true; + } + + public function isSeekable() + { + return false; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + throw new \RuntimeException('Cannot seek a BufferStream'); + } + + public function eof() + { + return 0 === mb_strlen($this->buffer); + } + + public function tell() + { + throw new \RuntimeException('Cannot determine the position of a BufferStream'); + } + + /** + * Reads data from the buffer. + */ + public function read($length) + { + $currentLength = mb_strlen($this->buffer); + + if ($length >= $currentLength) { + // No need to slice the buffer because we don't have enough data. + $result = $this->buffer; + $this->buffer = ''; + } else { + // Slice up the result to provide a subset of the buffer. + $result = mb_substr($this->buffer, 0, $length); + $this->buffer = mb_substr($this->buffer, $length); + } + + return $result; + } + + /** + * Writes data to the buffer. + */ + public function write($string) + { + $this->buffer .= $string; + + // TODO: What should happen here? + if (mb_strlen($this->buffer) >= $this->hwm) { + return false; + } + + return mb_strlen($string); + } + + public function getMetadata($key = null) + { + if ('hwm' === $key) { + return $this->hwm; + } + + return $key ? null : []; + } +} diff --git a/clients/algoliasearch-client-php/lib/Http/Psr7/PumpStream.php b/clients/algoliasearch-client-php/lib/Http/Psr7/PumpStream.php new file mode 100644 index 0000000000..86786edb6f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Http/Psr7/PumpStream.php @@ -0,0 +1,169 @@ +source = $source; + $this->size = isset($options['size']) ? $options['size'] : null; + $this->metadata = isset($options['metadata']) ? $options['metadata'] : []; + $this->buffer = new BufferStream(); + } + + public function __toString() + { + try { + return copy_to_string($this); + } catch (\Exception $e) { + return ''; + } + } + + public function close() + { + $this->detach(); + } + + public function detach() + { + $this->tellPos = false; + $this->source = null; + } + + public function getSize() + { + return $this->size; + } + + public function tell() + { + return $this->tellPos; + } + + public function eof() + { + return !$this->source; + } + + public function isSeekable() + { + return false; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + throw new \RuntimeException('Cannot seek a PumpStream'); + } + + public function isWritable() + { + return false; + } + + public function write($string) + { + throw new \RuntimeException('Cannot write to a PumpStream'); + } + + public function isReadable() + { + return true; + } + + public function read($length) + { + $data = $this->buffer->read($length); + $readLen = mb_strlen($data); + $this->tellPos += $readLen; + $remaining = $length - $readLen; + + if ($remaining) { + $this->pump($remaining); + $data .= $this->buffer->read($remaining); + $this->tellPos += mb_strlen($data) - $readLen; + } + + return $data; + } + + public function getContents() + { + $result = ''; + while (!$this->eof()) { + $result .= $this->read(1000000); + } + + return $result; + } + + public function getMetadata($key = null) + { + if (!$key) { + return $this->metadata; + } + + return isset($this->metadata[$key]) ? $this->metadata[$key] : null; + } + + private function pump($length) + { + if ($this->source) { + do { + $data = call_user_func($this->source, $length); + if (false === $data || null === $data) { + $this->source = null; + + return; + } + $this->buffer->write($data); + $length -= mb_strlen($data); + } while ($length > 0); + } + } +} diff --git a/clients/algoliasearch-client-php/lib/Http/Psr7/Request.php b/clients/algoliasearch-client-php/lib/Http/Psr7/Request.php new file mode 100644 index 0000000000..43a6ba024c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Http/Psr7/Request.php @@ -0,0 +1,308 @@ + array of values */ + private $headers = []; + + /** @var array Map of lowercase header name => original name at registration */ + private $headerNames = []; + + /** @var string */ + private $protocol = '1.1'; + + /** @var StreamInterface */ + private $stream; + + /** + * @param string $method HTTP method + * @param string|UriInterface $uri URI + * @param array $headers Request headers + * @param string|resource|StreamInterface|null $body Request body + * @param string $version Protocol version + */ + public function __construct( + $method, + $uri, + array $headers = [], + $body = null, + $version = '1.1' + ) { + if (!($uri instanceof UriInterface)) { + $uri = new Uri($uri); + } + + $this->method = mb_strtoupper($method); + $this->uri = $uri; + $this->setHeaders($headers); + $this->protocol = $version; + + if (!$this->hasHeader('Host')) { + $this->updateHostFromUri(); + } + + if ('' !== $body && null !== $body) { + $this->stream = stream_for($body); + } + } + + public function getRequestTarget() + { + if (null !== $this->requestTarget) { + return $this->requestTarget; + } + + $target = $this->uri->getPath(); + if ('' === $target) { + $target = '/'; + } + if ('' !== $this->uri->getQuery()) { + $target .= '?'.$this->uri->getQuery(); + } + + return $target; + } + + public function withRequestTarget($requestTarget) + { + if (preg_match('#\s#', $requestTarget)) { + throw new InvalidArgumentException('Invalid request target provided; cannot contain whitespace'); + } + + $new = clone $this; + $new->requestTarget = $requestTarget; + + return $new; + } + + public function getMethod() + { + return $this->method; + } + + public function withMethod($method) + { + $new = clone $this; + $new->method = mb_strtoupper($method); + + return $new; + } + + public function getUri() + { + return $this->uri; + } + + public function withUri(UriInterface $uri, $preserveHost = false) + { + if ($uri === $this->uri) { + return $this; + } + + $new = clone $this; + $new->uri = $uri; + + if (!$preserveHost) { + $new->updateHostFromUri(); + } + + return $new; + } + + private function updateHostFromUri() + { + $host = $this->uri->getHost(); + + if ('' === $host) { + return; + } + + if (null !== ($port = $this->uri->getPort())) { + $host .= ':'.$port; + } + + if (isset($this->headerNames['host'])) { + $header = $this->headerNames['host']; + } else { + $header = 'Host'; + $this->headerNames['host'] = 'Host'; + } + // Ensure Host is the first header. + // See: http://tools.ietf.org/html/rfc7230#section-5.4 + $this->headers = [$header => [$host]] + $this->headers; + } + + public function getProtocolVersion() + { + return $this->protocol; + } + + public function withProtocolVersion($version) + { + if ($this->protocol === $version) { + return $this; + } + $new = clone $this; + $new->protocol = $version; + + return $new; + } + + public function getHeaders() + { + return $this->headers; + } + + public function hasHeader($header) + { + return isset($this->headerNames[mb_strtolower($header)]); + } + + public function getHeader($header) + { + $header = mb_strtolower($header); + if (!isset($this->headerNames[$header])) { + return []; + } + $header = $this->headerNames[$header]; + + return $this->headers[$header]; + } + + public function getHeaderLine($header) + { + return implode(', ', $this->getHeader($header)); + } + + public function withHeader($header, $value) + { + if (!is_array($value)) { + $value = [$value]; + } + $value = $this->trimHeaderValues($value); + $normalized = mb_strtolower($header); + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + unset($new->headers[$new->headerNames[$normalized]]); + } + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + + return $new; + } + + public function withAddedHeader($header, $value) + { + if (!is_array($value)) { + $value = [$value]; + } + $value = $this->trimHeaderValues($value); + $normalized = mb_strtolower($header); + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $new->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + } + + return $new; + } + + public function withoutHeader($header) + { + $normalized = mb_strtolower($header); + if (!isset($this->headerNames[$normalized])) { + return $this; + } + $header = $this->headerNames[$normalized]; + $new = clone $this; + unset($new->headers[$header], $new->headerNames[$normalized]); + + return $new; + } + + public function getBody() + { + if (!$this->stream) { + $this->stream = stream_for(''); + } + + return $this->stream; + } + + public function withBody(StreamInterface $body) + { + if ($body === $this->stream) { + return $this; + } + $new = clone $this; + $new->stream = $body; + + return $new; + } + + private function setHeaders(array $headers) + { + $this->headerNames = $this->headers = []; + foreach ($headers as $header => $value) { + if (!is_array($value)) { + $value = [$value]; + } + $value = $this->trimHeaderValues($value); + $normalized = mb_strtolower($header); + if (isset($this->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $this->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $this->headerNames[$normalized] = $header; + $this->headers[$header] = $value; + } + } + } + + /** + * Trims whitespace from the header values. + * + * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field. + * + * header-field = field-name ":" OWS field-value OWS + * OWS = *( SP / HTAB ) + * + * @param string[] $values Header values + * + * @return string[] Trimmed header values + * + * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 + */ + private function trimHeaderValues(array $values) + { + return array_map(function ($value) { + return trim($value, " \t"); + }, $values); + } +} diff --git a/clients/algoliasearch-client-php/lib/Http/Psr7/Response.php b/clients/algoliasearch-client-php/lib/Http/Psr7/Response.php new file mode 100644 index 0000000000..ee338a823b --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Http/Psr7/Response.php @@ -0,0 +1,314 @@ + array of values */ + private $headers = []; + + /** @var array Map of lowercase header name => original name at registration */ + private $headerNames = []; + + /** @var string */ + private $protocol = '1.1'; + + /** @var StreamInterface */ + private $stream; + + /** @var array Map of standard HTTP status code/reason phrases */ + private static $phrases = [ + 100 => 'Continue', + 101 => 'Switching Protocols', + 102 => 'Processing', + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + 207 => 'Multi-status', + 208 => 'Already Reported', + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 306 => 'Switch Proxy', + 307 => 'Temporary Redirect', + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Time-out', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Large', + 415 => 'Unsupported Media Type', + 416 => 'Requested range not satisfiable', + 417 => 'Expectation Failed', + 418 => 'I\'m a teapot', + 422 => 'Unprocessable Entity', + 423 => 'Locked', + 424 => 'Failed Dependency', + 425 => 'Unordered Collection', + 426 => 'Upgrade Required', + 428 => 'Precondition Required', + 429 => 'Too Many Requests', + 431 => 'Request Header Fields Too Large', + 451 => 'Unavailable For Legal Reasons', + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Time-out', + 505 => 'HTTP Version not supported', + 506 => 'Variant Also Negotiates', + 507 => 'Insufficient Storage', + 508 => 'Loop Detected', + 511 => 'Network Authentication Required', + ]; + + /** @var string */ + private $reasonPhrase = ''; + + /** @var int */ + private $statusCode = 200; + + /** + * @param int $status Status code + * @param array $headers Response headers + * @param string|resource|StreamInterface|null $body Response body + * @param string $version Protocol version + * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) + */ + public function __construct( + $status = 200, + array $headers = [], + $body = null, + $version = '1.1', + $reason = null + ) { + $this->statusCode = (int) $status; + + if ('' !== $body && null !== $body) { + $this->stream = stream_for($body); + } + + $this->setHeaders($headers); + if ('' === $reason && isset(self::$phrases[$this->statusCode])) { + $this->reasonPhrase = self::$phrases[$this->statusCode]; + } else { + $this->reasonPhrase = (string) $reason; + } + + $this->protocol = $version; + } + + public function getStatusCode() + { + return $this->statusCode; + } + + public function getReasonPhrase() + { + return $this->reasonPhrase; + } + + public function withStatus($code, $reasonPhrase = '') + { + $new = clone $this; + $new->statusCode = (int) $code; + if ('' === $reasonPhrase && isset(self::$phrases[$new->statusCode])) { + $reasonPhrase = self::$phrases[$new->statusCode]; + } + $new->reasonPhrase = $reasonPhrase; + + return $new; + } + + public function getProtocolVersion() + { + return $this->protocol; + } + + public function withProtocolVersion($version) + { + if ($this->protocol === $version) { + return $this; + } + + $new = clone $this; + $new->protocol = $version; + + return $new; + } + + public function getHeaders() + { + return $this->headers; + } + + public function hasHeader($header) + { + return isset($this->headerNames[mb_strtolower($header)]); + } + + public function getHeader($header) + { + $header = mb_strtolower($header); + + if (!isset($this->headerNames[$header])) { + return []; + } + + $header = $this->headerNames[$header]; + + return $this->headers[$header]; + } + + public function getHeaderLine($header) + { + return implode(', ', $this->getHeader($header)); + } + + public function withHeader($header, $value) + { + if (!is_array($value)) { + $value = [$value]; + } + + $value = $this->trimHeaderValues($value); + $normalized = mb_strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + unset($new->headers[$new->headerNames[$normalized]]); + } + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + + return $new; + } + + public function withAddedHeader($header, $value) + { + if (!is_array($value)) { + $value = [$value]; + } + + $value = $this->trimHeaderValues($value); + $normalized = mb_strtolower($header); + + $new = clone $this; + if (isset($new->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $new->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $new->headerNames[$normalized] = $header; + $new->headers[$header] = $value; + } + + return $new; + } + + public function withoutHeader($header) + { + $normalized = mb_strtolower($header); + + if (!isset($this->headerNames[$normalized])) { + return $this; + } + + $header = $this->headerNames[$normalized]; + + $new = clone $this; + unset($new->headers[$header], $new->headerNames[$normalized]); + + return $new; + } + + public function getBody() + { + if (!$this->stream) { + $this->stream = stream_for(''); + } + + return $this->stream; + } + + public function withBody(StreamInterface $body) + { + if ($body === $this->stream) { + return $this; + } + + $new = clone $this; + $new->stream = $body; + + return $new; + } + + private function setHeaders(array $headers) + { + $this->headerNames = $this->headers = []; + foreach ($headers as $header => $value) { + if (!is_array($value)) { + $value = [$value]; + } + + $value = $this->trimHeaderValues($value); + $normalized = mb_strtolower($header); + if (isset($this->headerNames[$normalized])) { + $header = $this->headerNames[$normalized]; + $this->headers[$header] = array_merge($this->headers[$header], $value); + } else { + $this->headerNames[$normalized] = $header; + $this->headers[$header] = $value; + } + } + } + + /** + * Trims whitespace from the header values. + * + * Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field. + * + * header-field = field-name ":" OWS field-value OWS + * OWS = *( SP / HTAB ) + * + * @param string[] $values Header values + * + * @return string[] Trimmed header values + * + * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 + */ + private function trimHeaderValues(array $values) + { + return array_map(function ($value) { + return trim($value, " \t"); + }, $values); + } +} diff --git a/clients/algoliasearch-client-php/lib/Http/Psr7/Stream.php b/clients/algoliasearch-client-php/lib/Http/Psr7/Stream.php new file mode 100644 index 0000000000..818864e06d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Http/Psr7/Stream.php @@ -0,0 +1,278 @@ + [ + 'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true, + 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, + 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true, + 'x+t' => true, 'c+t' => true, 'a+' => true, + ], + 'write' => [ + 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true, + 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true, + 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true, + 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true, + ], + ]; + + /** + * This constructor accepts an associative array of options. + * + * - size: (int) If a read stream would otherwise have an indeterminate + * size, but the size is known due to foreknowledge, then you can + * provide that size, in bytes. + * - metadata: (array) Any additional metadata to return when the metadata + * of the stream is accessed. + * + * @param resource $stream stream resource to wrap + * @param array $options associative array of options + * + * @throws \InvalidArgumentException if the stream is not a stream resource + */ + public function __construct($stream, $options = []) + { + if (!is_resource($stream)) { + throw new \InvalidArgumentException('Stream must be a resource'); + } + + if (isset($options['size'])) { + $this->size = $options['size']; + } + + $this->customMetadata = isset($options['metadata']) + ? $options['metadata'] + : []; + + $this->stream = $stream; + $meta = stream_get_meta_data($this->stream); + $this->seekable = $meta['seekable']; + $this->readable = isset(self::$readWriteHash['read'][$meta['mode']]); + $this->writable = isset(self::$readWriteHash['write'][$meta['mode']]); + $this->uri = $this->getMetadata('uri'); + } + + /** + * Closes the stream when the destructed. + */ + public function __destruct() + { + $this->close(); + } + + public function __toString() + { + try { + $this->seek(0); + + return (string) stream_get_contents($this->stream); + } catch (\Exception $e) { + return ''; + } + } + + public function getContents() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $contents = stream_get_contents($this->stream); + + if (false === $contents) { + throw new \RuntimeException('Unable to read stream contents'); + } + + return $contents; + } + + public function close() + { + if (isset($this->stream)) { + if (is_resource($this->stream)) { + fclose($this->stream); + } + $this->detach(); + } + } + + public function detach() + { + if (!isset($this->stream)) { + return null; + } + + $result = $this->stream; + unset($this->stream); + $this->size = $this->uri = null; + $this->readable = $this->writable = $this->seekable = false; + + return $result; + } + + public function getSize() + { + if (null !== $this->size) { + return $this->size; + } + + if (!isset($this->stream)) { + return null; + } + + // Clear the stat cache if the stream has a URI + if ($this->uri) { + clearstatcache(true, $this->uri); + } + + $stats = fstat($this->stream); + if (isset($stats['size'])) { + $this->size = $stats['size']; + + return $this->size; + } + + return null; + } + + public function isReadable() + { + return $this->readable; + } + + public function isWritable() + { + return $this->writable; + } + + public function isSeekable() + { + return $this->seekable; + } + + public function eof() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + return feof($this->stream); + } + + public function tell() + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + + $result = ftell($this->stream); + + if (false === $result) { + throw new \RuntimeException('Unable to determine stream position'); + } + + return $result; + } + + public function rewind() + { + $this->seek(0); + } + + public function seek($offset, $whence = SEEK_SET) + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->seekable) { + throw new \RuntimeException('Stream is not seekable'); + } + if (-1 === fseek($this->stream, $offset, $whence)) { + throw new \RuntimeException('Unable to seek to stream position '.$offset.' with whence '.var_export($whence, true)); + } + } + + public function read($length) + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->readable) { + throw new \RuntimeException('Cannot read from non-readable stream'); + } + if ($length < 0) { + throw new \RuntimeException('Length parameter cannot be negative'); + } + + if (0 === $length) { + return ''; + } + + $string = fread($this->stream, $length); + if (false === $string) { + throw new \RuntimeException('Unable to read from stream'); + } + + return $string; + } + + public function write($string) + { + if (!isset($this->stream)) { + throw new \RuntimeException('Stream is detached'); + } + if (!$this->writable) { + throw new \RuntimeException('Cannot write to a non-writable stream'); + } + + // We can't know the size after writing anything + $this->size = null; + $result = fwrite($this->stream, $string); + + if (false === $result) { + throw new \RuntimeException('Unable to write to stream'); + } + + return $result; + } + + public function getMetadata($key = null) + { + if (!isset($this->stream)) { + return $key ? null : []; + } elseif (!$key) { + return $this->customMetadata + stream_get_meta_data($this->stream); + } elseif (isset($this->customMetadata[$key])) { + return $this->customMetadata[$key]; + } + + $meta = stream_get_meta_data($this->stream); + + return isset($meta[$key]) ? $meta[$key] : null; + } +} diff --git a/clients/algoliasearch-client-php/lib/Http/Psr7/Uri.php b/clients/algoliasearch-client-php/lib/Http/Psr7/Uri.php new file mode 100644 index 0000000000..9d532477ac --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Http/Psr7/Uri.php @@ -0,0 +1,716 @@ + 80, + 'https' => 443, + 'ftp' => 21, + 'gopher' => 70, + 'nntp' => 119, + 'news' => 119, + 'telnet' => 23, + 'tn3270' => 23, + 'imap' => 143, + 'pop' => 110, + 'ldap' => 389, + ]; + + private static $charUnreserved = 'a-zA-Z0-9_\-\.~'; + + private static $charSubDelims = '!\$&\'\(\)\*\+,;='; + + private static $replaceQuery = ['=' => '%3D', '&' => '%26']; + + /** @var string Uri scheme. */ + private $scheme = ''; + + /** @var string Uri user info. */ + private $userInfo = ''; + + /** @var string Uri host. */ + private $host = ''; + + /** @var int|null Uri port. */ + private $port; + + /** @var string Uri path. */ + private $path = ''; + + /** @var string Uri query string. */ + private $query = ''; + + /** @var string Uri fragment. */ + private $fragment = ''; + + /** + * @param string $uri URI to parse + */ + public function __construct($uri = '') + { + // weak type check to also accept null until we can add scalar type hints + if ('' !== $uri) { + $parts = parse_url($uri); + if (false === $parts) { + throw new \InvalidArgumentException("Unable to parse URI: $uri"); + } + $this->applyParts($parts); + } + } + + public function __toString() + { + return self::composeComponents( + $this->scheme, + $this->getAuthority(), + $this->path, + $this->query, + $this->fragment + ); + } + + /** + * Composes a URI reference string from its various components. + * + * Usually this method does not need to be called manually but instead is used indirectly via + * `Psr\Http\Message\UriInterface::__toString`. + * + * PSR-7 UriInterface treats an empty component the same as a missing component as + * getQuery(), getFragment() etc. always return a string. This explains the slight + * difference to RFC 3986 Section 5.3. + * + * Another adjustment is that the authority separator is added even when the authority is missing/empty + * for the "file" scheme. This is because PHP stream functions like `file_get_contents` only work with + * `file:///myfile` but not with `file:/myfile` although they are equivalent according to RFC 3986. But + * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to + * that format). + * + * @param string $scheme + * @param string $authority + * @param string $path + * @param string $query + * @param string $fragment + * + * @return string + * + * @see https://tools.ietf.org/html/rfc3986#section-5.3 + */ + public static function composeComponents($scheme, $authority, $path, $query, $fragment) + { + $uri = ''; + + // weak type checks to also accept null until we can add scalar type hints + if ('' !== $scheme) { + $uri .= $scheme.':'; + } + + if ('' !== $authority || 'file' === $scheme) { + $uri .= '//'.$authority; + } + + $uri .= $path; + + if ('' !== $query) { + $uri .= '?'.$query; + } + + if ('' !== $fragment) { + $uri .= '#'.$fragment; + } + + return $uri; + } + + /** + * Whether the URI has the default port of the current scheme. + * + * `Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used + * independently of the implementation. + * + * @return bool + */ + public static function isDefaultPort(UriInterface $uri) + { + return null === $uri->getPort() + || (isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()]); + } + + /** + * Whether the URI is absolute, i.e. it has a scheme. + * + * An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true + * if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative + * to another URI, the base URI. Relative references can be divided into several forms: + * - network-path references, e.g. '//example.com/path' + * - absolute-path references, e.g. '/path' + * - relative-path references, e.g. 'subpath' + * + * @return bool + * + * @see Uri::isNetworkPathReference + * @see Uri::isAbsolutePathReference + * @see Uri::isRelativePathReference + * @see https://tools.ietf.org/html/rfc3986#section-4 + */ + public static function isAbsolute(UriInterface $uri) + { + return '' !== $uri->getScheme(); + } + + /** + * Whether the URI is a network-path reference. + * + * A relative reference that begins with two slash characters is termed an network-path reference. + * + * @return bool + * + * @see https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isNetworkPathReference(UriInterface $uri) + { + return '' === $uri->getScheme() && '' !== $uri->getAuthority(); + } + + /** + * Whether the URI is a absolute-path reference. + * + * A relative reference that begins with a single slash character is termed an absolute-path reference. + * + * @return bool + * + * @see https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isAbsolutePathReference(UriInterface $uri) + { + $path = $uri->getPath(); + + return '' === $uri->getScheme() + && '' === $uri->getAuthority() + && isset($path[0]) + && '/' === $path[0]; + } + + /** + * Whether the URI is a relative-path reference. + * + * A relative reference that does not begin with a slash character is termed a relative-path reference. + * + * @return bool + * + * @see https://tools.ietf.org/html/rfc3986#section-4.2 + */ + public static function isRelativePathReference(UriInterface $uri) + { + $path = $uri->getPath(); + + return '' === $uri->getScheme() + && '' === $uri->getAuthority() + && (!isset($path[0]) || '/' !== $path[0]); + } + + /** + * Whether the URI is a same-document reference. + * + * A same-document reference refers to a URI that is, aside from its fragment + * component, identical to the base URI. When no base URI is given, only an empty + * URI reference (apart from its fragment) is considered a same-document reference. + * + * @param UriInterface $uri The URI to check + * @param UriInterface|null $base An optional base URI to compare against + * + * @return bool + * + * @see https://tools.ietf.org/html/rfc3986#section-4.4 + */ + public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null) + { + if (null !== $base) { + $uri = UriResolver::resolve($base, $uri); + + return ($uri->getScheme() === $base->getScheme()) + && ($uri->getAuthority() === $base->getAuthority()) + && ($uri->getPath() === $base->getPath()) + && ($uri->getQuery() === $base->getQuery()); + } + + return '' === $uri->getScheme() && '' === $uri->getAuthority() && '' === $uri->getPath() && '' === $uri->getQuery(); + } + + /** + * Removes dot segments from a path and returns the new path. + * + * @param string $path + * + * @return string + * + * @deprecated since version 1.4. Use UriResolver::removeDotSegments instead. + * @see UriResolver::removeDotSegments + */ + public static function removeDotSegments($path) + { + return UriResolver::removeDotSegments($path); + } + + /** + * Converts the relative URI into a new URI that is resolved against the base URI. + * + * @param UriInterface $base Base URI + * @param string|UriInterface $rel Relative URI + * + * @return UriInterface + * + * @deprecated since version 1.4. Use UriResolver::resolve instead. + * @see UriResolver::resolve + */ + public static function resolve(UriInterface $base, $rel) + { + if (!($rel instanceof UriInterface)) { + $rel = new self($rel); + } + + return UriResolver::resolve($base, $rel); + } + + /** + * Creates a new URI with a specific query string value removed. + * + * Any existing query string values that exactly match the provided key are + * removed. + * + * @param uriInterface $uri URI to use as a base + * @param string $key query string key to remove + * + * @return UriInterface + */ + public static function withoutQueryValue(UriInterface $uri, $key) + { + $current = $uri->getQuery(); + if ('' === $current) { + return $uri; + } + + $decodedKey = rawurldecode($key); + $result = array_filter(explode('&', $current), function ($part) use ($decodedKey) { + $parts = explode('=', $part); + + return rawurldecode($parts[0]) !== $decodedKey; + }); + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a new URI with a specific query string value. + * + * Any existing query string values that exactly match the provided key are + * removed and replaced with the given key value pair. + * + * A value of null will set the query string key without a value, e.g. "key" + * instead of "key=value". + * + * @param UriInterface $uri URI to use as a base + * @param string $key key to set + * @param string|null $value Value to set + * + * @return UriInterface + */ + public static function withQueryValue(UriInterface $uri, $key, $value) + { + $current = $uri->getQuery(); + + if ('' === $current) { + $result = []; + } else { + $decodedKey = rawurldecode($key); + $result = array_filter(explode('&', $current), function ($part) use ($decodedKey) { + $parts = explode('=', $part); + + return rawurldecode($parts[0]) !== $decodedKey; + }); + } + + // Query string separators ("=", "&") within the key or value need to be encoded + // (while preventing double-encoding) before setting the query string. All other + // chars that need percent-encoding will be encoded by withQuery(). + $key = strtr($key, self::$replaceQuery); + + if (null !== $value) { + $result[] = $key.'='.strtr($value, self::$replaceQuery); + } else { + $result[] = $key; + } + + return $uri->withQuery(implode('&', $result)); + } + + /** + * Creates a URI from a hash of `parse_url` components. + * + * @throws \InvalidArgumentException if the components do not form a valid URI + * + * @return UriInterface + * + * @see http://php.net/manual/en/function.parse-url.php + * + */ + public static function fromParts(array $parts) + { + $uri = new self(); + $uri->applyParts($parts); + $uri->validateState(); + + return $uri; + } + + public function getScheme() + { + return $this->scheme; + } + + public function getAuthority() + { + $authority = $this->host; + if ('' !== $this->userInfo) { + $authority = $this->userInfo.'@'.$authority; + } + + if (null !== $this->port) { + $authority .= ':'.$this->port; + } + + return $authority; + } + + public function getUserInfo() + { + return $this->userInfo; + } + + public function getHost() + { + return $this->host; + } + + public function getPort() + { + return $this->port; + } + + public function getPath() + { + return $this->path; + } + + public function getQuery() + { + return $this->query; + } + + public function getFragment() + { + return $this->fragment; + } + + public function withScheme($scheme) + { + $scheme = $this->filterScheme($scheme); + + if ($this->scheme === $scheme) { + return $this; + } + + $new = clone $this; + $new->scheme = $scheme; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withUserInfo($user, $password = null) + { + $info = $user; + if ('' !== $password) { + $info .= ':'.$password; + } + + if ($this->userInfo === $info) { + return $this; + } + + $new = clone $this; + $new->userInfo = $info; + $new->validateState(); + + return $new; + } + + public function withHost($host) + { + $host = $this->filterHost($host); + + if ($this->host === $host) { + return $this; + } + + $new = clone $this; + $new->host = $host; + $new->validateState(); + + return $new; + } + + public function withPort($port) + { + $port = $this->filterPort($port); + + if ($this->port === $port) { + return $this; + } + + $new = clone $this; + $new->port = $port; + $new->removeDefaultPort(); + $new->validateState(); + + return $new; + } + + public function withPath($path) + { + $path = $this->filterPath($path); + + if ($this->path === $path) { + return $this; + } + + $new = clone $this; + $new->path = $path; + $new->validateState(); + + return $new; + } + + public function withQuery($query) + { + $query = $this->filterQueryAndFragment($query); + + if ($this->query === $query) { + return $this; + } + + $new = clone $this; + $new->query = $query; + + return $new; + } + + public function withFragment($fragment) + { + $fragment = $this->filterQueryAndFragment($fragment); + + if ($this->fragment === $fragment) { + return $this; + } + + $new = clone $this; + $new->fragment = $fragment; + + return $new; + } + + /** + * Apply parse_url parts to a URI. + * + * @param array $parts array of parse_url parts to apply + */ + private function applyParts(array $parts) + { + $this->scheme = isset($parts['scheme']) + ? $this->filterScheme($parts['scheme']) + : ''; + $this->userInfo = isset($parts['user']) ? $parts['user'] : ''; + $this->host = isset($parts['host']) + ? $this->filterHost($parts['host']) + : ''; + $this->port = isset($parts['port']) + ? $this->filterPort($parts['port']) + : null; + $this->path = isset($parts['path']) + ? $this->filterPath($parts['path']) + : ''; + $this->query = isset($parts['query']) + ? $this->filterQueryAndFragment($parts['query']) + : ''; + $this->fragment = isset($parts['fragment']) + ? $this->filterQueryAndFragment($parts['fragment']) + : ''; + if (isset($parts['pass'])) { + $this->userInfo .= ':'.$parts['pass']; + } + + $this->removeDefaultPort(); + } + + /** + * @param string $scheme + * + * @throws \InvalidArgumentException if the scheme is invalid + * + * @return string + * + */ + private function filterScheme($scheme) + { + if (!is_string($scheme)) { + throw new \InvalidArgumentException('Scheme must be a string'); + } + + return mb_strtolower($scheme); + } + + /** + * @param string $host + * + * @throws \InvalidArgumentException if the host is invalid + * + * @return string + * + */ + private function filterHost($host) + { + if (!is_string($host)) { + throw new \InvalidArgumentException('Host must be a string'); + } + + return mb_strtolower($host); + } + + /** + * @param int|null $port + * + * @throws \InvalidArgumentException if the port is invalid + * + * @return int|null + * + */ + private function filterPort($port) + { + if (null === $port) { + return null; + } + + $port = (int) $port; + if (1 > $port || 0xffff < $port) { + throw new \InvalidArgumentException(sprintf('Invalid port: %d. Must be between 1 and 65535', $port)); + } + + return $port; + } + + private function removeDefaultPort() + { + if (null !== $this->port && self::isDefaultPort($this)) { + $this->port = null; + } + } + + /** + * Filters the path of a URI. + * + * @param string $path + * + * @throws \InvalidArgumentException if the path is invalid + * + * @return string + * + */ + private function filterPath($path) + { + if (!is_string($path)) { + throw new \InvalidArgumentException('Path must be a string'); + } + + return preg_replace_callback( + '/(?:[^'.self::$charUnreserved.self::$charSubDelims.'%:@\/]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $path + ); + } + + /** + * Filters the query string or fragment of a URI. + * + * @param string $str + * + * @throws \InvalidArgumentException if the query or fragment is invalid + * + * @return string + * + */ + private function filterQueryAndFragment($str) + { + if (!is_string($str)) { + throw new \InvalidArgumentException('Query and fragment must be a string'); + } + + return preg_replace_callback( + '/(?:[^'.self::$charUnreserved.self::$charSubDelims.'%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', + [$this, 'rawurlencodeMatchZero'], + $str + ); + } + + private function rawurlencodeMatchZero(array $match) + { + return rawurlencode($match[0]); + } + + private function validateState() + { + if ('' === $this->host && ('http' === $this->scheme || 'https' === $this->scheme)) { + $this->host = self::HTTP_DEFAULT_HOST; + } + + if ('' === $this->getAuthority()) { + if (0 === mb_strpos($this->path, '//')) { + throw new \InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"'); + } + $parts = explode('/', $this->path, 2); + if ('' === $this->scheme && false !== mb_strpos($parts[0], ':')) { + throw new \InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon'); + } + } elseif (isset($this->path[0]) && '/' !== $this->path[0]) { + @trigger_error( + 'The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI '. + 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.', + E_USER_DEPRECATED + ); + $this->path = '/'.$this->path; + //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty'); + } + } +} diff --git a/clients/algoliasearch-client-php/lib/Http/Psr7/UriResolver.php b/clients/algoliasearch-client-php/lib/Http/Psr7/UriResolver.php new file mode 100644 index 0000000000..048328fe60 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Http/Psr7/UriResolver.php @@ -0,0 +1,227 @@ +getScheme()) { + return $rel->withPath(self::removeDotSegments($rel->getPath())); + } + + if ('' !== $rel->getAuthority()) { + $targetAuthority = $rel->getAuthority(); + $targetPath = self::removeDotSegments($rel->getPath()); + $targetQuery = $rel->getQuery(); + } else { + $targetAuthority = $base->getAuthority(); + if ('' === $rel->getPath()) { + $targetPath = $base->getPath(); + $targetQuery = '' !== $rel->getQuery() ? $rel->getQuery() : $base->getQuery(); + } else { + $path = $rel->getPath(); + if ('/' === $path[0]) { + $targetPath = $rel->getPath(); + } else { + if ('' !== $targetAuthority && '' === $base->getPath()) { + $targetPath = '/'.$rel->getPath(); + } else { + $lastSlashPos = mb_strrpos($base->getPath(), '/'); + if (false === $lastSlashPos) { + $targetPath = $rel->getPath(); + } else { + $targetPath = mb_substr($base->getPath(), 0, $lastSlashPos + 1).$rel->getPath(); + } + } + } + $targetPath = self::removeDotSegments($targetPath); + $targetQuery = $rel->getQuery(); + } + } + + return new Uri(Uri::composeComponents( + $base->getScheme(), + $targetAuthority, + $targetPath, + $targetQuery, + $rel->getFragment() + )); + } + + /** + * Returns the target URI as a relative reference from the base URI. + * + * This method is the counterpart to resolve(): + * + * (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) + * + * One use-case is to use the current request URI as base URI and then generate relative links in your documents + * to reduce the document size or offer self-contained downloadable document archives. + * + * $base = new Uri('http://example.com/a/b/'); + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. + * echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. + * echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. + * + * This method also accepts a target that is already relative and will try to relativize it further. Only a + * relative-path reference will be returned as-is. + * + * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well + * + * @param UriInterface $base Base URI + * @param UriInterface $target Target URI + * + * @return UriInterface The relative URI reference + */ + public static function relativize(UriInterface $base, UriInterface $target) + { + if ('' !== $target->getScheme() && + ($base->getScheme() !== $target->getScheme() || '' === $target->getAuthority() && '' !== $base->getAuthority()) + ) { + return $target; + } + + if (Uri::isRelativePathReference($target)) { + // As the target is already highly relative we return it as-is. It would be possible to resolve + // the target with `$target = self::resolve($base, $target);` and then try make it more relative + // by removing a duplicate query. But let's not do that automatically. + return $target; + } + + if ('' !== $target->getAuthority() && $base->getAuthority() !== $target->getAuthority()) { + return $target->withScheme(''); + } + + // We must remove the path before removing the authority because if the path starts with two slashes, the URI + // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also + // invalid. + $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost(''); + + if ($base->getPath() !== $target->getPath()) { + return $emptyPathUri->withPath(self::getRelativePath($base, $target)); + } + + if ($base->getQuery() === $target->getQuery()) { + // Only the target fragment is left. And it must be returned even if base and target fragment are the same. + return $emptyPathUri->withQuery(''); + } + + // If the base URI has a query but the target has none, we cannot return an empty path reference as it would + // inherit the base query component when resolving. + if ('' === $target->getQuery()) { + $segments = explode('/', $target->getPath()); + $lastSegment = end($segments); + + return $emptyPathUri->withPath('' === $lastSegment ? './' : $lastSegment); + } + + return $emptyPathUri; + } + + private static function getRelativePath(UriInterface $base, UriInterface $target) + { + $sourceSegments = explode('/', $base->getPath()); + $targetSegments = explode('/', $target->getPath()); + array_pop($sourceSegments); + $targetLastSegment = array_pop($targetSegments); + foreach ($sourceSegments as $i => $segment) { + if (isset($targetSegments[$i]) && $segment === $targetSegments[$i]) { + unset($sourceSegments[$i], $targetSegments[$i]); + } else { + break; + } + } + $targetSegments[] = $targetLastSegment; + $relativePath = str_repeat('../', count($sourceSegments)).implode('/', $targetSegments); + + // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./". + // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used + // as the first segment of a relative-path reference, as it would be mistaken for a scheme name. + $pathParts = explode('/', $relativePath, 2); + if ('' === $relativePath || false !== mb_strpos($pathParts[0], ':')) { + $relativePath = "./$relativePath"; + } elseif ('/' === $relativePath[0]) { + if ('' !== $base->getAuthority() && '' === $base->getPath()) { + // In this case an extra slash is added by resolve() automatically. So we must not add one here. + $relativePath = ".$relativePath"; + } else { + $relativePath = "./$relativePath"; + } + } + + return $relativePath; + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/clients/algoliasearch-client-php/lib/Http/Psr7/functions.php b/clients/algoliasearch-client-php/lib/Http/Psr7/functions.php new file mode 100644 index 0000000000..646e75341b --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Http/Psr7/functions.php @@ -0,0 +1,82 @@ +valid()) { + return false; + } + $result = $resource->current(); + $resource->next(); + + return $result; + }, $options); + } elseif (method_exists($resource, '__toString')) { + return stream_for((string) $resource, $options); + } + + break; + case 'NULL': + return new Stream(fopen('php://temp', 'r+'), $options); + } + if (is_callable($resource)) { + return new PumpStream($resource, $options); + } + + throw new \InvalidArgumentException('Invalid resource type: '.gettype($resource)); +} + +/** + * @internal + */ +function copy_to_string(StreamInterface $stream, $maxLen = -1) +{ + $buffer = ''; + if (-1 === $maxLen) { + while (!$stream->eof()) { + $buf = $stream->read(1048576); + // Using a loose equality here to match on '' and false. + if (null === $buf) { + break; + } + $buffer .= $buf; + } + + return $buffer; + } + $len = 0; + while (!$stream->eof() && $len < $maxLen) { + $buf = $stream->read($maxLen - $len); + // Using a loose equality here to match on '' and false. + if (null === $buf) { + break; + } + $buffer .= $buf; + $len = mb_strlen($buffer); + } + + return $buffer; +} diff --git a/clients/algoliasearch-client-php/lib/Log/DebugLogger.php b/clients/algoliasearch-client-php/lib/Log/DebugLogger.php new file mode 100644 index 0000000000..61c81ff1e1 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Log/DebugLogger.php @@ -0,0 +1,57 @@ + $level, + 'message' => $message, + 'context' => $context, + ]; + + if (function_exists('dump')) { + dump($logMessage); + } else { + var_dump($logMessage); + } + } + } +} diff --git a/clients/algoliasearch-client-php/lib/Model/AddApiKeyResponse.php b/clients/algoliasearch-client-php/lib/Model/AddApiKeyResponse.php index b27451a5a0..7636386e03 100644 --- a/clients/algoliasearch-client-php/lib/Model/AddApiKeyResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/AddApiKeyResponse.php @@ -32,7 +32,7 @@ class AddApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPITypes = [ 'key' => 'string', - 'createdAt' => '\DateTime', + 'createdAt' => 'string', ]; /** @@ -44,7 +44,7 @@ class AddApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPIFormats = [ 'key' => null, - 'createdAt' => 'date-time', + 'createdAt' => null, ]; /** @@ -215,7 +215,7 @@ public function setKey($key) /** * Gets createdAt * - * @return \DateTime + * @return string */ public function getCreatedAt() { @@ -225,7 +225,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param \DateTime $createdAt date of creation (ISO-8601 format) + * @param string $createdAt date of creation (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/BatchResponse.php b/clients/algoliasearch-client-php/lib/Model/BatchResponse.php index 13b488d920..b51b47bec8 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/BatchResponse.php @@ -194,7 +194,7 @@ public function getTaskID() /** * Sets taskID * - * @param int|null $taskID taskID of the indexing task to wait for + * @param int|null $taskID taskID of the task to wait for * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php b/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php index 25a3783669..f289737ba7 100644 --- a/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php +++ b/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php @@ -31,7 +31,7 @@ class CreatedAtObject implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'createdAt' => '\DateTime', + 'createdAt' => 'string', ]; /** @@ -42,7 +42,7 @@ class CreatedAtObject implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'createdAt' => 'date-time', + 'createdAt' => null, ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets createdAt * - * @return \DateTime + * @return string */ public function getCreatedAt() { @@ -192,7 +192,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param \DateTime $createdAt date of creation (ISO-8601 format) + * @param string $createdAt date of creation (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php index 518f5e1dd9..77bca235c0 100644 --- a/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/CreatedAtResponse.php @@ -33,7 +33,7 @@ class CreatedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializabl * @var string[] */ protected static $openAPITypes = [ - 'createdAt' => '\DateTime', + 'createdAt' => 'string', ]; /** @@ -44,7 +44,7 @@ class CreatedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializabl * @psalm-var array */ protected static $openAPIFormats = [ - 'createdAt' => 'date-time', + 'createdAt' => null, ]; /** @@ -184,7 +184,7 @@ public function valid() /** * Gets createdAt * - * @return \DateTime + * @return string */ public function getCreatedAt() { @@ -194,7 +194,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param \DateTime $createdAt date of creation (ISO-8601 format) + * @param string $createdAt date of creation (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php b/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php index 49799d84d4..02fdfdb0fc 100644 --- a/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/DeleteApiKeyResponse.php @@ -31,7 +31,7 @@ class DeleteApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'deletedAt' => '\DateTime', + 'deletedAt' => 'string', ]; /** @@ -42,7 +42,7 @@ class DeleteApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'deletedAt' => 'date-time', + 'deletedAt' => null, ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets deletedAt * - * @return \DateTime + * @return string */ public function getDeletedAt() { @@ -192,7 +192,7 @@ public function getDeletedAt() /** * Sets deletedAt * - * @param \DateTime $deletedAt date of deletion (ISO-8601 format) + * @param string $deletedAt date of deletion (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php b/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php index ad6f17652f..80e8ece2ad 100644 --- a/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/DeleteSourceResponse.php @@ -31,7 +31,7 @@ class DeleteSourceResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'deletedAt' => '\DateTime', + 'deletedAt' => 'string', ]; /** @@ -42,7 +42,7 @@ class DeleteSourceResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'deletedAt' => 'date-time', + 'deletedAt' => null, ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets deletedAt * - * @return \DateTime + * @return string */ public function getDeletedAt() { @@ -192,7 +192,7 @@ public function getDeletedAt() /** * Sets deletedAt * - * @param \DateTime $deletedAt date of deletion (ISO-8601 format) + * @param string $deletedAt date of deletion (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php index 1101441536..7519a77f1c 100644 --- a/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/DeletedAtResponse.php @@ -34,7 +34,7 @@ class DeletedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPITypes = [ 'taskID' => 'int', - 'deletedAt' => '\DateTime', + 'deletedAt' => 'string', ]; /** @@ -46,7 +46,7 @@ class DeletedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPIFormats = [ 'taskID' => null, - 'deletedAt' => 'date-time', + 'deletedAt' => null, ]; /** @@ -203,7 +203,7 @@ public function getTaskID() /** * Sets taskID * - * @param int $taskID taskID of the indexing task to wait for + * @param int $taskID taskID of the task to wait for * * @return self */ @@ -217,7 +217,7 @@ public function setTaskID($taskID) /** * Gets deletedAt * - * @return \DateTime + * @return string */ public function getDeletedAt() { @@ -227,7 +227,7 @@ public function getDeletedAt() /** * Sets deletedAt * - * @param \DateTime $deletedAt date of deletion (ISO-8601 format) + * @param string $deletedAt date of deletion (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Index.php b/clients/algoliasearch-client-php/lib/Model/Index.php index 94651a0e9b..55eed70a0e 100644 --- a/clients/algoliasearch-client-php/lib/Model/Index.php +++ b/clients/algoliasearch-client-php/lib/Model/Index.php @@ -32,8 +32,8 @@ class Index implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'name' => 'string', - 'createdAt' => '\DateTime', - 'updatedAt' => '\DateTime', + 'createdAt' => 'string', + 'updatedAt' => 'string', 'entries' => 'int', 'dataSize' => 'int', 'fileSize' => 'int', @@ -53,8 +53,8 @@ class Index implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'name' => null, - 'createdAt' => 'date-time', - 'updatedAt' => 'date-time', + 'createdAt' => null, + 'updatedAt' => null, 'entries' => null, 'dataSize' => null, 'fileSize' => null, @@ -287,7 +287,7 @@ public function setName($name) /** * Gets createdAt * - * @return \DateTime + * @return string */ public function getCreatedAt() { @@ -297,7 +297,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param \DateTime $createdAt Index creation date. An empty string means that the index has no records. + * @param string $createdAt Index creation date. An empty string means that the index has no records. * * @return self */ @@ -311,7 +311,7 @@ public function setCreatedAt($createdAt) /** * Gets updatedAt * - * @return \DateTime + * @return string */ public function getUpdatedAt() { @@ -321,7 +321,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime $updatedAt date of last update (ISO-8601 format) + * @param string $updatedAt date of last update (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/KeyObject.php b/clients/algoliasearch-client-php/lib/Model/KeyObject.php index 14b8aa70a7..d34b9e2227 100644 --- a/clients/algoliasearch-client-php/lib/Model/KeyObject.php +++ b/clients/algoliasearch-client-php/lib/Model/KeyObject.php @@ -39,7 +39,7 @@ class KeyObject implements ModelInterface, ArrayAccess, \JsonSerializable 'queryParameters' => 'string', 'referers' => 'string[]', 'validity' => 'int', - 'createdAt' => '\DateTime', + 'createdAt' => 'string', ]; /** @@ -58,7 +58,7 @@ class KeyObject implements ModelInterface, ArrayAccess, \JsonSerializable 'queryParameters' => null, 'referers' => null, 'validity' => null, - 'createdAt' => 'date-time', + 'createdAt' => null, ]; /** @@ -474,7 +474,7 @@ public function setValidity($validity) /** * Gets createdAt * - * @return \DateTime + * @return string */ public function getCreatedAt() { @@ -484,7 +484,7 @@ public function getCreatedAt() /** * Sets createdAt * - * @param \DateTime $createdAt date of creation (ISO-8601 format) + * @param string $createdAt date of creation (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php b/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php index 613ea7b881..51a48c7486 100644 --- a/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/RemoveUserIdResponse.php @@ -31,7 +31,7 @@ class RemoveUserIdResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'deletedAt' => '\DateTime', + 'deletedAt' => 'string', ]; /** @@ -42,7 +42,7 @@ class RemoveUserIdResponse implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'deletedAt' => 'date-time', + 'deletedAt' => null, ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets deletedAt * - * @return \DateTime + * @return string */ public function getDeletedAt() { @@ -192,7 +192,7 @@ public function getDeletedAt() /** * Sets deletedAt * - * @param \DateTime $deletedAt date of deletion (ISO-8601 format) + * @param string $deletedAt date of deletion (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php b/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php index 76fdb9b512..fc00c54e0a 100644 --- a/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ReplaceSourceResponse.php @@ -31,7 +31,7 @@ class ReplaceSourceResponse implements ModelInterface, ArrayAccess, \JsonSeriali * @var string[] */ protected static $openAPITypes = [ - 'updatedAt' => '\DateTime', + 'updatedAt' => 'string', ]; /** @@ -42,7 +42,7 @@ class ReplaceSourceResponse implements ModelInterface, ArrayAccess, \JsonSeriali * @psalm-var array */ protected static $openAPIFormats = [ - 'updatedAt' => 'date-time', + 'updatedAt' => null, ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets updatedAt * - * @return \DateTime + * @return string */ public function getUpdatedAt() { @@ -192,7 +192,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime $updatedAt date of last update (ISO-8601 format) + * @param string $updatedAt date of last update (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php b/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php index f941a44abc..c1a43fbf20 100644 --- a/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php @@ -224,7 +224,7 @@ public function getTaskID() /** * Sets taskID * - * @param int|null $taskID taskID of the indexing task to wait for + * @param int|null $taskID taskID of the task to wait for * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php b/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php index 2cc8ccc681..6135394f9a 100644 --- a/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SaveSynonymResponse.php @@ -32,7 +32,7 @@ class SaveSynonymResponse implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPITypes = [ 'taskID' => 'int', - 'updatedAt' => '\DateTime', + 'updatedAt' => 'string', 'id' => 'string', ]; @@ -45,7 +45,7 @@ class SaveSynonymResponse implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPIFormats = [ 'taskID' => null, - 'updatedAt' => 'date-time', + 'updatedAt' => null, 'id' => null, ]; @@ -210,7 +210,7 @@ public function getTaskID() /** * Sets taskID * - * @param int $taskID taskID of the indexing task to wait for + * @param int $taskID taskID of the task to wait for * * @return self */ @@ -224,7 +224,7 @@ public function setTaskID($taskID) /** * Gets updatedAt * - * @return \DateTime + * @return string */ public function getUpdatedAt() { @@ -234,7 +234,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime $updatedAt date of last update (ISO-8601 format) + * @param string $updatedAt date of last update (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php index 9e3f78f382..bcab6e30de 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponse.php @@ -37,7 +37,7 @@ class SearchUserIdsResponse implements ModelInterface, ArrayAccess, \JsonSeriali 'nbHits' => 'int', 'page' => 'int', 'hitsPerPage' => 'int', - 'updatedAt' => '\DateTime', + 'updatedAt' => 'string', ]; /** @@ -52,7 +52,7 @@ class SearchUserIdsResponse implements ModelInterface, ArrayAccess, \JsonSeriali 'nbHits' => null, 'page' => null, 'hitsPerPage' => null, - 'updatedAt' => 'date-time', + 'updatedAt' => null, ]; /** @@ -316,7 +316,7 @@ public function setHitsPerPage($hitsPerPage) /** * Gets updatedAt * - * @return \DateTime + * @return string */ public function getUpdatedAt() { @@ -326,7 +326,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime $updatedAt date of last update (ISO-8601 format) + * @param string $updatedAt date of last update (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php index 6e20bb2dd1..c56f206832 100644 --- a/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/UpdateApiKeyResponse.php @@ -32,7 +32,7 @@ class UpdateApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPITypes = [ 'key' => 'string', - 'updatedAt' => '\DateTime', + 'updatedAt' => 'string', ]; /** @@ -44,7 +44,7 @@ class UpdateApiKeyResponse implements ModelInterface, ArrayAccess, \JsonSerializ */ protected static $openAPIFormats = [ 'key' => null, - 'updatedAt' => 'date-time', + 'updatedAt' => null, ]; /** @@ -215,7 +215,7 @@ public function setKey($key) /** * Gets updatedAt * - * @return \DateTime + * @return string */ public function getUpdatedAt() { @@ -225,7 +225,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime $updatedAt date of last update (ISO-8601 format) + * @param string $updatedAt date of last update (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php index 506732b308..20a1ba0783 100644 --- a/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/UpdatedAtResponse.php @@ -34,7 +34,7 @@ class UpdatedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPITypes = [ 'taskID' => 'int', - 'updatedAt' => '\DateTime', + 'updatedAt' => 'string', ]; /** @@ -46,7 +46,7 @@ class UpdatedAtResponse implements ModelInterface, ArrayAccess, \JsonSerializabl */ protected static $openAPIFormats = [ 'taskID' => null, - 'updatedAt' => 'date-time', + 'updatedAt' => null, ]; /** @@ -203,7 +203,7 @@ public function getTaskID() /** * Sets taskID * - * @param int $taskID taskID of the indexing task to wait for + * @param int $taskID taskID of the task to wait for * * @return self */ @@ -217,7 +217,7 @@ public function setTaskID($taskID) /** * Gets updatedAt * - * @return \DateTime + * @return string */ public function getUpdatedAt() { @@ -227,7 +227,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime $updatedAt date of last update (ISO-8601 format) + * @param string $updatedAt date of last update (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php index 99ecebb94b..0deac1ac06 100644 --- a/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/UpdatedAtWithObjectIdResponse.php @@ -34,7 +34,7 @@ class UpdatedAtWithObjectIdResponse implements ModelInterface, ArrayAccess, \Jso */ protected static $openAPITypes = [ 'taskID' => 'int', - 'updatedAt' => '\DateTime', + 'updatedAt' => 'string', 'objectID' => 'string', ]; @@ -47,7 +47,7 @@ class UpdatedAtWithObjectIdResponse implements ModelInterface, ArrayAccess, \Jso */ protected static $openAPIFormats = [ 'taskID' => null, - 'updatedAt' => 'date-time', + 'updatedAt' => null, 'objectID' => null, ]; @@ -202,7 +202,7 @@ public function getTaskID() /** * Sets taskID * - * @param int|null $taskID taskID of the indexing task to wait for + * @param int|null $taskID taskID of the task to wait for * * @return self */ @@ -216,7 +216,7 @@ public function setTaskID($taskID) /** * Gets updatedAt * - * @return \DateTime|null + * @return string|null */ public function getUpdatedAt() { @@ -226,7 +226,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime|null $updatedAt date of last update (ISO-8601 format) + * @param string|null $updatedAt date of last update (ISO-8601 format) * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php b/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php index 9c649c82d5..917a82ffb7 100644 --- a/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/UpdatedRuleResponse.php @@ -32,7 +32,7 @@ class UpdatedRuleResponse implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPITypes = [ 'objectID' => 'string', - 'updatedAt' => '\DateTime', + 'updatedAt' => 'string', 'taskID' => 'int', ]; @@ -45,7 +45,7 @@ class UpdatedRuleResponse implements ModelInterface, ArrayAccess, \JsonSerializa */ protected static $openAPIFormats = [ 'objectID' => null, - 'updatedAt' => 'date-time', + 'updatedAt' => null, 'taskID' => null, ]; @@ -224,7 +224,7 @@ public function setObjectID($objectID) /** * Gets updatedAt * - * @return \DateTime + * @return string */ public function getUpdatedAt() { @@ -234,7 +234,7 @@ public function getUpdatedAt() /** * Sets updatedAt * - * @param \DateTime $updatedAt date of last update (ISO-8601 format) + * @param string $updatedAt date of last update (ISO-8601 format) * * @return self */ @@ -258,7 +258,7 @@ public function getTaskID() /** * Sets taskID * - * @param int $taskID taskID of the indexing task to wait for + * @param int $taskID taskID of the task to wait for * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/RequestOptions/RequestOptions.php b/clients/algoliasearch-client-php/lib/RequestOptions/RequestOptions.php new file mode 100644 index 0000000000..45b176223c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/RequestOptions/RequestOptions.php @@ -0,0 +1,368 @@ +{$name} = $options[$name]; + } + } + + $this->readTimeout = $options['readTimeout']; + $this->writeTimeout = $options['writeTimeout']; + $this->connectTimeout = $options['connectTimeout']; + } + + /** + * Get the HTTP headers to add to the request. + * + * @return array List of name/value pairs + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * Add a header to the list. If a value already exists for that name, it will be overwritten. + * + * @param string $name Name of the header + * @param string $value Value of the header + * + * @return $this + */ + public function addHeader($name, $value) + { + $this->headers[$name] = $value; + + return $this; + } + + /** + * @param $headers + * + * @return $this + */ + public function addHeaders($headers) + { + $this->headers = array_merge($this->headers, $headers); + + return $this; + } + + /** + * Add a new header to the list if there is no value already set. + * + * @param string $name Name of the header + * @param string $value Value of the header + * + * @return $this + */ + public function addDefaultHeader($name, $value) + { + if (!isset($this->headers[$name])) { + $this->headers[$name] = $value; + } + + return $this; + } + + /** + * Add the headers passed if the value isn't already set. + * + * @param array $headers List of header name/value pairs + * + * @return $this + */ + public function addDefaultHeaders($headers) + { + foreach ($headers as $name => $value) { + $this->addDefaultHeader($name, $value); + } + + return $this; + } + + /** + * Replace all existing headers with the given name/value pairs. + * + * @param array $headers List of header name/value pairs + * + * @return $this + */ + public function setHeaders($headers) + { + $this->headers = $headers; + + return $this; + } + + /** + * @return array List of name/value query parameters + */ + public function getQueryParameters() + { + return $this->query; + } + + /** + * @return string URL-encoded query string + */ + public function getBuiltQueryParameters() + { + return Helpers::buildQuery($this->query); + } + + /** + * Add a query parameter. If a value already exists for that name, it will be overwritten. + * + * @param string $name + * @param string $value + * + * @return $this + */ + public function addQueryParameter($name, $value) + { + $this->query[$name] = $value; + + return $this; + } + + /** + * Add a list of query parameters name/value pairs. + * If a value already exists for a name, it will be overwritten. + * + * @param $parameters + * + * @return $this + */ + public function addQueryParameters($parameters) + { + $this->query = array_merge($this->query, $parameters); + + return $this; + } + + /** + * Add a query parameter if it isn't already set. + * + * @param string $name Name of the query parameter + * @param string $value Value of the query parameter + * + * @return $this + */ + public function addDefaultQueryParameter($name, $value) + { + if (!isset($this->query[$name])) { + $this->query[$name] = $value; + } + + return $this; + } + + /** + * Add parameters if they aren't already set. + * + * @param array $queryParameters Query parameters name/value pairs + * + * @return $this + */ + public function addDefaultQueryParameters($queryParameters) + { + foreach ($queryParameters as $name => $value) { + $this->addDefaultQueryParameter($name, $value); + } + + return $this; + } + + /** + * Replace all existing query parameters with the given name/value pairs. + * + * @param array $queryParameters + * + * @return $this + */ + public function setQueryParameters($queryParameters) + { + $this->query = $queryParameters; + + return $this; + } + + /** + * Get HTTP body to add. + * + * @return array + */ + public function getBody() + { + return $this->body; + } + + /** + * Add a body parameter. If a value already exists for that name, it will be overwritten. + * + * @param string $name + * @param mixed $value + * + * @return $this + */ + public function addBodyParameter($name, $value) + { + $this->body[$name] = $value; + + return $this; + } + + /** + * Add parameters if they aren't already set. + * + * @param array $parameters Body parameters name/value pairs + * + * @return $this + */ + public function addBodyParameters($parameters) + { + $this->body = array_merge($this->body, $parameters); + + return $this; + } + + /** + * Add a body parameter if it isn't already set. + * + * @param string $name Name of the query parameter + * @param string $value Value of the query parameter + * + * @return $this + */ + public function addDefaultBodyParameter($name, $value) + { + if (!isset($this->body[$name])) { + $this->body[$name] = $value; + } + + return $this; + } + + /** + * Add parameters if they aren't already set. + * + * @param array $parameters Body parameters name/value pairs + * + * @return $this + */ + public function addDefaultBodyParameters($parameters) + { + foreach ($parameters as $name => $value) { + $this->addDefaultBodyParameter($name, $value); + } + + return $this; + } + + /** + * Replace all existing body parameters with the given name/value pairs. + * + * @param $body + * + * @return $this + */ + public function setBody($body) + { + $this->body = $body; + + return $this; + } + + /** + * Get timeout for read operations. + * + * @return int Timeout in seconds + */ + public function getReadTimeout() + { + return $this->readTimeout; + } + + /** + * Set timeout for read operations. + * + * @param int $readTimeout Timeout in seconds + * + * @return $this + */ + public function setReadTimeout($readTimeout) + { + $this->readTimeout = $readTimeout; + + return $this; + } + + /** + * Get timeout for write operations. + * + * @return int Timeout in seconds + */ + public function getWriteTimeout() + { + return $this->writeTimeout; + } + + /** + * Set timeout for write operations. + * + * @param int $writeTimeout Timeout in seconds + * + * @return $this + */ + public function setWriteTimeout($writeTimeout) + { + $this->writeTimeout = $writeTimeout; + + return $this; + } + + /** + * Get connect timeout. + * + * @return int Connect timeout in seconds + */ + public function getConnectTimeout() + { + return $this->connectTimeout; + } + + /** + * Set connect timeout. + * + * @param $connectTimeout Connect timeout in seconds + * + * @return $this + */ + public function setConnectTimeout($connectTimeout) + { + $this->connectTimeout = $connectTimeout; + + return $this; + } +} diff --git a/clients/algoliasearch-client-php/lib/RequestOptions/RequestOptionsFactory.php b/clients/algoliasearch-client-php/lib/RequestOptions/RequestOptionsFactory.php new file mode 100644 index 0000000000..d2ac6a6623 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/RequestOptions/RequestOptionsFactory.php @@ -0,0 +1,132 @@ +config = $config; + } + + /** + * @param \Algolia\AlgoliaSearch\RequestOptions\RequestOptions|array $options + * @param array $defaults + * + * @return \Algolia\AlgoliaSearch\RequestOptions\RequestOptions + */ + public function create($options, $defaults = []) + { + if (is_array($options)) { + $options += $defaults; + $options = $this->format($options); + $options = $this->normalize($options); + + $options = new RequestOptions($options); + } elseif ($options instanceof RequestOptions) { + $defaults = $this->create($defaults); + $options->addDefaultHeaders($defaults->getHeaders()); + $options->addDefaultQueryParameters($defaults->getQueryParameters()); + $options->addDefaultBodyParameters($defaults->getBody()); + } else { + throw new \InvalidArgumentException('RequestOptions can only be created from array or from RequestOptions object'); + } + + return $options->addDefaultHeaders($this->config->getDefaultHeaders()); + } + + public function createBodyLess($options, $defaults = []) + { + $options = $this->create($options, $defaults); + + return $options + ->addQueryParameters($options->getBody()) + ->setBody([]); + } + + private function normalize($options) + { + $normalized = [ + 'headers' => [ + 'X-Algolia-Application-Id' => $this->config->getAppId(), + 'X-Algolia-API-Key' => $this->config->getAlgoliaApiKey(), + 'User-Agent' => $this->config->getUserAgent() ? $this->config->getUserAgent() : UserAgent::get(), + 'Content-Type' => 'application/json', + ], + 'query' => [], + 'body' => [], + 'readTimeout' => $this->config->getReadTimeout(), + 'writeTimeout' => $this->config->getWriteTimeout(), + 'connectTimeout' => $this->config->getConnectTimeout(), + ]; + + foreach ($options as $optionName => $value) { + $type = $this->getOptionType($optionName); + + if (in_array($type, ['readTimeout', 'writeTimeout', 'connectTimeout'], true)) { + $normalized[$type] = $value; + } else { + $normalized[$type][$optionName] = $value; + } + } + + return $normalized; + } + + private function format($options) + { + foreach ($options as $name => $value) { + if (in_array($name, ['attributesToRetrieve', 'type'], true)) { + if (is_array($value)) { + $options[$name] = implode(',', $value); + } + } + } + + return $options; + } + + private function getOptionType($optionName) + { + if ($this->isValidHeaderName($optionName)) { + return 'headers'; + } elseif (in_array($optionName, $this->validQueryParameters, true)) { + return 'query'; + } elseif (in_array($optionName, ['connectTimeout', 'readTimeout', 'writeTimeout'], true)) { + return $optionName; + } + + return 'body'; + } + + private function isValidHeaderName($name) + { + if (preg_match('/^X-[a-zA-Z-]+/', $name)) { + return true; + } + + if (in_array($name, $this->validHeaders, true)) { + return true; + } + + return false; + } +} diff --git a/clients/algoliasearch-client-php/lib/RetryStrategy/ApiWrapper.php b/clients/algoliasearch-client-php/lib/RetryStrategy/ApiWrapper.php new file mode 100644 index 0000000000..b52ba94c24 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/RetryStrategy/ApiWrapper.php @@ -0,0 +1,269 @@ +http = $http; + $this->config = $config; + $this->clusterHosts = $clusterHosts; + $this->requestOptionsFactory = $RqstOptsFactory ?: new RequestOptionsFactory($config); + $this->logger = $logger ?: Algolia::getLogger(); + if (defined('JSON_UNESCAPED_UNICODE')) { + // `JSON_UNESCAPED_UNICODE` is introduced in PHP 5.4.0 + $this->jsonOptions = JSON_UNESCAPED_UNICODE; + } + } + + public function read($method, $path, $requestOptions = [], $defaultRequestOptions = []) + { + if ('GET' === mb_strtoupper($method)) { + $requestOptions = $this->requestOptionsFactory->createBodyLess($requestOptions, $defaultRequestOptions); + } else { + $requestOptions = $this->requestOptionsFactory->create($requestOptions, $defaultRequestOptions); + } + + return $this->request( + $method, + $path, + $requestOptions, + $this->clusterHosts->read(), + $requestOptions->getReadTimeout() + ); + } + + public function write($method, $path, $data = [], $requestOptions = [], $defaultRequestOptions = []) + { + if ('DELETE' === mb_strtoupper($method)) { + $requestOptions = $this->requestOptionsFactory->createBodyLess($requestOptions, $defaultRequestOptions); + $data = []; + } else { + $requestOptions = $this->requestOptionsFactory->create($requestOptions, $defaultRequestOptions); + } + + return $this->request( + $method, + $path, + $requestOptions, + $this->clusterHosts->write(), + $requestOptions->getWriteTimeout(), + $data + ); + } + + public function send($method, $path, $requestOptions = [], $hosts = null) + { + $requestOptions = $this->requestOptionsFactory->create($requestOptions); + + if (null === $hosts) { + $hosts = $this->clusterHosts->write(); + } elseif (!is_array($hosts)) { + $hosts = [$hosts]; + } + + return $this->request( + $method, + $path, + $requestOptions, + $hosts, + $requestOptions->getWriteTimeout() + ); + } + + private function request($method, $path, RequestOptions $requestOptions, $hosts, $timeout, $data = []) + { + $uri = $this->createUri($path) + ->withQuery($requestOptions->getBuiltQueryParameters()) + ->withScheme('https'); + + $body = array_merge($data, $requestOptions->getBody()); + + $logParams = [ + 'body' => $body, + 'headers' => $requestOptions->getHeaders(), + 'method' => $method, + 'query' => $requestOptions->getQueryParameters(), + ]; + + $retry = 1; + foreach ($hosts as $host) { + $uri = $uri->withHost($host); + $request = null; + $logParams['retryNumber'] = $retry; + $logParams['host'] = (string) $uri; + + try { + $request = $this->createRequest( + $method, + $uri, + $requestOptions->getHeaders(), + $body + ); + + $this->log(LogLevel::DEBUG, 'Sending request.', $logParams); + + $response = $this->http->sendRequest( + $request, + $timeout * $retry, + $requestOptions->getConnectTimeout() * $retry + ); + + $responseBody = $this->handleResponse($response, $request); + + $logParams['response'] = $responseBody; + $this->log(LogLevel::DEBUG, 'Response received.', $logParams); + + return $responseBody; + } catch (RetriableException $e) { + $this->log(LogLevel::DEBUG, 'Host failed.', array_merge($logParams, [ + 'description' => $e->getMessage(), + ])); + + $this->clusterHosts->failed($host); + } catch (BadRequestException $e) { + unset($logParams['body'], $logParams['headers']); + $logParams['description'] = $e->getMessage(); + $this->log(LogLevel::WARNING, 'Bad request.', $logParams); + + throw $e; + } catch (\Exception $e) { + unset($logParams['body'], $logParams['headers']); + $logParams['description'] = $e->getMessage(); + $this->log(LogLevel::ERROR, 'Generic error.', $logParams); + + throw $e; + } + + $retry++; + } + + throw new UnreachableException(); + } + + private function handleResponse(ResponseInterface $response, RequestInterface $request) + { + $body = (string) $response->getBody(); + $statusCode = $response->getStatusCode(); + + if (0 === $statusCode || ($statusCode >= 100 && $statusCode < 200) || $statusCode >= 500) { + $reason = $response->getReasonPhrase(); + + if (null === $response->getReasonPhrase() || '' === $response->getReasonPhrase()) { + $reason = $statusCode >= 500 ? 'Internal Server Error' : 'Unreachable Host'; + } + + throw new RetriableException('Retriable failure on '.$request->getUri()->getHost().': '.$reason, $statusCode); + } + + $responseArray = Helpers::json_decode($body, true); + + if (404 === $statusCode) { + throw new NotFoundException($responseArray['message'], $statusCode); + } elseif ($statusCode >= 400) { + throw new BadRequestException($responseArray['message'], $statusCode); + } elseif (2 !== (int) ($statusCode / 100)) { + throw new AlgoliaException($statusCode.': '.$body, $statusCode); + } + + return $responseArray; + } + + private function createUri($uri) + { + if ($uri instanceof UriInterface) { + return $uri; + } elseif (is_string($uri)) { + return new Uri($uri); + } + + throw new \InvalidArgumentException('URI must be a string or UriInterface'); + } + + private function createRequest( + $method, + $uri, + array $headers = [], + $body = null, + $protocolVersion = '1.1' + ) { + if (is_array($body)) { + // Send an empty body instead of "[]" in case there are + // no content/params to send + if (empty($body)) { + $body = ''; + } else { + $body = \json_encode($body, $this->jsonOptions); + if (JSON_ERROR_NONE !== json_last_error()) { + throw new \InvalidArgumentException('json_encode error: '.json_last_error_msg()); + } + } + } + + return new Request($method, $uri, $headers, $body, $protocolVersion); + } + + /** + * @param string $level + * @param string $message + */ + private function log($level, $message, array $context = []) + { + $this->logger->log($level, 'Algolia API client: '.$message, $context); + } +} diff --git a/clients/algoliasearch-client-php/lib/RetryStrategy/ApiWrapperInterface.php b/clients/algoliasearch-client-php/lib/RetryStrategy/ApiWrapperInterface.php new file mode 100644 index 0000000000..9d2ba6f822 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/RetryStrategy/ApiWrapperInterface.php @@ -0,0 +1,12 @@ +read = $read; + $this->write = $write; + } + + public static function create($read, $write = null) + { + if (null === $write) { + $write = $read; + } + + if (is_string($read)) { + $read = [$read => 0]; + } + + if (is_string($write)) { + $write = [$write => 0]; + } + + if (array_values($read) === $read) { + $read = array_fill_keys($read, 0); + } + + if (array_values($write) === $write) { + $write = array_fill_keys($write, 0); + } + + return new static(HostCollection::create($read), HostCollection::create($write)); + } + + public static function createFromAppId($applicationId) + { + $read = $write = [ + $applicationId.'-1.algolianet.com' => 0, + $applicationId.'-2.algolianet.com' => 0, + $applicationId.'-3.algolianet.com' => 0, + ]; + + $read[$applicationId.'-dsn.algolia.net'] = 10; + $write[$applicationId.'.algolia.net'] = 10; + + return static::create($read, $write); + } + + public static function createForPlaces() + { + $read = $write = [ + 'places-1.algolianet.com' => 0, + 'places-2.algolianet.com' => 0, + 'places-3.algolianet.com' => 0, + ]; + + $read['places-dsn.algolia.net'] = 10; + $write['places.algolia.net'] = 10; + + return static::create($read, $write); + } + + public static function createForAnalytics($region) + { + return static::create('analytics.'.$region.'.algolia.com'); + } + + public static function createForInsights($region) + { + return static::create('insights.'.$region.'.algolia.io'); + } + + public static function createForRecommendation($region) + { + return static::create('recommendation.'.$region.'.algolia.com'); + } + + public static function createFromCache($cacheKey) + { + if (!Algolia::isCacheEnabled()) { + return false; + } + + if (!Algolia::getCache()->has($cacheKey)) { + return false; + } + + return @unserialize(Algolia::getCache()->get($cacheKey)); + } + + public function read() + { + return $this->getUrls('read'); + } + + public function write() + { + return $this->getUrls('write'); + } + + public function failed($host) + { + $this->read->markAsDown($host); + $this->write->markAsDown($host); + + $this->updateCache(); + + return $this; + } + + public function reset() + { + $this->read->reset(); + $this->write->reset(); + + return $this; + } + + public function shuffle() + { + $this->read->shuffle(); + $this->write->shuffle(); + + return $this; + } + + /** + * Sets the cache key to save the state of the ClusterHosts. + * + * @param string $cacheKey + * + * @return $this + */ + public function setCacheKey($cacheKey) + { + $this->cacheKey = $cacheKey; + + return $this; + } + + private function getUrls($type) + { + $urls = $this->{$type}->getUrls(); + $lashHashName = 'last'.ucfirst($type).'Hash'; + + if (Algolia::isCacheEnabled()) { + $hash = sha1(implode('-', $urls)); + if ($hash !== $this->{$lashHashName}) { + $this->updateCache(); + } + $this->{$lashHashName} = $hash; + } + + return $urls; + } + + private function updateCache() + { + if (null !== $this->cacheKey && Algolia::isCacheEnabled()) { + Algolia::getCache()->set($this->cacheKey, serialize($this)); + } + } +} diff --git a/clients/algoliasearch-client-php/lib/RetryStrategy/Host.php b/clients/algoliasearch-client-php/lib/RetryStrategy/Host.php new file mode 100644 index 0000000000..d7685487ce --- /dev/null +++ b/clients/algoliasearch-client-php/lib/RetryStrategy/Host.php @@ -0,0 +1,65 @@ +url = $url; + $this->priority = $priority; + } + + public function getUrl() + { + return $this->url; + } + + public function getPriority() + { + return $this->priority; + } + + public function isUp() + { + if (!$this->up) { + $this->resetIfExpired(); + } + + return $this->up; + } + + public function markAsDown() + { + $this->up = false; + $this->lastCheck = time(); + } + + public function reset() + { + $this->up = true; + $this->lastCheck = null; + } + + private function resetIfExpired() + { + $expired = $this->lastCheck + self::TTL < time(); + + if ($expired) { + $this->reset(); + } + } +} diff --git a/clients/algoliasearch-client-php/lib/RetryStrategy/HostCollection.php b/clients/algoliasearch-client-php/lib/RetryStrategy/HostCollection.php new file mode 100644 index 0000000000..1f2c76d220 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/RetryStrategy/HostCollection.php @@ -0,0 +1,85 @@ +hosts = $hosts; + + $this->shuffle(); + } + + public static function create(array $urlsWithPriority) + { + $hosts = []; + foreach ($urlsWithPriority as $url => $priority) { + $hosts[] = new Host($url, $priority); + } + + return new static($hosts); + } + + public function get() + { + // We pass the result through array_values because sometimes + // we need to make sure you can access the first element + // via $result[0] + return array_values(array_filter($this->hosts, function (Host $host) { + return $host->isUp(); + })); + } + + public function getUrls() + { + return array_map(function (Host $host) { + return $host->getUrl(); + }, $this->get()); + } + + public function markAsDown($hostKey) + { + array_map(function (Host $host) use ($hostKey) { + if ($host->getUrl() === $hostKey) { + $host->markAsDown(); + } + }, $this->hosts); + } + + public function shuffle() + { + if (shuffle($this->hosts)) { + $this->sort(); + } + + return $this; + } + + public function reset() + { + foreach ($this->hosts as $host) { + $host->reset(); + } + + return $this; + } + + private function sort() + { + usort($this->hosts, function (Host $a, Host $b) { + $prioA = $a->getPriority(); + $prioB = $b->getPriority(); + if ($prioA === $prioB) { + return 0; + } + + return ($prioA > $prioB) ? -1 : 1; + }); + } +} diff --git a/clients/algoliasearch-client-php/lib/Support/Helpers.php b/clients/algoliasearch-client-php/lib/Support/Helpers.php new file mode 100644 index 0000000000..bfcbc3a0c2 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Support/Helpers.php @@ -0,0 +1,144 @@ + ['one', 'two']] is + * turned into key[1]=one&key[2]=two. Algolia will not understand key[x]. + * It should be turned into key=['one','two'] (before being url_encoded). + * + * @return string The urlencoded query string to send to Algolia + */ + public static function buildQuery(array $args) + { + if (!$args) { + return ''; + } + + $args = array_map(function ($value) { + if (is_array($value)) { + return json_encode($value); + } elseif (is_bool($value)) { + return $value ? 'true' : 'false'; + } + + return $value; + }, $args); + + return http_build_query($args); + } + + public static function buildBatch($items, $action) + { + return array_map(function ($item) use ($action) { + return [ + 'action' => $action, + 'body' => $item, + ]; + }, $items); + } + + public static function ensureObjectID($objects, $message = 'ObjectID is required to add a record, a synonym or a query rule.') + { + // In case a single objects is passed + if (isset($objects['objectID'])) { + return; + } + + // In case multiple objects are passed + foreach ($objects as $object) { + if (!isset($object['objectID']) && !isset($object['body']['objectID'])) { + throw new MissingObjectId($message); + } + } + } + + /** + * Wrapper for json_decode that throws when an error occurs. + * + * This function is extracted from Guzzlehttp/Guzzle package which is not + * compatible with PHP 5.3 so the client cannot always use it. + * + * @param string $json JSON data to parse + * @param bool $assoc when true, returned objects will be converted + * into associative arrays + * @param int $depth user specified recursion depth + * + * @throws \InvalidArgumentException if the JSON cannot be decoded + * + * @return mixed + * + * @see http://www.php.net/manual/en/function.json-decode.php + */ + public static function json_decode($json, $assoc = false, $depth = 512) + { + $data = \json_decode($json, $assoc, $depth); + if (JSON_ERROR_NONE !== json_last_error()) { + throw new \InvalidArgumentException('json_decode error: '.json_last_error_msg()); + } + + return $data; + } + + public static function mapObjectIDs($objectIDKey, $objects) + { + return array_map(function ($object) use ($objectIDKey) { + if (!isset($object[$objectIDKey])) { + throw new MissingObjectId("At least one object is missing the required $objectIDKey key: ".json_encode($object)); + } + $object['objectID'] = $object[$objectIDKey]; + + return $object; + }, $objects); + } + + public static function serializeQueryParameters($parameters) + { + if (is_string($parameters)) { + return $parameters; + } + + foreach ($parameters as $key => $value) { + if (is_array($value)) { + $parameters[$key] = json_encode($value, JSON_THROW_ON_ERROR); + } + } + + return http_build_query($parameters); + } +} diff --git a/clients/algoliasearch-client-php/lib/Support/UserAgent.php b/clients/algoliasearch-client-php/lib/Support/UserAgent.php new file mode 100644 index 0000000000..6be12e5f53 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Support/UserAgent.php @@ -0,0 +1,59 @@ + $version) { + $ua[] = $segment.' ('.$version.')'; + } + + return implode('; ', $ua); + } + + private static function getDefaultSegments() + { + $segments = []; + + $segments['Algolia for PHP'] = Algolia::VERSION; + $segments['PHP'] = rtrim(str_replace(PHP_EXTRA_VERSION, '', PHP_VERSION), '-'); + if (defined('HHVM_VERSION')) { + $segments['HHVM'] = HHVM_VERSION; + } + if (interface_exists('\GuzzleHttp\ClientInterface')) { + if (defined('\GuzzleHttp\ClientInterface::VERSION')) { + $segments['Guzzle'] = \GuzzleHttp\ClientInterface::VERSION; + } else { + $segments['Guzzle'] = \GuzzleHttp\ClientInterface::MAJOR_VERSION; + } + } + + return $segments; + } +} diff --git a/playground/php/composer.json b/playground/php/composer.json index de27d2ecc1..64bcd8f5e9 100644 --- a/playground/php/composer.json +++ b/playground/php/composer.json @@ -6,10 +6,12 @@ "ext-json": "*", "ext-mbstring": "*", "guzzlehttp/guzzle": "^7.3", - "guzzlehttp/psr7": "^2.0" + "guzzlehttp/psr7": "^2.0", + "psr/http-message": "^1.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" }, "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0", "friendsofphp/php-cs-fixer": "^2.12" }, "autoload": { diff --git a/playground/php/composer.lock b/playground/php/composer.lock index 0ecf4d8069..c94ccf2de2 100644 --- a/playground/php/composer.lock +++ b/playground/php/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "489ac62d82277d983b600fc514962e8f", + "content-hash": "aa1fa6e2e4607e45ceed43e93281a60a", "packages": [ { "name": "guzzlehttp/guzzle", @@ -489,6 +489,107 @@ }, "time": "2016-08-06T14:39:51+00:00" }, + { + "name": "psr/log", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.0" + }, + "time": "2021-07-14T16:46:02+00:00" + }, + { + "name": "psr/simple-cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "time": "2021-10-29T13:26:27+00:00" + }, { "name": "ralouphie/getallheaders", "version": "3.0.3", @@ -604,23 +705,23 @@ "packages-dev": [ { "name": "composer/pcre", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2" + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/3d322d715c43a1ac36c7fe215fa59336265500f2", - "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2", + "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1", + "phpstan/phpstan": "^1.3", "phpstan/phpstan-strict-rules": "^1.1", "symfony/phpunit-bridge": "^4.2 || ^5" }, @@ -655,7 +756,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.0" + "source": "https://github.com/composer/pcre/tree/1.0.1" }, "funding": [ { @@ -671,7 +772,7 @@ "type": "tidelift" } ], - "time": "2021-12-06T15:17:27+00:00" + "time": "2022-01-21T20:24:37+00:00" }, { "name": "composer/semver", @@ -892,103 +993,30 @@ }, "time": "2021-08-05T19:00:23+00:00" }, - { - "name": "doctrine/instantiator", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^8.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2020-11-10T18:47:58+00:00" - }, { "name": "doctrine/lexer", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042" + "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042", - "reference": "e864bbf5904cb8f5bb334f99209b48018522f042", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", + "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^8.2" + "doctrine/coding-standard": "^9.0", + "phpstan/phpstan": "1.3", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" @@ -1023,7 +1051,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.1" + "source": "https://github.com/doctrine/lexer/tree/1.2.2" }, "funding": [ { @@ -1039,7 +1067,7 @@ "type": "tidelift" } ], - "time": "2020-05-25T17:44:05+00:00" + "time": "2022-01-12T08:27:12+00:00" }, { "name": "friendsofphp/php-cs-fixer", @@ -1091,1958 +1119,87 @@ }, "suggest": { "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters.", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", - "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "extra": { - "branch-alias": { - "dev-master": "2.19-dev" - } - }, - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - }, - "classmap": [ - "tests/Test/AbstractFixerTestCase.php", - "tests/Test/AbstractIntegrationCaseFactory.php", - "tests/Test/AbstractIntegrationTestCase.php", - "tests/Test/Assert/AssertTokensTrait.php", - "tests/Test/IntegrationCase.php", - "tests/Test/IntegrationCaseFactory.php", - "tests/Test/IntegrationCaseFactoryInterface.php", - "tests/Test/InternalIntegrationCaseFactory.php", - "tests/Test/IsIdenticalConstraint.php", - "tests/Test/TokensWithObservedTransformers.php", - "tests/TestCase.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "support": { - "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.3" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2021-11-15T17:17:55+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.10.2", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "replace": { - "myclabs/deep-copy": "self.version" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2020-11-13T09:40:50+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v4.13.2", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" - }, - "time": "2021-11-30T19:35:32+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" - }, - "time": "2021-07-20T11:28:43+00:00" - }, - { - "name": "phar-io/version", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "bae7c545bef187884426f042434e561ab1ddb182" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", - "reference": "bae7c545bef187884426f042434e561ab1ddb182", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.1.0" - }, - "time": "2021-02-23T14:00:09+00:00" - }, - { - "name": "php-cs-fixer/diff", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "SpacePossum" - } - ], - "description": "sebastian/diff v2 backport support for PHP5.6", - "homepage": "https://github.com/PHP-CS-Fixer", - "keywords": [ - "diff" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" - }, - "time": "2020-10-14T08:39:05+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.6.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", - "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" - }, - "time": "2022-01-04T19:58:01+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "9.2.10", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687", - "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-05T09:12:13+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "3.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-02T12:48:52+00:00" - }, - { - "name": "phpunit/php-invoker", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcntl": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:58:55+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T05:33:50+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "5.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:16:10+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "9.5.11", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "2406855036db1102126125537adb1406f7242fdd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2406855036db1102126125537adb1406f7242fdd", - "reference": "2406855036db1102126125537adb1406f7242fdd", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.7", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^2.3.4", - "sebastian/version": "^3.0.2" - }, - "require-dev": { - "ext-pdo": "*", - "phpspec/prophecy-phpunit": "^2.0.1" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.5-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ], - "files": [ - "src/Framework/Assert/Functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.11" - }, - "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-25T07:07:57+00:00" - }, - { - "name": "psr/cache", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" - }, - "time": "2021-02-03T23:26:27+00:00" - }, - { - "name": "psr/container", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "time": "2021-11-05T16:47:00+00:00" - }, - { - "name": "psr/event-dispatcher", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" - }, - "time": "2019-01-08T18:20:26+00:00" - }, - { - "name": "psr/log", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/2.0.0" - }, - "time": "2021-07-14T16:41:46+00:00" - }, - { - "name": "sebastian/cli-parser", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:08:49+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:08:54+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:30:19+00:00" - }, - { - "name": "sebastian/comparator", - "version": "4.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T15:49:45+00:00" - }, - { - "name": "sebastian/complexity", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", - "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T15:52:27+00:00" - }, - { - "name": "sebastian/diff", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:10:38+00:00" - }, - { - "name": "sebastian/environment", - "version": "5.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", - "reference": "388b6ced16caa751030f6a69e588299fa09200ac", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:52:38+00:00" - }, - { - "name": "sebastian/exporter", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-11-11T14:18:36+00:00" - }, - { - "name": "sebastian/global-state", - "version": "5.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", - "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-06-11T13:31:12+00:00" - }, - { - "name": "sebastian/lines-of-code", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", - "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-28T06:42:11+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:12:34+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" + "ext-mbstring": "For handling non-UTF8 characters.", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", + "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." }, - "type": "library", + "bin": [ + "php-cs-fixer" + ], + "type": "application", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.19-dev" } }, "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, "classmap": [ - "src/" + "tests/Test/AbstractFixerTestCase.php", + "tests/Test/AbstractIntegrationCaseFactory.php", + "tests/Test/AbstractIntegrationTestCase.php", + "tests/Test/Assert/AssertTokensTrait.php", + "tests/Test/IntegrationCase.php", + "tests/Test/IntegrationCaseFactory.php", + "tests/Test/IntegrationCaseFactoryInterface.php", + "tests/Test/InternalIntegrationCaseFactory.php", + "tests/Test/IsIdenticalConstraint.php", + "tests/Test/TokensWithObservedTransformers.php", + "tests/TestCase.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" } ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "description": "A tool to automatically fix PHP code style", "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", + "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.3" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/keradus", "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2021-11-15T17:17:55+00:00" }, { - "name": "sebastian/recursion-context", - "version": "4.0.4", + "name": "php-cs-fixer/diff", + "version": "v1.3.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", + "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", "shasum": "" }, "require": { - "php": ">=7.3" + "php": "^5.6 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", + "symfony/process": "^3.3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, "autoload": { "classmap": [ "src/" @@ -3058,217 +1215,194 @@ "email": "sebastian@phpunit.de" }, { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "name": "SpacePossum" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "description": "sebastian/diff v2 backport support for PHP5.6", + "homepage": "https://github.com/PHP-CS-Fixer", + "keywords": [ + "diff" + ], "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + "issues": "https://github.com/PHP-CS-Fixer/diff/issues", + "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:17:30+00:00" + "time": "2020-10-14T08:39:05+00:00" }, { - "name": "sebastian/resource-operations", - "version": "3.0.3", + "name": "psr/cache", + "version": "3.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", "shasum": "" }, "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Cache\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + "source": "https://github.com/php-fig/cache/tree/3.0.0" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2021-02-03T23:26:27+00:00" }, { - "name": "sebastian/type", - "version": "2.3.4", + "name": "psr/container", + "version": "1.1.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", - "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" + "php": ">=7.4.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Container\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-06-15T12:49:02+00:00" + "time": "2021-11-05T16:50:12+00:00" }, { - "name": "sebastian/version", - "version": "3.0.2", + "name": "psr/event-dispatcher", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=7.2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2019-01-08T18:20:26+00:00" }, { "name": "symfony/console", - "version": "v5.4.2", + "version": "v5.2.11", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e" + "reference": "2f93c8c64295e029b7ff4d68b9a59c5ad8b7e24a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a2c6b7ced2eb7799a35375fb9022519282b5405e", - "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e", + "url": "https://api.github.com/repos/symfony/console/zipball/2f93c8c64295e029b7ff4d68b9a59c5ad8b7e24a", + "reference": "2f93c8c64295e029b7ff4d68b9a59c5ad8b7e24a", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" + "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2", + "symfony/string": "^5.1" }, "conflict": { - "psr/log": ">=3", "symfony/dependency-injection": "<4.4", "symfony/dotenv": "<5.1", "symfony/event-dispatcher": "<4.4", @@ -3276,16 +1410,16 @@ "symfony/process": "<4.4" }, "provide": { - "psr/log-implementation": "1.0|2.0" + "psr/log-implementation": "1.0" }, "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" + "psr/log": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" }, "suggest": { "psr/log": "For using the console logger", @@ -3325,7 +1459,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.2" + "source": "https://github.com/symfony/console/tree/v5.2.11" }, "funding": [ { @@ -3341,7 +1475,7 @@ "type": "tidelift" } ], - "time": "2021-12-20T16:11:12+00:00" + "time": "2021-06-06T09:50:27+00:00" }, { "name": "symfony/event-dispatcher", @@ -4403,21 +2537,21 @@ }, { "name": "symfony/service-contracts", - "version": "v3.0.0", + "version": "v2.4.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603" + "reference": "d664541b99d6fb0247ec5ff32e87238582236204" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/36715ebf9fb9db73db0cb24263c79077c6fe8603", - "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d664541b99d6fb0247ec5ff32e87238582236204", + "reference": "d664541b99d6fb0247ec5ff32e87238582236204", "shasum": "" }, "require": { - "php": ">=8.0.2", - "psr/container": "^2.0" + "php": ">=7.2.5", + "psr/container": "^1.1" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -4428,7 +2562,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -4465,7 +2599,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.0.0" + "source": "https://github.com/symfony/service-contracts/tree/v2.4.1" }, "funding": [ { @@ -4481,7 +2615,7 @@ "type": "tidelift" } ], - "time": "2021-11-04T17:53:12+00:00" + "time": "2021-11-04T16:37:19+00:00" }, { "name": "symfony/stopwatch", @@ -4547,33 +2681,34 @@ }, { "name": "symfony/string", - "version": "v6.0.2", + "version": "v5.4.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "bae261d0c3ac38a1f802b4dfed42094296100631" + "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/bae261d0c3ac38a1f802b4dfed42094296100631", - "reference": "bae261d0c3ac38a1f802b4dfed42094296100631", + "url": "https://api.github.com/repos/symfony/string/zipball/e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", + "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": ">=3.0" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" }, "type": "library", "autoload": { @@ -4612,7 +2747,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.0.2" + "source": "https://github.com/symfony/string/tree/v5.4.2" }, "funding": [ { @@ -4628,115 +2763,7 @@ "type": "tidelift" } ], - "time": "2021-12-16T22:13:01+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2021-07-28T10:34:58+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.10.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" - }, - "time": "2021-03-09T10:59:23+00:00" + "time": "2021-12-16T21:52:00+00:00" } ], "aliases": [], diff --git a/playground/php/src/search.php b/playground/php/src/search.php index 4c99da9049..b6207084f7 100644 --- a/playground/php/src/search.php +++ b/playground/php/src/search.php @@ -1,11 +1,10 @@ listIndices()); +var_dump($client->search($indexName, ['query' => getenv('SEARCH_QUERY')])); diff --git a/scripts/builds/clients.sh b/scripts/builds/clients.sh index aabb944e43..8bf76b7b47 100755 --- a/scripts/builds/clients.sh +++ b/scripts/builds/clients.sh @@ -18,6 +18,9 @@ build_client(){ if [[ $lang == 'javascript' ]]; then yarn workspace $package build + elif [[ $lang == 'php' ]]; then + # no build needed (for now) + : elif [[ $lang == 'java' ]]; then CMD="mvn clean install -f clients/$package/pom.xml" if [[ $VERBOSE == "true" ]]; then diff --git a/scripts/playground.sh b/scripts/playground.sh index faee821068..9bcd1d846d 100755 --- a/scripts/playground.sh +++ b/scripts/playground.sh @@ -16,6 +16,12 @@ run_playground() { yarn workspace javascript-playground start:$client elif [[ $lang == 'java' ]]; then mvn clean compile exec:java -f playground/java/pom.xml + elif [[ $lang == 'php' ]]; then + cd playground/php + composer update + composer dump-autoload + cd src + php8 $client.php fi } diff --git a/scripts/post-gen/php.sh b/scripts/post-gen/php.sh index ced475c742..74a7dc8764 100755 --- a/scripts/post-gen/php.sh +++ b/scripts/post-gen/php.sh @@ -3,13 +3,22 @@ set -e export GENERATOR=$1 export CLIENT=$(cat openapitools.json | jq -r --arg generator "$GENERATOR" '."generator-cli".generators[$generator].output' | sed 's/#{cwd}\///g') +#Move Configuration file +mv ./$CLIENT/lib/Configuration.php ./$CLIENT/lib/Configuration/ + lint_client() { echo "> Linting ${GENERATOR}..." cd $CLIENT - composer install - PHP_CS_FIXER_IGNORE_ENV=1 php vendor/bin/php-cs-fixer fix lib/ -v --using-cache=no --allow-risky=yes - + composer update + composer dump-autoload + + if [[ $CI ]]; then + PHP="php" + else + PHP="php8" + fi + PHP_CS_FIXER_IGNORE_ENV=1 $PHP vendor/bin/php-cs-fixer fix lib/ -v --using-cache=no --allow-risky=yes } lint_client diff --git a/templates/php/Configuration.mustache b/templates/php/Configuration.mustache index 4850801977..dad3b4dd00 100644 --- a/templates/php/Configuration.mustache +++ b/templates/php/Configuration.mustache @@ -1,6 +1,6 @@ tempFolderPath = sys_get_temp_dir(); - $this->setAlgoliaApiKey($algoliaApiKey); - $this->setApiKey('X-Algolia-API-Key', $algoliaApiKey); + if(isset($config['apiKey'])) { + $this->setAlgoliaApiKey($config['apiKey']); + $this->setApiKey('X-Algolia-API-Key', $config['apiKey']); + } - $this->setAppId($appId); - $this->setApiKey('X-Algolia-Application-Id', $appId); + if(isset($config['appId'])) { + $this->setAppId($config['appId']); + $this->setApiKey('X-Algolia-Application-Id', $config['appId']); + } - $this->setHost("https://{$appId}-1.algolianet.com"); + $config += $this->getDefaultConfiguration(); + $this->config = $config; } /** @@ -177,101 +153,6 @@ class Configuration return $this->accessToken; } - /** - * Sets the Algolia Application ID - * - * @param string $appId Application ID - * - * @return $this - */ - public function setAppId($appId = '') - { - $this->appId = $appId; - } - - /** - * Gets the Algolia application ID - * - * @return string - */ - public function getAppId() - { - return $this->appId; - } - - /** - * Sets the Algolia API Key - * - * @param string $algoliaApiKey Algolia API Key - * - * @return $this - */ - public function setAlgoliaApiKey($algoliaApiKey = '') - { - $this->algoliaApiKey = $algoliaApiKey; - } - - /** - * Gets the Algolia API Key - * - * @return string - */ - public function getAlgoliaApiKey() - { - return $this->algoliaApiKey; - } - - /** - * Sets the host - * - * @param string $host Host - * - * @return $this - */ - public function setHost($host) - { - $this->host = $host; - return $this; - } - - /** - * Gets the host - * - * @return string Host - */ - public function getHost() - { - return $this->host; - } - - /** - * Sets the user agent of the api client - * - * @param string $userAgent the user agent of the api client - * - * @throws \InvalidArgumentException - * @return $this - */ - public function setUserAgent($userAgent) - { - if (!is_string($userAgent)) { - throw new \InvalidArgumentException('User-agent must be a string.'); - } - - $this->userAgent = $userAgent; - return $this; - } - - /** - * Gets the user agent of the api client - * - * @return string user agent - */ - public function getUserAgent() - { - return $this->userAgent; - } - /** * Sets debug flag * @@ -341,51 +222,6 @@ class Configuration return $this->tempFolderPath; } - /** - * Gets the default configuration instance - * - * @return Configuration - */ - public static function getDefaultConfiguration() - { - if (self::$defaultConfiguration === null) { - self::$defaultConfiguration = new Configuration(); - } - - return self::$defaultConfiguration; - } - - /** - * Sets the default configuration instance - * - * @param Configuration $config An instance of the Configuration Object - * - * @return void - */ - public static function setDefaultConfiguration(Configuration $config) - { - self::$defaultConfiguration = $config; - } - - /** - * Gets the essential information for debugging - * - * @return string The report for debugging - */ - public static function toDebugReport() - { - $report = 'PHP SDK ({{invokerPackage}}) Debug Report:' . PHP_EOL; - $report .= ' OS: ' . php_uname() . PHP_EOL; - $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: {{version}}' . PHP_EOL; - {{#artifactVersion}} - $report .= ' SDK Package Version: {{.}}' . PHP_EOL; - {{/artifactVersion}} - $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; - - return $report; - } - /** * Get API key (with prefix if set) * @@ -410,82 +246,4 @@ class Configuration return $keyWithPrefix; } - - /** - * Returns an array of host settings - * - * @return array an array of host settings - */ - public function getHostSettings() - { - return [ - {{#servers}} - [ - "url" => "{{{url}}}", - "description" => "{{{description}}}{{^description}}No description provided{{/description}}", - {{#variables}} - {{#-first}} - "variables" => [ - {{/-first}} - "{{{name}}}" => [ - "description" => "{{{description}}}{{^description}}No description provided{{/description}}", - "default_value" => "{{{defaultValue}}}", - {{#enumValues}} - {{#-first}} - "enum_values" => [ - {{/-first}} - "{{{.}}}"{{^-last}},{{/-last}} - {{#-last}} - ] - {{/-last}} - {{/enumValues}} - ]{{^-last}},{{/-last}} - {{#-last}} - ] - {{/-last}} - {{/variables}} - ]{{^-last}},{{/-last}} - {{/servers}} - ]; - } - - /** - * Returns URL based on the index and variables - * - * @param int $index index of the host settings - * @param array|null $variables hash of variable and the corresponding value (optional) - * @return string URL based on host settings - */ - public function getHostFromSettings($index, $variables = null) - { - if (null === $variables) { - $variables = []; - } - - $hosts = $this->getHostSettings(); - - // check array index out of bound - if ($index < 0 || $index >= sizeof($hosts)) { - throw new \InvalidArgumentException("Invalid index $index when selecting the host. Must be less than ".sizeof($hosts)); - } - - $host = $hosts[$index]; - $url = $host["url"]; - - // go through variable and assign a value - foreach ($host["variables"] ?? [] as $name => $variable) { - if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user - if (in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum - $url = str_replace("{".$name."}", $variables[$name], $url); - } else { - throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); - } - } else { - // use default value - $url = str_replace("{".$name."}", $variable["default_value"], $url); - } - } - - return $url; - } } diff --git a/templates/php/api.mustache b/templates/php/api.mustache index cfe2d4a09d..b6b23880c3 100644 --- a/templates/php/api.mustache +++ b/templates/php/api.mustache @@ -2,17 +2,19 @@ namespace {{apiPackage}}; -use GuzzleHttp\Client; -use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Exception\ConnectException; use GuzzleHttp\Psr7\MultipartStream; -use GuzzleHttp\Psr7\Request; use GuzzleHttp\RequestOptions; +use GuzzleHttp\Utils; +use {{invokerPackage}}\Algolia; use {{invokerPackage}}\ApiException; -use {{invokerPackage}}\Configuration; +use {{invokerPackage}}\Configuration\Configuration; use {{invokerPackage}}\HeaderSelector; use {{invokerPackage}}\ObjectSerializer; +use {{invokerPackage}}\RetryStrategy\ApiWrapper; +use {{invokerPackage}}\RetryStrategy\ApiWrapperInterface; +use {{invokerPackage}}\RetryStrategy\ClusterHosts; /** * {{classname}} Class Doc Comment @@ -23,9 +25,9 @@ use {{invokerPackage}}\ObjectSerializer; {{#operations}}class {{classname}} { /** - * @var ClientInterface + * @var ApiWrapperInterface */ - protected $client; + protected $api; /** * @var Configuration @@ -37,41 +39,57 @@ use {{invokerPackage}}\ObjectSerializer; */ protected $headerSelector; - /** - * @var int Host index - */ - protected $hostIndex; - /** * @param Configuration $config + * @param ApiWrapperInterface $apiWrapper */ - public function __construct(Configuration $config = null) + public function __construct(ApiWrapperInterface $apiWrapper, Configuration $config) { - $this->config = $config ?: new Configuration(); + $this->config = $config; - $this->client = new Client(); + $this->api = $apiWrapper; $this->headerSelector = new HeaderSelector(); - $this->hostIndex = 0; } /** - * Set the host index + * Instantiate the client with basic credentials * - * @param int $hostIndex Host index (required) + * @param string $appId Application ID + * @param string $apiKey Algolia API Key */ - public function setHostIndex($hostIndex): void + public static function create($appId = null, $apiKey = null) { - $this->hostIndex = $hostIndex; + return static::createWithConfig(Configuration::create($appId, $apiKey)); } /** - * Get the host index + * Instantiate the client with congiguration * - * @return int Host index + * @param Configuration $config Configuration */ - public function getHostIndex() + public static function createWithConfig(Configuration $config) { - return $this->hostIndex; + $config = clone $config; + + $cacheKey = sprintf('%s-clusterHosts-%s', __CLASS__, $config->getAppId()); + + if ($hosts = $config->getHosts()) { + // If a list of hosts was passed, we ignore the cache + $clusterHosts = ClusterHosts::create($hosts); + } elseif (false === ($clusterHosts = ClusterHosts::createFromCache($cacheKey))) { + // We'll try to restore the ClusterHost from cache, if we cannot + // we create a new instance and set the cache key + $clusterHosts = ClusterHosts::createFromAppId($config->getAppId()) + ->setCacheKey($cacheKey); + } + + $apiWrapper = new ApiWrapper( + Algolia::getHttpClient(), + $config, + $clusterHosts + ); + + return new static($apiWrapper, $config); } /** @@ -179,7 +197,7 @@ use {{invokerPackage}}\ObjectSerializer; $resourcePath = '{{{path}}}'; $queryParams = []; $headerParams = []; - $httpBody = ''; + $httpBody = []; {{#queryParams}} // query params {{#isExplode}} @@ -240,17 +258,10 @@ use {{invokerPackage}}\ObjectSerializer; ); {{#bodyParams}} if (isset(${{paramName}})) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization(${{paramName}})); + $httpBody = ${{paramName}}; } {{/bodyParams}} {{#authMethods}} - {{#isApiKey}} - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('{{keyParamName}}'); - if ($apiKey !== null) { - {{#isKeyInHeader}}$headers['{{keyParamName}}'] = $apiKey;{{/isKeyInHeader}}{{#isKeyInQuery}}$queryParams['{{keyParamName}}'] = $apiKey;{{/isKeyInQuery}} - } - {{/isApiKey}} {{#isBasic}} {{#isBasicBasic}} // this endpoint requires HTTP basic authentication @@ -293,208 +304,27 @@ use {{invokerPackage}}\ObjectSerializer; {{/servers.0}} $query = \GuzzleHttp\Psr7\Query::build($queryParams); - $request = new Request( - '{{httpMethod}}', - {{^servers.0}}$this->config->getHost(){{/servers.0}}{{#servers.0}}$operationHost{{/servers.0}} . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - - $expectedResponse = null; - {{#responses.0}} - $expectedResponse = '{{responses.0.dataType}}'; - {{/responses.0}} - {{#returnType}}list($response) = {{/returnType}}$this->sendRequest($request, $expectedResponse); - {{#returnType}} - return $response; - {{/returnType}} + return $this->sendRequest('{{httpMethod}}', $resourcePath, $query, $httpBody); } {{/operation}} - /** - * Create http client option - * - * @throws \RuntimeException on file opening failure - * @return array of http client options - */ - protected function createHttpClientOption() - { - $options = []; - if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); - if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); - } - } - return $options; - } - - /** - * Send the request and handle the response - * - * @throws \RuntimeException on file opening failure - * @return array - */ - protected function sendRequest($request, $expectedResponse) + private function sendRequest($method, $resourcePath, $query, $httpBody) { - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - switch($statusCode) { - case 200: - if ($expectedResponse === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, $expectedResponse, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 400: - if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 402: - if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 403: - if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\Algolia\AlgoliaSearch\Model\ErrorBase' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, '\Algolia\AlgoliaSearch\Model\ErrorBase', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } - - $returnType = $expectedResponse; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - $expectedResponse, - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 400: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Algolia\AlgoliaSearch\Model\ErrorBase', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 402: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Algolia\AlgoliaSearch\Model\ErrorBase', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 403: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Algolia\AlgoliaSearch\Model\ErrorBase', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Algolia\AlgoliaSearch\Model\ErrorBase', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; + if($method == 'GET') { + $request = $this->api->read( + $method, + $resourcePath . ($query ? "?{$query}" : '') + ); + } else { + $request = $this->api->write( + $method, + $resourcePath . ($query ? "?{$query}" : ''), + $httpBody + ); } + + return $request; } } {{/operations}} diff --git a/templates/php/composer.mustache b/templates/php/composer.mustache index 6a69cead65..dc58dcb590 100644 --- a/templates/php/composer.mustache +++ b/templates/php/composer.mustache @@ -29,14 +29,19 @@ "ext-json": "*", "ext-mbstring": "*", "guzzlehttp/guzzle": "^7.3", - "guzzlehttp/psr7": "^2.0" + "guzzlehttp/psr7": "^2.0", + "psr/http-message": "^1.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" }, "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0", - "friendsofphp/php-cs-fixer": "^2.12" + "friendsofphp/php-cs-fixer": "^3.5.0" }, "autoload": { - "psr-4": { "{{escapedInvokerPackage}}\\" : "{{srcBasePath}}/" } + "psr-4": { "{{escapedInvokerPackage}}\\" : "{{srcBasePath}}/" }, + "files": [ + "{{srcBasePath}}/Http/Psr7/functions.php" + ] }, "autoload-dev": { "psr-4": { "{{escapedInvokerPackage}}\\Test\\" : "{{testBasePath}}/" } From 324e4d82fec9da81c69624a0e92125178b274de8 Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Tue, 1 Feb 2022 15:01:57 +0100 Subject: [PATCH 09/26] feat(php): Add remaining php clients (#106) --- .../algoliasearch-client-php/composer.json | 2 +- .../lib/Api/AbtestingApi.php | 374 ++++ .../lib/Api/AnalyticsApi.php | 1701 +++++++++++++++++ .../lib/Api/InsightsApi.php | 161 ++ .../lib/Api/PersonalizationApi.php | 305 +++ .../lib/Api/QuerySuggestionsApi.php | 460 +++++ .../lib/Api/RecommendApi.php | 159 ++ .../lib/Api/SearchApi.php | 18 +- .../lib/Configuration/AbTestingConfig.php | 7 + .../lib/Configuration/AbstractConfig.php | 164 -- .../lib/Configuration/AnalyticsConfig.php | 7 + .../lib/Configuration/ConfigWithRegion.php | 28 + .../lib/Configuration/Configuration.php | 137 +- .../lib/Configuration/InsightsConfig.php | 7 + .../Configuration/PersonalizationConfig.php | 7 + .../Configuration/QuerySuggestionsConfig.php | 7 + .../lib/Configuration/RecommendConfig.php | 7 + .../lib/Configuration/SearchConfig.php | 34 + .../lib/Model/ABTest.php | 525 +++++ .../lib/Model/ABTestResponse.php | 360 ++++ .../lib/Model/AbTestsVariant.php | 357 ++++ .../lib/Model/AbTestsVariantSearchParams.php | 390 ++++ .../lib/Model/AddABTestsRequest.php | 374 ++++ .../lib/Model/AddABTestsVariant.php | 390 ++++ .../lib/Model/CustomSearchParams.php | 294 +++ .../lib/Model/DeleteUserProfileResponse.php | 327 ++++ .../lib/Model/EventScoring.php | 360 ++++ .../lib/Model/FacetScoring.php | 327 ++++ .../Model/GetAverageClickPositionResponse.php | 360 ++++ .../GetAverageClickPositionResponseDates.php | 360 ++++ .../lib/Model/GetClickPositionsResponse.php | 307 +++ .../GetClickPositionsResponsePositions.php | 327 ++++ .../lib/Model/GetClickThroughRateResponse.php | 393 ++++ .../GetClickThroughRateResponseDates.php | 393 ++++ .../lib/Model/GetConversationRateResponse.php | 393 ++++ .../GetConversationRateResponseDates.php | 393 ++++ .../lib/Model/GetNoClickRateResponse.php | 393 ++++ .../lib/Model/GetNoClickRateResponseDates.php | 393 ++++ .../lib/Model/GetNoResultsRateResponse.php | 393 ++++ .../Model/GetNoResultsRateResponseDates.php | 393 ++++ .../lib/Model/GetRecommendations.php | 296 +++ .../lib/Model/GetRecommendationsResponse.php | 290 +++ .../lib/Model/GetSearchesCountResponse.php | 327 ++++ .../Model/GetSearchesCountResponseDates.php | 327 ++++ .../lib/Model/GetSearchesNoClicksResponse.php | 294 +++ .../GetSearchesNoClicksResponseSearches.php | 360 ++++ .../Model/GetSearchesNoResultsResponse.php | 294 +++ .../GetSearchesNoResultsResponseSearches.php | 360 ++++ .../lib/Model/GetStatusResponse.php | 294 +++ .../lib/Model/GetTopCountriesResponse.php | 294 +++ .../GetTopCountriesResponseCountries.php | 327 ++++ .../lib/Model/GetTopFilterAttribute.php | 327 ++++ .../Model/GetTopFilterAttributesResponse.php | 294 +++ .../lib/Model/GetTopFilterForAttribute.php | 393 ++++ .../GetTopFilterForAttributeResponse.php | 294 +++ .../Model/GetTopFiltersNoResultsResponse.php | 294 +++ .../lib/Model/GetTopFiltersNoResultsValue.php | 360 ++++ .../Model/GetTopFiltersNoResultsValues.php | 327 ++++ .../lib/Model/GetTopHitsResponse.php | 294 +++ .../lib/Model/GetTopHitsResponseHits.php | 327 ++++ .../Model/GetTopHitsResponseWithAnalytics.php | 294 +++ .../GetTopHitsResponseWithAnalyticsHits.php | 492 +++++ .../lib/Model/GetTopSearchesResponse.php | 294 +++ .../GetTopSearchesResponseWithAnalytics.php | 294 +++ ...pSearchesResponseWithAnalyticsSearches.php | 558 ++++++ .../lib/Model/GetUserTokenResponse.php | 360 ++++ .../lib/Model/GetUsersCountResponse.php | 327 ++++ .../lib/Model/IndexName.php | 294 +++ .../lib/Model/InsightEvent.php | 582 ++++++ .../lib/Model/InsightEvents.php | 296 +++ .../lib/Model/ListABTestsResponse.php | 360 ++++ .../lib/Model/LogFile.php | 430 +++++ .../Model/PersonalizationStrategyObject.php | 360 ++++ .../lib/Model/PushEventsResponse.php | 294 +++ .../lib/Model/QuerySuggestionsIndex.php | 393 ++++ .../lib/Model/QuerySuggestionsIndexParam.php | 354 ++++ .../QuerySuggestionsIndexWithIndexParam.php | 387 ++++ .../lib/Model/RecommendHits.php | 290 +++ .../lib/Model/RecommendRecord.php | 463 +++++ .../lib/Model/RecommendationRequest.php | 532 ++++++ .../lib/Model/RecommendationsResponse.php | 1049 ++++++++++ .../lib/Model/SearchParams.php | 30 - .../SetPersonalizationStrategyResponse.php | 294 +++ .../lib/Model/SourceIndex.php | 474 +++++ .../lib/Model/SourceIndexExternal.php | 327 ++++ .../lib/Model/SourceIndexWithReplicas.php | 525 +++++ .../lib/Model/Status.php | 360 ++++ .../lib/Model/SucessResponse.php | 327 ++++ .../lib/Model/Variant.php | 657 +++++++ .../RequestOptions/RequestOptionsFactory.php | 4 +- .../lib/RetryStrategy/ApiWrapper.php | 6 +- .../lib/RetryStrategy/ClusterHosts.php | 5 + openapitools.json | 118 +- playground/php/src/abtesting.php | 27 + playground/php/src/analytics.php | 15 + playground/php/src/insights.php | 23 + playground/php/src/personalization.php | 11 + playground/php/src/query-suggestions.php | 9 + playground/php/src/recommend.php | 22 + scripts/post-gen/php.sh | 2 +- templates/php/Configuration.mustache | 137 +- templates/php/api.mustache | 52 +- templates/php/composer.mustache | 2 +- 103 files changed, 30065 insertions(+), 225 deletions(-) create mode 100644 clients/algoliasearch-client-php/lib/Api/AbtestingApi.php create mode 100644 clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php create mode 100644 clients/algoliasearch-client-php/lib/Api/InsightsApi.php create mode 100644 clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php create mode 100644 clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php create mode 100644 clients/algoliasearch-client-php/lib/Api/RecommendApi.php create mode 100644 clients/algoliasearch-client-php/lib/Configuration/AbTestingConfig.php delete mode 100644 clients/algoliasearch-client-php/lib/Configuration/AbstractConfig.php create mode 100644 clients/algoliasearch-client-php/lib/Configuration/AnalyticsConfig.php create mode 100644 clients/algoliasearch-client-php/lib/Configuration/ConfigWithRegion.php create mode 100644 clients/algoliasearch-client-php/lib/Configuration/InsightsConfig.php create mode 100644 clients/algoliasearch-client-php/lib/Configuration/PersonalizationConfig.php create mode 100644 clients/algoliasearch-client-php/lib/Configuration/QuerySuggestionsConfig.php create mode 100644 clients/algoliasearch-client-php/lib/Configuration/RecommendConfig.php create mode 100644 clients/algoliasearch-client-php/lib/Configuration/SearchConfig.php create mode 100644 clients/algoliasearch-client-php/lib/Model/ABTest.php create mode 100644 clients/algoliasearch-client-php/lib/Model/ABTestResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/AbTestsVariant.php create mode 100644 clients/algoliasearch-client-php/lib/Model/AbTestsVariantSearchParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/AddABTestsRequest.php create mode 100644 clients/algoliasearch-client-php/lib/Model/AddABTestsVariant.php create mode 100644 clients/algoliasearch-client-php/lib/Model/CustomSearchParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/DeleteUserProfileResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/EventScoring.php create mode 100644 clients/algoliasearch-client-php/lib/Model/FacetScoring.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetAverageClickPositionResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetAverageClickPositionResponseDates.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetClickPositionsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetClickPositionsResponsePositions.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetClickThroughRateResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetClickThroughRateResponseDates.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetConversationRateResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetConversationRateResponseDates.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetNoClickRateResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetNoClickRateResponseDates.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetNoResultsRateResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetNoResultsRateResponseDates.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetRecommendations.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetRecommendationsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetSearchesCountResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetSearchesCountResponseDates.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetSearchesNoClicksResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetSearchesNoClicksResponseSearches.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetSearchesNoResultsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetSearchesNoResultsResponseSearches.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetStatusResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopCountriesResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopCountriesResponseCountries.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopFilterAttribute.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopFilterAttributesResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopFilterForAttribute.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopFilterForAttributeResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsValue.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsValues.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopHitsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseHits.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseWithAnalytics.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseWithAnalyticsHits.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponseWithAnalytics.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponseWithAnalyticsSearches.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetUserTokenResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetUsersCountResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/IndexName.php create mode 100644 clients/algoliasearch-client-php/lib/Model/InsightEvent.php create mode 100644 clients/algoliasearch-client-php/lib/Model/InsightEvents.php create mode 100644 clients/algoliasearch-client-php/lib/Model/ListABTestsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/LogFile.php create mode 100644 clients/algoliasearch-client-php/lib/Model/PersonalizationStrategyObject.php create mode 100644 clients/algoliasearch-client-php/lib/Model/PushEventsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndex.php create mode 100644 clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndexParam.php create mode 100644 clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndexWithIndexParam.php create mode 100644 clients/algoliasearch-client-php/lib/Model/RecommendHits.php create mode 100644 clients/algoliasearch-client-php/lib/Model/RecommendRecord.php create mode 100644 clients/algoliasearch-client-php/lib/Model/RecommendationRequest.php create mode 100644 clients/algoliasearch-client-php/lib/Model/RecommendationsResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SetPersonalizationStrategyResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SourceIndex.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SourceIndexExternal.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SourceIndexWithReplicas.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Status.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SucessResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Variant.php create mode 100644 playground/php/src/abtesting.php create mode 100644 playground/php/src/analytics.php create mode 100644 playground/php/src/insights.php create mode 100644 playground/php/src/personalization.php create mode 100644 playground/php/src/query-suggestions.php create mode 100644 playground/php/src/recommend.php diff --git a/clients/algoliasearch-client-php/composer.json b/clients/algoliasearch-client-php/composer.json index f7ff1822e9..4bd465a2e3 100644 --- a/clients/algoliasearch-client-php/composer.json +++ b/clients/algoliasearch-client-php/composer.json @@ -1,6 +1,6 @@ { "name": "algolia/algoliasearch-client-php", - "description": "API powering the Search feature of Algolia.", + "description": "API powering the features of Algolia.", "keywords": [ "openapitools", "openapi-generator", diff --git a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php new file mode 100644 index 0000000000..2e9a51fc3b --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php @@ -0,0 +1,374 @@ +config = $config; + + $this->api = $apiWrapper; + $this->headerSelector = new HeaderSelector(); + } + + /** + * Instantiate the client with basic credentials and region + * + * @param string $appId Application ID + * @param string $apiKey Algolia API Key + * @param string $region Region + */ + public static function create($appId = null, $apiKey = null, $region = null) + { + $allowedRegions = explode('-', 'us-de'); + $config = AbTestingConfig::create($appId, $apiKey, $region, $allowedRegions); + + return static::createWithConfig($config); + } + + /** + * Instantiate the client with congiguration + * + * @param AbTestingConfig $config Configuration + */ + public static function createWithConfig(AbTestingConfig $config) + { + $config = clone $config; + + if ($hosts = $config->getHosts()) { + // If a list of hosts was passed, we ignore the cache + $clusterHosts = ClusterHosts::create($hosts); + } else { + $clusterHosts = ClusterHosts::createForAnalytics($config->getAppId()); + } + + $apiWrapper = new ApiWrapper( + Algolia::getHttpClient(), + $config, + $clusterHosts + ); + + return new static($apiWrapper, $config); + } + + /** + * @return AbTestingConfig + */ + public function getClientConfig() + { + return $this->config; + } + + /** + * Operation addABTests + * + * Creates a new A/B test with provided configuration. + * + * @param \Algolia\AlgoliaSearch\Model\AddABTestsRequest $addABTestsRequest addABTestsRequest (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\ABTestResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function addABTests($addABTestsRequest) + { + // verify the required parameter 'addABTestsRequest' is set + if ($addABTestsRequest === null || (is_array($addABTestsRequest) && count($addABTestsRequest) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $addABTestsRequest when calling addABTests' + ); + } + + $resourcePath = '/2/abtests'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($addABTestsRequest)) { + $httpBody = $addABTestsRequest; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); + } + /** + * Operation deleteABTest + * + * Deletes the A/B Test. + * + * @param int $id The A/B test ID. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\ABTestResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function deleteABTest($id) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling deleteABTest' + ); + } + + $resourcePath = '/2/abtests/{id}'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('DELETE', $resourcePath, $query, $httpBody); + } + /** + * Operation getABTest + * + * Returns metadata and metrics for A/B test id. + * + * @param int $id The A/B test ID. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\ABTest|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getABTest($id) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling getABTest' + ); + } + + $resourcePath = '/2/abtests/{id}'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation listABTests + * + * Fetch all existing A/B tests for App that are available for the current API Key. + * + * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) + * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\ListABTestsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function listABTests($offset = 0, $limit = 10) + { + $resourcePath = '/2/abtests'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($offset)) { + $offset = ObjectSerializer::serializeCollection($offset, '', true); + } + if ($offset !== null) { + $queryParams['offset'] = $offset; + } + // query params + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation stopABTest + * + * Marks the A/B test as stopped. + * + * @param int $id The A/B test ID. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\ABTestResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function stopABTest($id) + { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling stopABTest' + ); + } + + $resourcePath = '/2/abtests/{id}/stop'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); + } + + private function sendRequest($method, $resourcePath, $query, $httpBody) + { + if ($method === 'GET') { + $request = $this->api->read( + $method, + $resourcePath . ($query ? "?{$query}" : '') + ); + } else { + $request = $this->api->write( + $method, + $resourcePath . ($query ? "?{$query}" : ''), + $httpBody + ); + } + + return $request; + } +} diff --git a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php new file mode 100644 index 0000000000..27530eed23 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php @@ -0,0 +1,1701 @@ +config = $config; + + $this->api = $apiWrapper; + $this->headerSelector = new HeaderSelector(); + } + + /** + * Instantiate the client with basic credentials and region + * + * @param string $appId Application ID + * @param string $apiKey Algolia API Key + * @param string $region Region + */ + public static function create($appId = null, $apiKey = null, $region = null) + { + $allowedRegions = explode('-', 'us-de'); + $config = AnalyticsConfig::create($appId, $apiKey, $region, $allowedRegions); + + return static::createWithConfig($config); + } + + /** + * Instantiate the client with congiguration + * + * @param AnalyticsConfig $config Configuration + */ + public static function createWithConfig(AnalyticsConfig $config) + { + $config = clone $config; + + if ($hosts = $config->getHosts()) { + // If a list of hosts was passed, we ignore the cache + $clusterHosts = ClusterHosts::create($hosts); + } else { + $clusterHosts = ClusterHosts::createForAnalytics($config->getAppId()); + } + + $apiWrapper = new ApiWrapper( + Algolia::getHttpClient(), + $config, + $clusterHosts + ); + + return new static($apiWrapper, $config); + } + + /** + * @return AnalyticsConfig + */ + public function getClientConfig() + { + return $this->config; + } + + /** + * Operation getAverageClickPosition + * + * Returns the average click position. + * + * @param string $index The index name to target. (required) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetAverageClickPositionResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getAverageClickPosition($index, $startDate = null, $endDate = null, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getAverageClickPosition' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getAverageClickPosition, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getAverageClickPosition, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/clicks/averageClickPosition'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getClickPositions + * + * Returns the distribution of clicks per range of positions. + * + * @param string $index The index name to target. (required) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetClickPositionsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getClickPositions($index, $startDate = null, $endDate = null, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getClickPositions' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getClickPositions, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getClickPositions, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/clicks/positions'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getClickThroughRate + * + * Returns a click-through rate (CTR). + * + * @param string $index The index name to target. (required) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetClickThroughRateResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getClickThroughRate($index, $startDate = null, $endDate = null, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getClickThroughRate' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getClickThroughRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getClickThroughRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/clicks/clickThroughRate'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getConversationRate + * + * Returns a conversion rate (CR). + * + * @param string $index The index name to target. (required) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetConversationRateResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getConversationRate($index, $startDate = null, $endDate = null, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getConversationRate' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getConversationRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getConversationRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/conversions/conversionRate'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getNoClickRate + * + * Returns the rate at which searches didn't lead to any clicks. + * + * @param string $index The index name to target. (required) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetNoClickRateResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getNoClickRate($index, $startDate = null, $endDate = null, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getNoClickRate' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getNoClickRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getNoClickRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/searches/noClickRate'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getNoResultsRate + * + * Returns the rate at which searches didn't return any results. + * + * @param string $index The index name to target. (required) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetNoResultsRateResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getNoResultsRate($index, $startDate = null, $endDate = null, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getNoResultsRate' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getNoResultsRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getNoResultsRate, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/searches/noResultRate'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getSearchesCount + * + * Returns the number of searches across the given time range. + * + * @param string $index The index name to target. (required) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetSearchesCountResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getSearchesCount($index, $startDate = null, $endDate = null, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getSearchesCount' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getSearchesCount, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getSearchesCount, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/searches/count'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getSearchesNoClicks + * + * Returns top searches that didn't lead to any clicks. + * + * @param string $index The index name to target. (required) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) + * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetSearchesNoClicksResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getSearchesNoClicks($index, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getSearchesNoClicks' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getSearchesNoClicks, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getSearchesNoClicks, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/searches/noClicks'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + if (is_array($offset)) { + $offset = ObjectSerializer::serializeCollection($offset, '', true); + } + if ($offset !== null) { + $queryParams['offset'] = $offset; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getSearchesNoResults + * + * Returns top searches that didn't return any results. + * + * @param string $index The index name to target. (required) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) + * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetSearchesNoResultsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getSearchesNoResults($index, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getSearchesNoResults' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getSearchesNoResults, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getSearchesNoResults, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/searches/noResults'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + if (is_array($offset)) { + $offset = ObjectSerializer::serializeCollection($offset, '', true); + } + if ($offset !== null) { + $queryParams['offset'] = $offset; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getStatus + * + * Get latest update time of the analytics API. + * + * @param string $index The index name to target. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetStatusResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getStatus($index) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getStatus' + ); + } + + $resourcePath = '/2/status'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getTopCountries + * + * Returns top countries. + * + * @param string $index The index name to target. (required) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) + * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetTopCountriesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getTopCountries($index, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getTopCountries' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getTopCountries, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getTopCountries, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/countries'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + if (is_array($offset)) { + $offset = ObjectSerializer::serializeCollection($offset, '', true); + } + if ($offset !== null) { + $queryParams['offset'] = $offset; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getTopFilterAttributes + * + * Returns top filter attributes. + * + * @param string $index The index name to target. (required) + * @param string $search The query term to search for. Must match the exact user input. (optional) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) + * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetTopFilterAttributesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getTopFilterAttributes($index, $search = null, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getTopFilterAttributes' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getTopFilterAttributes, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getTopFilterAttributes, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/filters'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($search)) { + $search = ObjectSerializer::serializeCollection($search, '', true); + } + if ($search !== null) { + $queryParams['search'] = $search; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + if (is_array($offset)) { + $offset = ObjectSerializer::serializeCollection($offset, '', true); + } + if ($offset !== null) { + $queryParams['offset'] = $offset; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getTopFilterForAttribute + * + * Returns top filters for the given attribute. + * + * @param string $attribute The exact name of the attribute. (required) + * @param string $index The index name to target. (required) + * @param string $search The query term to search for. Must match the exact user input. (optional) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) + * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetTopFilterForAttributeResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getTopFilterForAttribute($attribute, $index, $search = null, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) + { + // verify the required parameter 'attribute' is set + if ($attribute === null || (is_array($attribute) && count($attribute) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $attribute when calling getTopFilterForAttribute' + ); + } + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getTopFilterForAttribute' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getTopFilterForAttribute, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getTopFilterForAttribute, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/filters/{attribute}'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($search)) { + $search = ObjectSerializer::serializeCollection($search, '', true); + } + if ($search !== null) { + $queryParams['search'] = $search; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + if (is_array($offset)) { + $offset = ObjectSerializer::serializeCollection($offset, '', true); + } + if ($offset !== null) { + $queryParams['offset'] = $offset; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + // path params + if ($attribute !== null) { + $resourcePath = str_replace( + '{' . 'attribute' . '}', + ObjectSerializer::toPathValue($attribute), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getTopFiltersNoResults + * + * Returns top filters with no results. + * + * @param string $index The index name to target. (required) + * @param string $search The query term to search for. Must match the exact user input. (optional) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) + * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetTopFiltersNoResultsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getTopFiltersNoResults($index, $search = null, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getTopFiltersNoResults' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getTopFiltersNoResults, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getTopFiltersNoResults, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/filters/noResults'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($search)) { + $search = ObjectSerializer::serializeCollection($search, '', true); + } + if ($search !== null) { + $queryParams['search'] = $search; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + if (is_array($offset)) { + $offset = ObjectSerializer::serializeCollection($offset, '', true); + } + if ($offset !== null) { + $queryParams['offset'] = $offset; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getTopHits + * + * Returns top hits. + * + * @param string $index The index name to target. (required) + * @param string $search The query term to search for. Must match the exact user input. (optional) + * @param bool $clickAnalytics Whether to include the click-through and conversion rates for a search. (optional, default to false) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) + * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return OneOfGetTopHitsResponseGetTopHitsResponseWithAnalytics|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getTopHits($index, $search = null, $clickAnalytics = false, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getTopHits' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getTopHits, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getTopHits, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/hits'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($search)) { + $search = ObjectSerializer::serializeCollection($search, '', true); + } + if ($search !== null) { + $queryParams['search'] = $search; + } + // query params + if (is_array($clickAnalytics)) { + $clickAnalytics = ObjectSerializer::serializeCollection($clickAnalytics, '', true); + } + if ($clickAnalytics !== null) { + $queryParams['clickAnalytics'] = $clickAnalytics; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + if (is_array($offset)) { + $offset = ObjectSerializer::serializeCollection($offset, '', true); + } + if ($offset !== null) { + $queryParams['offset'] = $offset; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getTopSearches + * + * Returns top searches. + * + * @param string $index The index name to target. (required) + * @param bool $clickAnalytics Whether to include the click-through and conversion rates for a search. (optional, default to false) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $orderBy Reorder the results. (optional, default to 'searchCount') + * @param string $direction The sorting of the result. (optional, default to 'asc') + * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) + * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return OneOfGetTopSearchesResponseGetTopSearchesResponseWithAnalytics|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getTopSearches($index, $clickAnalytics = false, $startDate = null, $endDate = null, $orderBy = 'searchCount', $direction = 'asc', $limit = 10, $offset = 0, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getTopSearches' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getTopSearches, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getTopSearches, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/searches'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($clickAnalytics)) { + $clickAnalytics = ObjectSerializer::serializeCollection($clickAnalytics, '', true); + } + if ($clickAnalytics !== null) { + $queryParams['clickAnalytics'] = $clickAnalytics; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($orderBy)) { + $orderBy = ObjectSerializer::serializeCollection($orderBy, '', true); + } + if ($orderBy !== null) { + $queryParams['orderBy'] = $orderBy; + } + // query params + if (is_array($direction)) { + $direction = ObjectSerializer::serializeCollection($direction, '', true); + } + if ($direction !== null) { + $queryParams['direction'] = $direction; + } + // query params + if (is_array($limit)) { + $limit = ObjectSerializer::serializeCollection($limit, '', true); + } + if ($limit !== null) { + $queryParams['limit'] = $limit; + } + // query params + if (is_array($offset)) { + $offset = ObjectSerializer::serializeCollection($offset, '', true); + } + if ($offset !== null) { + $queryParams['offset'] = $offset; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getUsersCount + * + * Returns the distinct count of users across the given time range. + * + * @param string $index The index name to target. (required) + * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) + * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetUsersCountResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getUsersCount($index, $startDate = null, $endDate = null, $tags = null) + { + // verify the required parameter 'index' is set + if ($index === null || (is_array($index) && count($index) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $index when calling getUsersCount' + ); + } + if ($startDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $startDate)) { + throw new \InvalidArgumentException('invalid value for "startDate" when calling AnalyticsApi.getUsersCount, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + if ($endDate !== null && !preg_match('/^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/', $endDate)) { + throw new \InvalidArgumentException('invalid value for "endDate" when calling AnalyticsApi.getUsersCount, must conform to the pattern /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/.'); + } + + $resourcePath = '/2/users/count'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // query params + if (is_array($index)) { + $index = ObjectSerializer::serializeCollection($index, '', true); + } + if ($index !== null) { + $queryParams['index'] = $index; + } + // query params + if (is_array($startDate)) { + $startDate = ObjectSerializer::serializeCollection($startDate, '', true); + } + if ($startDate !== null) { + $queryParams['startDate'] = $startDate; + } + // query params + if (is_array($endDate)) { + $endDate = ObjectSerializer::serializeCollection($endDate, '', true); + } + if ($endDate !== null) { + $queryParams['endDate'] = $endDate; + } + // query params + if (is_array($tags)) { + $tags = ObjectSerializer::serializeCollection($tags, '', true); + } + if ($tags !== null) { + $queryParams['tags'] = $tags; + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + + private function sendRequest($method, $resourcePath, $query, $httpBody) + { + if ($method === 'GET') { + $request = $this->api->read( + $method, + $resourcePath . ($query ? "?{$query}" : '') + ); + } else { + $request = $this->api->write( + $method, + $resourcePath . ($query ? "?{$query}" : ''), + $httpBody + ); + } + + return $request; + } +} diff --git a/clients/algoliasearch-client-php/lib/Api/InsightsApi.php b/clients/algoliasearch-client-php/lib/Api/InsightsApi.php new file mode 100644 index 0000000000..56986c96fa --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Api/InsightsApi.php @@ -0,0 +1,161 @@ +config = $config; + + $this->api = $apiWrapper; + $this->headerSelector = new HeaderSelector(); + } + + /** + * Instantiate the client with basic credentials and region + * + * @param string $appId Application ID + * @param string $apiKey Algolia API Key + * @param string $region Region + */ + public static function create($appId = null, $apiKey = null, $region = null) + { + $allowedRegions = explode('-', 'us-de'); + $config = InsightsConfig::create($appId, $apiKey, $region, $allowedRegions); + + return static::createWithConfig($config); + } + + /** + * Instantiate the client with congiguration + * + * @param InsightsConfig $config Configuration + */ + public static function createWithConfig(InsightsConfig $config) + { + $config = clone $config; + + if ($hosts = $config->getHosts()) { + // If a list of hosts was passed, we ignore the cache + $clusterHosts = ClusterHosts::create($hosts); + } else { + $clusterHosts = ClusterHosts::createForInsights($config->getAppId()); + } + + $apiWrapper = new ApiWrapper( + Algolia::getHttpClient(), + $config, + $clusterHosts + ); + + return new static($apiWrapper, $config); + } + + /** + * @return InsightsConfig + */ + public function getClientConfig() + { + return $this->config; + } + + /** + * Operation pushEvents + * + * Pushes an array of events. + * + * @param \Algolia\AlgoliaSearch\Model\InsightEvents $insightEvents insightEvents (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\PushEventsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function pushEvents($insightEvents) + { + // verify the required parameter 'insightEvents' is set + if ($insightEvents === null || (is_array($insightEvents) && count($insightEvents) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $insightEvents when calling pushEvents' + ); + } + + $resourcePath = '/1/events'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($insightEvents)) { + $httpBody = $insightEvents; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); + } + + private function sendRequest($method, $resourcePath, $query, $httpBody) + { + if ($method === 'GET') { + $request = $this->api->read( + $method, + $resourcePath . ($query ? "?{$query}" : '') + ); + } else { + $request = $this->api->write( + $method, + $resourcePath . ($query ? "?{$query}" : ''), + $httpBody + ); + } + + return $request; + } +} diff --git a/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php b/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php new file mode 100644 index 0000000000..00979a65df --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php @@ -0,0 +1,305 @@ +config = $config; + + $this->api = $apiWrapper; + $this->headerSelector = new HeaderSelector(); + } + + /** + * Instantiate the client with basic credentials and region + * + * @param string $appId Application ID + * @param string $apiKey Algolia API Key + * @param string $region Region + */ + public static function create($appId = null, $apiKey = null, $region = null) + { + $allowedRegions = explode('-', 'us-eu'); + $config = PersonalizationConfig::create($appId, $apiKey, $region, $allowedRegions); + + return static::createWithConfig($config); + } + + /** + * Instantiate the client with congiguration + * + * @param PersonalizationConfig $config Configuration + */ + public static function createWithConfig(PersonalizationConfig $config) + { + $config = clone $config; + + if ($hosts = $config->getHosts()) { + // If a list of hosts was passed, we ignore the cache + $clusterHosts = ClusterHosts::create($hosts); + } else { + $clusterHosts = ClusterHosts::createForRecommendation($config->getAppId()); + } + + $apiWrapper = new ApiWrapper( + Algolia::getHttpClient(), + $config, + $clusterHosts + ); + + return new static($apiWrapper, $config); + } + + /** + * @return PersonalizationConfig + */ + public function getClientConfig() + { + return $this->config; + } + + /** + * Operation deleteUserProfile + * + * Delete the user profile and all its associated data. + * + * @param string $userToken userToken representing the user for which to fetch the Personalization profile. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\DeleteUserProfileResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function deleteUserProfile($userToken) + { + // verify the required parameter 'userToken' is set + if ($userToken === null || (is_array($userToken) && count($userToken) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $userToken when calling deleteUserProfile' + ); + } + + $resourcePath = '/1/profiles/{userToken}'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // path params + if ($userToken !== null) { + $resourcePath = str_replace( + '{' . 'userToken' . '}', + ObjectSerializer::toPathValue($userToken), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('DELETE', $resourcePath, $query, $httpBody); + } + /** + * Operation getPersonalizationStrategy + * + * Get the current personalization strategy. + * + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\PersonalizationStrategyObject|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getPersonalizationStrategy() + { + $resourcePath = '/1/strategies/personalization'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getUserTokenProfile + * + * Get the user profile built from Personalization strategy. + * + * @param string $userToken userToken representing the user for which to fetch the Personalization profile. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetUserTokenResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getUserTokenProfile($userToken) + { + // verify the required parameter 'userToken' is set + if ($userToken === null || (is_array($userToken) && count($userToken) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $userToken when calling getUserTokenProfile' + ); + } + + $resourcePath = '/1/profiles/personalization/{userToken}'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // path params + if ($userToken !== null) { + $resourcePath = str_replace( + '{' . 'userToken' . '}', + ObjectSerializer::toPathValue($userToken), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation setPersonalizationStrategy + * + * Set a new personalization strategy. + * + * @param \Algolia\AlgoliaSearch\Model\PersonalizationStrategyObject $personalizationStrategyObject personalizationStrategyObject (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\SetPersonalizationStrategyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function setPersonalizationStrategy($personalizationStrategyObject) + { + // verify the required parameter 'personalizationStrategyObject' is set + if ($personalizationStrategyObject === null || (is_array($personalizationStrategyObject) && count($personalizationStrategyObject) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $personalizationStrategyObject when calling setPersonalizationStrategy' + ); + } + + $resourcePath = '/1/strategies/personalization'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($personalizationStrategyObject)) { + $httpBody = $personalizationStrategyObject; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); + } + + private function sendRequest($method, $resourcePath, $query, $httpBody) + { + if ($method === 'GET') { + $request = $this->api->read( + $method, + $resourcePath . ($query ? "?{$query}" : '') + ); + } else { + $request = $this->api->write( + $method, + $resourcePath . ($query ? "?{$query}" : ''), + $httpBody + ); + } + + return $request; + } +} diff --git a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php new file mode 100644 index 0000000000..6c6cce5669 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php @@ -0,0 +1,460 @@ +config = $config; + + $this->api = $apiWrapper; + $this->headerSelector = new HeaderSelector(); + } + + /** + * Instantiate the client with basic credentials and region + * + * @param string $appId Application ID + * @param string $apiKey Algolia API Key + * @param string $region Region + */ + public static function create($appId = null, $apiKey = null, $region = null) + { + $allowedRegions = explode('-', 'us-eu'); + $config = QuerySuggestionsConfig::create($appId, $apiKey, $region, $allowedRegions); + + return static::createWithConfig($config); + } + + /** + * Instantiate the client with congiguration + * + * @param QuerySuggestionsConfig $config Configuration + */ + public static function createWithConfig(QuerySuggestionsConfig $config) + { + $config = clone $config; + + if ($hosts = $config->getHosts()) { + // If a list of hosts was passed, we ignore the cache + $clusterHosts = ClusterHosts::create($hosts); + } else { + $clusterHosts = ClusterHosts::createForQuerySuggestions($config->getAppId()); + } + + $apiWrapper = new ApiWrapper( + Algolia::getHttpClient(), + $config, + $clusterHosts + ); + + return new static($apiWrapper, $config); + } + + /** + * @return QuerySuggestionsConfig + */ + public function getClientConfig() + { + return $this->config; + } + + /** + * Operation createConfig + * + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestionsIndexWithIndexParam $querySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\SucessResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function createConfig($querySuggestionsIndexWithIndexParam) + { + // verify the required parameter 'querySuggestionsIndexWithIndexParam' is set + if ($querySuggestionsIndexWithIndexParam === null || (is_array($querySuggestionsIndexWithIndexParam) && count($querySuggestionsIndexWithIndexParam) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $querySuggestionsIndexWithIndexParam when calling createConfig' + ); + } + + $resourcePath = '/1/configs'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($querySuggestionsIndexWithIndexParam)) { + $httpBody = $querySuggestionsIndexWithIndexParam; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); + } + /** + * Operation deleteConfig + * + * @param string $indexName The index in which to perform the request. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\SucessResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function deleteConfig($indexName) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling deleteConfig' + ); + } + + $resourcePath = '/1/configs/{indexName}'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('DELETE', $resourcePath, $query, $httpBody); + } + /** + * Operation getAllConfigs + * + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestionsIndex[]|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getAllConfigs() + { + $resourcePath = '/1/configs'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getConfig + * + * @param string $indexName The index in which to perform the request. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestionsIndex|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getConfig($indexName) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling getConfig' + ); + } + + $resourcePath = '/1/configs/{indexName}'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getConfigStatus + * + * @param string $indexName The index in which to perform the request. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\Status|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getConfigStatus($indexName) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling getConfigStatus' + ); + } + + $resourcePath = '/1/configs/{indexName}/status'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation getLogFile + * + * @param string $indexName The index in which to perform the request. (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\LogFile[]|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getLogFile($indexName) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling getLogFile' + ); + } + + $resourcePath = '/1/logs/{indexName}'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('GET', $resourcePath, $query, $httpBody); + } + /** + * Operation updateConfig + * + * @param string $indexName The index in which to perform the request. (required) + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestionsIndexParam $querySuggestionsIndexParam querySuggestionsIndexParam (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\SucessResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function updateConfig($indexName, $querySuggestionsIndexParam) + { + // verify the required parameter 'indexName' is set + if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $indexName when calling updateConfig' + ); + } + // verify the required parameter 'querySuggestionsIndexParam' is set + if ($querySuggestionsIndexParam === null || (is_array($querySuggestionsIndexParam) && count($querySuggestionsIndexParam) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $querySuggestionsIndexParam when calling updateConfig' + ); + } + + $resourcePath = '/1/configs/{indexName}'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + // path params + if ($indexName !== null) { + $resourcePath = str_replace( + '{' . 'indexName' . '}', + ObjectSerializer::toPathValue($indexName), + $resourcePath + ); + } + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($querySuggestionsIndexParam)) { + $httpBody = $querySuggestionsIndexParam; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('PUT', $resourcePath, $query, $httpBody); + } + + private function sendRequest($method, $resourcePath, $query, $httpBody) + { + if ($method === 'GET') { + $request = $this->api->read( + $method, + $resourcePath . ($query ? "?{$query}" : '') + ); + } else { + $request = $this->api->write( + $method, + $resourcePath . ($query ? "?{$query}" : ''), + $httpBody + ); + } + + return $request; + } +} diff --git a/clients/algoliasearch-client-php/lib/Api/RecommendApi.php b/clients/algoliasearch-client-php/lib/Api/RecommendApi.php new file mode 100644 index 0000000000..a9305a9de4 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Api/RecommendApi.php @@ -0,0 +1,159 @@ +config = $config; + + $this->api = $apiWrapper; + $this->headerSelector = new HeaderSelector(); + } + + /** + * Instantiate the client with basic credentials and region + * + * @param string $appId Application ID + * @param string $apiKey Algolia API Key + * @param string $region Region + */ + public static function create($appId = null, $apiKey = null, $region = null) + { + $allowedRegions = explode('-', 'us-de'); + $config = RecommendConfig::create($appId, $apiKey, $region, $allowedRegions); + + return static::createWithConfig($config); + } + + /** + * Instantiate the client with congiguration + * + * @param RecommendConfig $config Configuration + */ + public static function createWithConfig(RecommendConfig $config) + { + $config = clone $config; + + if ($hosts = $config->getHosts()) { + // If a list of hosts was passed, we ignore the cache + $clusterHosts = ClusterHosts::create($hosts); + } else { + $clusterHosts = ClusterHosts::createFromAppId($config->getAppId()); + } + + $apiWrapper = new ApiWrapper( + Algolia::getHttpClient(), + $config, + $clusterHosts + ); + + return new static($apiWrapper, $config); + } + + /** + * @return RecommendConfig + */ + public function getClientConfig() + { + return $this->config; + } + + /** + * Operation getRecommendations + * + * @param \Algolia\AlgoliaSearch\Model\GetRecommendations $getRecommendations getRecommendations (required) + * + * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response + * @throws \InvalidArgumentException + * + * @return \Algolia\AlgoliaSearch\Model\GetRecommendationsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + */ + public function getRecommendations($getRecommendations) + { + // verify the required parameter 'getRecommendations' is set + if ($getRecommendations === null || (is_array($getRecommendations) && count($getRecommendations) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $getRecommendations when calling getRecommendations' + ); + } + + $resourcePath = '/1/indexes/*/recommendations'; + $queryParams = []; + $headerParams = []; + $httpBody = []; + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + if (isset($getRecommendations)) { + $httpBody = $getRecommendations; + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\Query::build($queryParams); + + return $this->sendRequest('POST', $resourcePath, $query, $httpBody); + } + + private function sendRequest($method, $resourcePath, $query, $httpBody) + { + if ($method === 'GET') { + $request = $this->api->read( + $method, + $resourcePath . ($query ? "?{$query}" : '') + ); + } else { + $request = $this->api->write( + $method, + $resourcePath . ($query ? "?{$query}" : ''), + $httpBody + ); + } + + return $request; + } +} diff --git a/clients/algoliasearch-client-php/lib/Api/SearchApi.php b/clients/algoliasearch-client-php/lib/Api/SearchApi.php index c7ae5106ad..ed7473ff95 100644 --- a/clients/algoliasearch-client-php/lib/Api/SearchApi.php +++ b/clients/algoliasearch-client-php/lib/Api/SearchApi.php @@ -3,7 +3,7 @@ namespace Algolia\AlgoliaSearch\Api; use Algolia\AlgoliaSearch\Algolia; -use Algolia\AlgoliaSearch\Configuration\Configuration; +use Algolia\AlgoliaSearch\Configuration\SearchConfig; use Algolia\AlgoliaSearch\HeaderSelector; use Algolia\AlgoliaSearch\ObjectSerializer; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; @@ -24,7 +24,7 @@ class SearchApi protected $api; /** - * @var Configuration + * @var SearchConfig */ protected $config; @@ -34,10 +34,10 @@ class SearchApi protected $headerSelector; /** - * @param Configuration $config + * @param SearchConfig $config * @param ApiWrapperInterface $apiWrapper */ - public function __construct(ApiWrapperInterface $apiWrapper, Configuration $config) + public function __construct(ApiWrapperInterface $apiWrapper, SearchConfig $config) { $this->config = $config; @@ -53,15 +53,15 @@ public function __construct(ApiWrapperInterface $apiWrapper, Configuration $conf */ public static function create($appId = null, $apiKey = null) { - return static::createWithConfig(Configuration::create($appId, $apiKey)); + return static::createWithConfig(SearchConfig::create($appId, $apiKey)); } /** * Instantiate the client with congiguration * - * @param Configuration $config Configuration + * @param SearchConfig $config Configuration */ - public static function createWithConfig(Configuration $config) + public static function createWithConfig(SearchConfig $config) { $config = clone $config; @@ -87,9 +87,9 @@ public static function createWithConfig(Configuration $config) } /** - * @return Configuration + * @return SearchConfig */ - public function getConfig() + public function getClientConfig() { return $this->config; } diff --git a/clients/algoliasearch-client-php/lib/Configuration/AbTestingConfig.php b/clients/algoliasearch-client-php/lib/Configuration/AbTestingConfig.php new file mode 100644 index 0000000000..2b32133678 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Configuration/AbTestingConfig.php @@ -0,0 +1,7 @@ +getDefaultConfiguration(); - $this->config = $config; - } - - public static function create($appId = null, $apiKey = null) - { - $config = [ - 'appId' => null !== $appId ? $appId : getenv('ALGOLIA_APP_ID'), - 'apiKey' => null !== $apiKey ? $apiKey : getenv('ALGOLIA_API_KEY'), - ]; - - return new static($config); - } - - public function getDefaultConfiguration() - { - return [ - 'appId' => '', - 'apiKey' => '', - 'hosts' => null, - 'readTimeout' => $this->defaultReadTimeout, - 'writeTimeout' => $this->defaultWriteTimeout, - 'connectTimeout' => $this->defaultConnectTimeout, - 'defaultHeaders' => [], - ]; - } - - public function getAppId() - { - return $this->config['appId']; - } - - public function setAppId($appId) - { - $this->config['appId'] = $appId; - - return $this; - } - - public function getAlgoliaApiKey() - { - return $this->config['apiKey']; - } - - public function setAlgoliaApiKey($apiKey) - { - $this->config['apiKey'] = $apiKey; - - return $this; - } - - public function getHosts() - { - return $this->config['hosts']; - } - - public function setHosts($hosts) - { - $this->config['hosts'] = $hosts; - - return $this; - } - - public function getReadTimeout() - { - return $this->config['readTimeout']; - } - - public function setReadTimeout($readTimeout) - { - $this->config['readTimeout'] = $readTimeout; - - return $this; - } - - public function getWriteTimeout() - { - return $this->config['writeTimeout']; - } - - public function setWriteTimeout($writeTimeout) - { - $this->config['writeTimeout'] = $writeTimeout; - - return $this; - } - - public function getConnectTimeout() - { - return $this->config['connectTimeout']; - } - - public function setConnectTimeout($connectTimeout) - { - $this->config['connectTimeout'] = $connectTimeout; - - return $this; - } - - public function getDefaultHeaders() - { - return $this->config['defaultHeaders']; - } - - public function setDefaultHeaders(array $defaultHeaders) - { - $this->config['defaultHeaders'] = $defaultHeaders; - - return $this; - } - - /** - * Sets the user agent of the api client - * - * @param string $userAgent the user agent of the api client - * - * @throws \InvalidArgumentException - * - * @return $this - */ - public function setUserAgent($userAgent) - { - if (!is_string($userAgent)) { - throw new \InvalidArgumentException('User-agent must be a string.'); - } - - $this->userAgent = $userAgent; - - return $this; - } - - /** - * Gets the user agent of the api client - * - * @return string user agent - */ - public function getUserAgent() - { - return $this->userAgent; - } -} diff --git a/clients/algoliasearch-client-php/lib/Configuration/AnalyticsConfig.php b/clients/algoliasearch-client-php/lib/Configuration/AnalyticsConfig.php new file mode 100644 index 0000000000..5f12ef371f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Configuration/AnalyticsConfig.php @@ -0,0 +1,7 @@ + null !== $appId ? $appId : getenv('ALGOLIA_APP_ID'), + 'apiKey' => null !== $apiKey ? $apiKey : getenv('ALGOLIA_API_KEY'), + 'region' => null !== $region ? $region : 'us', + ]; + + return new static($config); + } + + public function getRegion() + { + return $this->config['region']; + } +} diff --git a/clients/algoliasearch-client-php/lib/Configuration/Configuration.php b/clients/algoliasearch-client-php/lib/Configuration/Configuration.php index d7cbebc643..f8aae6e002 100644 --- a/clients/algoliasearch-client-php/lib/Configuration/Configuration.php +++ b/clients/algoliasearch-client-php/lib/Configuration/Configuration.php @@ -9,7 +9,7 @@ * @category Class * @package Algolia\AlgoliaSearch */ -class Configuration extends AbstractConfig +abstract class Configuration { /** * Associate array to store API key(s) @@ -60,6 +60,14 @@ class Configuration extends AbstractConfig */ protected $tempFolderPath; + protected $config; + + protected $defaultReadTimeout = 5; + + protected $defaultWriteTimeout = 30; + + protected $defaultConnectTimeout = 2; + public function __construct(array $config = []) { $this->tempFolderPath = sys_get_temp_dir(); @@ -252,4 +260,131 @@ public function getApiKeyWithPrefix($apiKeyIdentifier) return $keyWithPrefix; } + + public function getDefaultConfiguration() + { + return [ + 'appId' => '', + 'apiKey' => '', + 'hosts' => null, + 'readTimeout' => $this->defaultReadTimeout, + 'writeTimeout' => $this->defaultWriteTimeout, + 'connectTimeout' => $this->defaultConnectTimeout, + 'defaultHeaders' => [], + ]; + } + + public function getAppId() + { + return $this->config['appId']; + } + + public function setAppId($appId) + { + $this->config['appId'] = $appId; + + return $this; + } + + public function getAlgoliaApiKey() + { + return $this->config['apiKey']; + } + + public function setAlgoliaApiKey($apiKey) + { + $this->config['apiKey'] = $apiKey; + + return $this; + } + + public function getHosts() + { + return $this->config['hosts']; + } + + public function setHosts($hosts) + { + $this->config['hosts'] = $hosts; + + return $this; + } + + public function getReadTimeout() + { + return $this->config['readTimeout']; + } + + public function setReadTimeout($readTimeout) + { + $this->config['readTimeout'] = $readTimeout; + + return $this; + } + + public function getWriteTimeout() + { + return $this->config['writeTimeout']; + } + + public function setWriteTimeout($writeTimeout) + { + $this->config['writeTimeout'] = $writeTimeout; + + return $this; + } + + public function getConnectTimeout() + { + return $this->config['connectTimeout']; + } + + public function setConnectTimeout($connectTimeout) + { + $this->config['connectTimeout'] = $connectTimeout; + + return $this; + } + + public function getDefaultHeaders() + { + return $this->config['defaultHeaders']; + } + + public function setDefaultHeaders(array $defaultHeaders) + { + $this->config['defaultHeaders'] = $defaultHeaders; + + return $this; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } } diff --git a/clients/algoliasearch-client-php/lib/Configuration/InsightsConfig.php b/clients/algoliasearch-client-php/lib/Configuration/InsightsConfig.php new file mode 100644 index 0000000000..6cbba26b83 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Configuration/InsightsConfig.php @@ -0,0 +1,7 @@ + null !== $appId ? $appId : getenv('ALGOLIA_APP_ID'), + 'apiKey' => null !== $apiKey ? $apiKey : getenv('ALGOLIA_API_KEY'), + ]; + + return new static($config); + } + + public function getDefaultConfiguration() + { + return [ + 'appId' => '', + 'apiKey' => '', + 'hosts' => null, + 'readTimeout' => $this->defaultReadTimeout, + 'writeTimeout' => $this->defaultWriteTimeout, + 'connectTimeout' => $this->defaultConnectTimeout, + 'waitTaskTimeBeforeRetry' => $this->defaultWaitTaskTimeBeforeRetry, + 'defaultHeaders' => [], + 'defaultForwardToReplicas' => null, + 'batchSize' => 1000, + ]; + } +} diff --git a/clients/algoliasearch-client-php/lib/Model/ABTest.php b/clients/algoliasearch-client-php/lib/Model/ABTest.php new file mode 100644 index 0000000000..367d549f80 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/ABTest.php @@ -0,0 +1,525 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ABTest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ABTest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'abTestID' => 'int', + 'clickSignificance' => 'double', + 'conversionSignificance' => 'double', + 'endAt' => 'string', + 'createdAt' => 'string', + 'name' => 'string', + 'status' => 'string', + 'variants' => '\Algolia\AlgoliaSearch\Model\Variant[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'abTestID' => null, + 'clickSignificance' => 'double', + 'conversionSignificance' => 'double', + 'endAt' => null, + 'createdAt' => null, + 'name' => null, + 'status' => null, + 'variants' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'abTestID' => 'abTestID', + 'clickSignificance' => 'clickSignificance', + 'conversionSignificance' => 'conversionSignificance', + 'endAt' => 'endAt', + 'createdAt' => 'createdAt', + 'name' => 'name', + 'status' => 'status', + 'variants' => 'variants', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abTestID' => 'setAbTestID', + 'clickSignificance' => 'setClickSignificance', + 'conversionSignificance' => 'setConversionSignificance', + 'endAt' => 'setEndAt', + 'createdAt' => 'setCreatedAt', + 'name' => 'setName', + 'status' => 'setStatus', + 'variants' => 'setVariants', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abTestID' => 'getAbTestID', + 'clickSignificance' => 'getClickSignificance', + 'conversionSignificance' => 'getConversionSignificance', + 'endAt' => 'getEndAt', + 'createdAt' => 'getCreatedAt', + 'name' => 'getName', + 'status' => 'getStatus', + 'variants' => 'getVariants', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['abTestID'] = $data['abTestID'] ?? null; + $this->container['clickSignificance'] = $data['clickSignificance'] ?? null; + $this->container['conversionSignificance'] = $data['conversionSignificance'] ?? null; + $this->container['endAt'] = $data['endAt'] ?? null; + $this->container['createdAt'] = $data['createdAt'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['status'] = $data['status'] ?? null; + $this->container['variants'] = $data['variants'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['abTestID'] === null) { + $invalidProperties[] = "'abTestID' can't be null"; + } + if ($this->container['clickSignificance'] === null) { + $invalidProperties[] = "'clickSignificance' can't be null"; + } + if ($this->container['conversionSignificance'] === null) { + $invalidProperties[] = "'conversionSignificance' can't be null"; + } + if ($this->container['endAt'] === null) { + $invalidProperties[] = "'endAt' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['variants'] === null) { + $invalidProperties[] = "'variants' 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 abTestID + * + * @return int + */ + public function getAbTestID() + { + return $this->container['abTestID']; + } + + /** + * Sets abTestID + * + * @param int $abTestID the A/B test ID + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets clickSignificance + * + * @return float + */ + public function getClickSignificance() + { + return $this->container['clickSignificance']; + } + + /** + * Sets clickSignificance + * + * @param float $clickSignificance A/B test significance based on click data. Should be > 0.95 to be considered significant (no matter which variant is winning). + * + * @return self + */ + public function setClickSignificance($clickSignificance) + { + $this->container['clickSignificance'] = $clickSignificance; + + return $this; + } + + /** + * Gets conversionSignificance + * + * @return float + */ + public function getConversionSignificance() + { + return $this->container['conversionSignificance']; + } + + /** + * Sets conversionSignificance + * + * @param float $conversionSignificance A/B test significance based on conversion data. Should be > 0.95 to be considered significant (no matter which variant is winning). + * + * @return self + */ + public function setConversionSignificance($conversionSignificance) + { + $this->container['conversionSignificance'] = $conversionSignificance; + + return $this; + } + + /** + * Gets endAt + * + * @return string + */ + public function getEndAt() + { + return $this->container['endAt']; + } + + /** + * Sets endAt + * + * @param string $endAt end date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ + * + * @return self + */ + public function setEndAt($endAt) + { + $this->container['endAt'] = $endAt; + + return $this; + } + + /** + * Gets createdAt + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param string $createdAt end date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name A/B test name + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status of the A/B test + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets variants + * + * @return \Algolia\AlgoliaSearch\Model\Variant[] + */ + public function getVariants() + { + return $this->container['variants']; + } + + /** + * Sets variants + * + * @param \Algolia\AlgoliaSearch\Model\Variant[] $variants list of A/B test variant + * + * @return self + */ + public function setVariants($variants) + { + $this->container['variants'] = $variants; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/ABTestResponse.php b/clients/algoliasearch-client-php/lib/Model/ABTestResponse.php new file mode 100644 index 0000000000..9ed0975346 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/ABTestResponse.php @@ -0,0 +1,360 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ABTestResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ABTestResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'index' => 'string', + 'abTestID' => 'int', + 'taskID' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'index' => null, + 'abTestID' => null, + 'taskID' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'index' => 'index', + 'abTestID' => 'abTestID', + 'taskID' => 'taskID', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'index' => 'setIndex', + 'abTestID' => 'setAbTestID', + 'taskID' => 'setTaskID', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'index' => 'getIndex', + 'abTestID' => 'getAbTestID', + 'taskID' => 'getTaskID', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['index'] = $data['index'] ?? null; + $this->container['abTestID'] = $data['abTestID'] ?? null; + $this->container['taskID'] = $data['taskID'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['index'] === null) { + $invalidProperties[] = "'index' can't be null"; + } + if ($this->container['abTestID'] === null) { + $invalidProperties[] = "'abTestID' can't be null"; + } + if ($this->container['taskID'] === null) { + $invalidProperties[] = "'taskID' 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 index + * + * @return string + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param string $index the index performing the A/B test + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets abTestID + * + * @return int + */ + public function getAbTestID() + { + return $this->container['abTestID']; + } + + /** + * Sets abTestID + * + * @param int $abTestID the A/B test ID + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets taskID + * + * @return int + */ + public function getTaskID() + { + return $this->container['taskID']; + } + + /** + * Sets taskID + * + * @param int $taskID taskID of the task to wait for + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/AbTestsVariant.php b/clients/algoliasearch-client-php/lib/Model/AbTestsVariant.php new file mode 100644 index 0000000000..9ac9af4509 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/AbTestsVariant.php @@ -0,0 +1,357 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AbTestsVariant implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'abTestsVariant'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'index' => 'string', + 'trafficPercentage' => 'int', + 'description' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'index' => null, + 'trafficPercentage' => null, + 'description' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'index' => 'index', + 'trafficPercentage' => 'trafficPercentage', + 'description' => 'description', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'index' => 'setIndex', + 'trafficPercentage' => 'setTrafficPercentage', + 'description' => 'setDescription', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'index' => 'getIndex', + 'trafficPercentage' => 'getTrafficPercentage', + 'description' => 'getDescription', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['index'] = $data['index'] ?? null; + $this->container['trafficPercentage'] = $data['trafficPercentage'] ?? null; + $this->container['description'] = $data['description'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['index'] === null) { + $invalidProperties[] = "'index' can't be null"; + } + if ($this->container['trafficPercentage'] === null) { + $invalidProperties[] = "'trafficPercentage' 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 index + * + * @return string + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param string $index the index performing the A/B test + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets trafficPercentage + * + * @return int + */ + public function getTrafficPercentage() + { + return $this->container['trafficPercentage']; + } + + /** + * Sets trafficPercentage + * + * @param int $trafficPercentage the traffic perfecentage for the A/B test + * + * @return self + */ + public function setTrafficPercentage($trafficPercentage) + { + $this->container['trafficPercentage'] = $trafficPercentage; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description the A/B test description + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/AbTestsVariantSearchParams.php b/clients/algoliasearch-client-php/lib/Model/AbTestsVariantSearchParams.php new file mode 100644 index 0000000000..7d11ce1870 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/AbTestsVariantSearchParams.php @@ -0,0 +1,390 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AbTestsVariantSearchParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'abTestsVariantSearchParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'index' => 'string', + 'trafficPercentage' => 'int', + 'description' => 'string', + 'customSearchParameters' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'index' => null, + 'trafficPercentage' => null, + 'description' => null, + 'customSearchParameters' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'index' => 'index', + 'trafficPercentage' => 'trafficPercentage', + 'description' => 'description', + 'customSearchParameters' => 'customSearchParameters', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'index' => 'setIndex', + 'trafficPercentage' => 'setTrafficPercentage', + 'description' => 'setDescription', + 'customSearchParameters' => 'setCustomSearchParameters', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'index' => 'getIndex', + 'trafficPercentage' => 'getTrafficPercentage', + 'description' => 'getDescription', + 'customSearchParameters' => 'getCustomSearchParameters', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['index'] = $data['index'] ?? null; + $this->container['trafficPercentage'] = $data['trafficPercentage'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['customSearchParameters'] = $data['customSearchParameters'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['index'] === null) { + $invalidProperties[] = "'index' can't be null"; + } + if ($this->container['trafficPercentage'] === null) { + $invalidProperties[] = "'trafficPercentage' can't be null"; + } + if ($this->container['customSearchParameters'] === null) { + $invalidProperties[] = "'customSearchParameters' 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 index + * + * @return string + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param string $index the index performing the A/B test + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets trafficPercentage + * + * @return int + */ + public function getTrafficPercentage() + { + return $this->container['trafficPercentage']; + } + + /** + * Sets trafficPercentage + * + * @param int $trafficPercentage the traffic perfecentage for the A/B test + * + * @return self + */ + public function setTrafficPercentage($trafficPercentage) + { + $this->container['trafficPercentage'] = $trafficPercentage; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description the A/B test description + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets customSearchParameters + * + * @return object + */ + public function getCustomSearchParameters() + { + return $this->container['customSearchParameters']; + } + + /** + * Sets customSearchParameters + * + * @param object $customSearchParameters customSearchParameters + * + * @return self + */ + public function setCustomSearchParameters($customSearchParameters) + { + $this->container['customSearchParameters'] = $customSearchParameters; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/AddABTestsRequest.php b/clients/algoliasearch-client-php/lib/Model/AddABTestsRequest.php new file mode 100644 index 0000000000..251027134a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/AddABTestsRequest.php @@ -0,0 +1,374 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddABTestsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'addABTestsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'variant' => '\Algolia\AlgoliaSearch\Model\AddABTestsVariant[]', + 'endAt' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'variant' => null, + 'endAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'variant' => 'variant', + 'endAt' => 'endAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'variant' => 'setVariant', + 'endAt' => 'setEndAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'variant' => 'getVariant', + 'endAt' => 'getEndAt', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['variant'] = $data['variant'] ?? null; + $this->container['endAt'] = $data['endAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['variant'] === null) { + $invalidProperties[] = "'variant' can't be null"; + } + if ((count($this->container['variant']) > 2)) { + $invalidProperties[] = "invalid value for 'variant', number of items must be less than or equal to 2."; + } + + if ((count($this->container['variant']) < 2)) { + $invalidProperties[] = "invalid value for 'variant', number of items must be greater than or equal to 2."; + } + + if ($this->container['endAt'] === null) { + $invalidProperties[] = "'endAt' 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']; + } + + /** + * Sets name + * + * @param string $name A/B test name + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets variant + * + * @return \Algolia\AlgoliaSearch\Model\AddABTestsVariant[] + */ + public function getVariant() + { + return $this->container['variant']; + } + + /** + * Sets variant + * + * @param \Algolia\AlgoliaSearch\Model\AddABTestsVariant[] $variant list of 2 variants for the A/B test + * + * @return self + */ + public function setVariant($variant) + { + if ((count($variant) > 2)) { + throw new \InvalidArgumentException('invalid value for $variant when calling AddABTestsRequest., number of items must be less than or equal to 2.'); + } + if ((count($variant) < 2)) { + throw new \InvalidArgumentException('invalid length for $variant when calling AddABTestsRequest., number of items must be greater than or equal to 2.'); + } + $this->container['variant'] = $variant; + + return $this; + } + + /** + * Gets endAt + * + * @return string + */ + public function getEndAt() + { + return $this->container['endAt']; + } + + /** + * Sets endAt + * + * @param string $endAt end date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ + * + * @return self + */ + public function setEndAt($endAt) + { + $this->container['endAt'] = $endAt; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/AddABTestsVariant.php b/clients/algoliasearch-client-php/lib/Model/AddABTestsVariant.php new file mode 100644 index 0000000000..5a91671eb2 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/AddABTestsVariant.php @@ -0,0 +1,390 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AddABTestsVariant implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AddABTestsVariant'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'index' => 'string', + 'trafficPercentage' => 'int', + 'description' => 'string', + 'customSearchParameters' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'index' => null, + 'trafficPercentage' => null, + 'description' => null, + 'customSearchParameters' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'index' => 'index', + 'trafficPercentage' => 'trafficPercentage', + 'description' => 'description', + 'customSearchParameters' => 'customSearchParameters', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'index' => 'setIndex', + 'trafficPercentage' => 'setTrafficPercentage', + 'description' => 'setDescription', + 'customSearchParameters' => 'setCustomSearchParameters', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'index' => 'getIndex', + 'trafficPercentage' => 'getTrafficPercentage', + 'description' => 'getDescription', + 'customSearchParameters' => 'getCustomSearchParameters', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['index'] = $data['index'] ?? null; + $this->container['trafficPercentage'] = $data['trafficPercentage'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['customSearchParameters'] = $data['customSearchParameters'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['index'] === null) { + $invalidProperties[] = "'index' can't be null"; + } + if ($this->container['trafficPercentage'] === null) { + $invalidProperties[] = "'trafficPercentage' can't be null"; + } + if ($this->container['customSearchParameters'] === null) { + $invalidProperties[] = "'customSearchParameters' 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 index + * + * @return string + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param string $index the index performing the A/B test + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets trafficPercentage + * + * @return int + */ + public function getTrafficPercentage() + { + return $this->container['trafficPercentage']; + } + + /** + * Sets trafficPercentage + * + * @param int $trafficPercentage the traffic perfecentage for the A/B test + * + * @return self + */ + public function setTrafficPercentage($trafficPercentage) + { + $this->container['trafficPercentage'] = $trafficPercentage; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description the A/B test description + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets customSearchParameters + * + * @return object + */ + public function getCustomSearchParameters() + { + return $this->container['customSearchParameters']; + } + + /** + * Sets customSearchParameters + * + * @param object $customSearchParameters customSearchParameters + * + * @return self + */ + public function setCustomSearchParameters($customSearchParameters) + { + $this->container['customSearchParameters'] = $customSearchParameters; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/CustomSearchParams.php b/clients/algoliasearch-client-php/lib/Model/CustomSearchParams.php new file mode 100644 index 0000000000..a74f44e250 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/CustomSearchParams.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class CustomSearchParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'customSearchParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'customSearchParameters' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'customSearchParameters' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'customSearchParameters' => 'customSearchParameters', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'customSearchParameters' => 'setCustomSearchParameters', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'customSearchParameters' => 'getCustomSearchParameters', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['customSearchParameters'] = $data['customSearchParameters'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['customSearchParameters'] === null) { + $invalidProperties[] = "'customSearchParameters' 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 customSearchParameters + * + * @return object + */ + public function getCustomSearchParameters() + { + return $this->container['customSearchParameters']; + } + + /** + * Sets customSearchParameters + * + * @param object $customSearchParameters customSearchParameters + * + * @return self + */ + public function setCustomSearchParameters($customSearchParameters) + { + $this->container['customSearchParameters'] = $customSearchParameters; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/DeleteUserProfileResponse.php b/clients/algoliasearch-client-php/lib/Model/DeleteUserProfileResponse.php new file mode 100644 index 0000000000..0fa26d0fb0 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/DeleteUserProfileResponse.php @@ -0,0 +1,327 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class DeleteUserProfileResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'deleteUserProfileResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'userToken' => 'string', + 'deletedUntil' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'userToken' => null, + 'deletedUntil' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'userToken' => 'userToken', + 'deletedUntil' => 'deletedUntil', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userToken' => 'setUserToken', + 'deletedUntil' => 'setDeletedUntil', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userToken' => 'getUserToken', + 'deletedUntil' => 'getDeletedUntil', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['userToken'] = $data['userToken'] ?? null; + $this->container['deletedUntil'] = $data['deletedUntil'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['userToken'] === null) { + $invalidProperties[] = "'userToken' can't be null"; + } + if ($this->container['deletedUntil'] === null) { + $invalidProperties[] = "'deletedUntil' 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 userToken + * + * @return string + */ + public function getUserToken() + { + return $this->container['userToken']; + } + + /** + * Sets userToken + * + * @param string $userToken userToken representing the user for which to fetch the Personalization profile + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets deletedUntil + * + * @return string + */ + public function getDeletedUntil() + { + return $this->container['deletedUntil']; + } + + /** + * Sets deletedUntil + * + * @param string $deletedUntil A date until which the data can safely be considered as deleted for the given user. Any data received after the deletedUntil date will start building a new user profile. + * + * @return self + */ + public function setDeletedUntil($deletedUntil) + { + $this->container['deletedUntil'] = $deletedUntil; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/EventScoring.php b/clients/algoliasearch-client-php/lib/Model/EventScoring.php new file mode 100644 index 0000000000..f0d107ab89 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/EventScoring.php @@ -0,0 +1,360 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class EventScoring implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'eventScoring'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'score' => 'int', + 'eventName' => 'string', + 'eventType' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'score' => null, + 'eventName' => null, + 'eventType' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'score' => 'score', + 'eventName' => 'eventName', + 'eventType' => 'eventType', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'score' => 'setScore', + 'eventName' => 'setEventName', + 'eventType' => 'setEventType', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'score' => 'getScore', + 'eventName' => 'getEventName', + 'eventType' => 'getEventType', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['score'] = $data['score'] ?? null; + $this->container['eventName'] = $data['eventName'] ?? null; + $this->container['eventType'] = $data['eventType'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['score'] === null) { + $invalidProperties[] = "'score' can't be null"; + } + if ($this->container['eventName'] === null) { + $invalidProperties[] = "'eventName' can't be null"; + } + if ($this->container['eventType'] === null) { + $invalidProperties[] = "'eventType' 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 score + * + * @return int + */ + public function getScore() + { + return $this->container['score']; + } + + /** + * Sets score + * + * @param int $score the score for the event + * + * @return self + */ + public function setScore($score) + { + $this->container['score'] = $score; + + return $this; + } + + /** + * Gets eventName + * + * @return string + */ + public function getEventName() + { + return $this->container['eventName']; + } + + /** + * Sets eventName + * + * @param string $eventName the name of the event + * + * @return self + */ + public function setEventName($eventName) + { + $this->container['eventName'] = $eventName; + + return $this; + } + + /** + * Gets eventType + * + * @return string + */ + public function getEventType() + { + return $this->container['eventType']; + } + + /** + * Sets eventType + * + * @param string $eventType the type of the event + * + * @return self + */ + public function setEventType($eventType) + { + $this->container['eventType'] = $eventType; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/FacetScoring.php b/clients/algoliasearch-client-php/lib/Model/FacetScoring.php new file mode 100644 index 0000000000..a976f22006 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/FacetScoring.php @@ -0,0 +1,327 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class FacetScoring implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'facetScoring'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'score' => 'int', + 'facetName' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'score' => null, + 'facetName' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'score' => 'score', + 'facetName' => 'facetName', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'score' => 'setScore', + 'facetName' => 'setFacetName', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'score' => 'getScore', + 'facetName' => 'getFacetName', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['score'] = $data['score'] ?? null; + $this->container['facetName'] = $data['facetName'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['score'] === null) { + $invalidProperties[] = "'score' can't be null"; + } + if ($this->container['facetName'] === null) { + $invalidProperties[] = "'facetName' 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 score + * + * @return int + */ + public function getScore() + { + return $this->container['score']; + } + + /** + * Sets score + * + * @param int $score the score for the event + * + * @return self + */ + public function setScore($score) + { + $this->container['score'] = $score; + + return $this; + } + + /** + * Gets facetName + * + * @return string + */ + public function getFacetName() + { + return $this->container['facetName']; + } + + /** + * Sets facetName + * + * @param string $facetName the name of the facet + * + * @return self + */ + public function setFacetName($facetName) + { + $this->container['facetName'] = $facetName; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetAverageClickPositionResponse.php b/clients/algoliasearch-client-php/lib/Model/GetAverageClickPositionResponse.php new file mode 100644 index 0000000000..ec407539db --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetAverageClickPositionResponse.php @@ -0,0 +1,360 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetAverageClickPositionResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getAverageClickPositionResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'average' => 'double', + 'clickCount' => 'int', + 'dates' => '\Algolia\AlgoliaSearch\Model\GetAverageClickPositionResponseDates[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'average' => 'double', + 'clickCount' => null, + 'dates' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'average' => 'average', + 'clickCount' => 'clickCount', + 'dates' => 'dates', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'average' => 'setAverage', + 'clickCount' => 'setClickCount', + 'dates' => 'setDates', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'average' => 'getAverage', + 'clickCount' => 'getClickCount', + 'dates' => 'getDates', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['average'] = $data['average'] ?? null; + $this->container['clickCount'] = $data['clickCount'] ?? null; + $this->container['dates'] = $data['dates'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['average'] === null) { + $invalidProperties[] = "'average' can't be null"; + } + if ($this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + if ($this->container['dates'] === null) { + $invalidProperties[] = "'dates' 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 average + * + * @return float + */ + public function getAverage() + { + return $this->container['average']; + } + + /** + * Sets average + * + * @param float $average the average of all the click count event + * + * @return self + */ + public function setAverage($average) + { + $this->container['average'] = $average; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount']; + } + + /** + * Sets clickCount + * + * @param int $clickCount the number of click event + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + + /** + * Gets dates + * + * @return \Algolia\AlgoliaSearch\Model\GetAverageClickPositionResponseDates[] + */ + public function getDates() + { + return $this->container['dates']; + } + + /** + * Sets dates + * + * @param \Algolia\AlgoliaSearch\Model\GetAverageClickPositionResponseDates[] $dates a list of average click position with their date + * + * @return self + */ + public function setDates($dates) + { + $this->container['dates'] = $dates; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetAverageClickPositionResponseDates.php b/clients/algoliasearch-client-php/lib/Model/GetAverageClickPositionResponseDates.php new file mode 100644 index 0000000000..c55f093ff3 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetAverageClickPositionResponseDates.php @@ -0,0 +1,360 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetAverageClickPositionResponseDates implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getAverageClickPositionResponse_dates'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'average' => 'double', + 'clickCount' => 'int', + 'date' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'average' => 'double', + 'clickCount' => null, + 'date' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'average' => 'average', + 'clickCount' => 'clickCount', + 'date' => 'date', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'average' => 'setAverage', + 'clickCount' => 'setClickCount', + 'date' => 'setDate', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'average' => 'getAverage', + 'clickCount' => 'getClickCount', + 'date' => 'getDate', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['average'] = $data['average'] ?? null; + $this->container['clickCount'] = $data['clickCount'] ?? null; + $this->container['date'] = $data['date'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['average'] === null) { + $invalidProperties[] = "'average' can't be null"; + } + if ($this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' 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 average + * + * @return float + */ + public function getAverage() + { + return $this->container['average']; + } + + /** + * Sets average + * + * @param float $average the average of all the click count event + * + * @return self + */ + public function setAverage($average) + { + $this->container['average'] = $average; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount']; + } + + /** + * Sets clickCount + * + * @param int $clickCount the number of click event + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + + /** + * Gets date + * + * @return string + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param string $date date of the event + * + * @return self + */ + public function setDate($date) + { + $this->container['date'] = $date; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetClickPositionsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetClickPositionsResponse.php new file mode 100644 index 0000000000..ad6264940c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetClickPositionsResponse.php @@ -0,0 +1,307 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetClickPositionsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getClickPositionsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'positions' => '\Algolia\AlgoliaSearch\Model\GetClickPositionsResponsePositions[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'positions' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'positions' => 'positions', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'positions' => 'setPositions', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'positions' => 'getPositions', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['positions'] = $data['positions'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['positions'] === null) { + $invalidProperties[] = "'positions' can't be null"; + } + if ((count($this->container['positions']) > 2)) { + $invalidProperties[] = "invalid value for 'positions', number of items must be less than or equal to 2."; + } + + if ((count($this->container['positions']) < 2)) { + $invalidProperties[] = "invalid value for 'positions', number of items must be greater than or equal to 2."; + } + + 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 positions + * + * @return \Algolia\AlgoliaSearch\Model\GetClickPositionsResponsePositions[] + */ + public function getPositions() + { + return $this->container['positions']; + } + + /** + * Sets positions + * + * @param \Algolia\AlgoliaSearch\Model\GetClickPositionsResponsePositions[] $positions a list of the click positions with their click count + * + * @return self + */ + public function setPositions($positions) + { + if ((count($positions) > 2)) { + throw new \InvalidArgumentException('invalid value for $positions when calling GetClickPositionsResponse., number of items must be less than or equal to 2.'); + } + if ((count($positions) < 2)) { + throw new \InvalidArgumentException('invalid length for $positions when calling GetClickPositionsResponse., number of items must be greater than or equal to 2.'); + } + $this->container['positions'] = $positions; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetClickPositionsResponsePositions.php b/clients/algoliasearch-client-php/lib/Model/GetClickPositionsResponsePositions.php new file mode 100644 index 0000000000..be74a06fb1 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetClickPositionsResponsePositions.php @@ -0,0 +1,327 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetClickPositionsResponsePositions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getClickPositionsResponse_positions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'position' => 'int[]', + 'clickCount' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'position' => null, + 'clickCount' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'position' => 'position', + 'clickCount' => 'clickCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'position' => 'setPosition', + 'clickCount' => 'setClickCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'position' => 'getPosition', + 'clickCount' => 'getClickCount', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['position'] = $data['position'] ?? null; + $this->container['clickCount'] = $data['clickCount'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['position'] === null) { + $invalidProperties[] = "'position' can't be null"; + } + if ($this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' 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 position + * + * @return int[] + */ + public function getPosition() + { + return $this->container['position']; + } + + /** + * Sets position + * + * @param int[] $position Range of positions with the following pattern: Positions from 1 to 10 included are displayed in separated groups. Positions from 11 to 20 included are grouped together. Positions from 21 and up are grouped together. + * + * @return self + */ + public function setPosition($position) + { + $this->container['position'] = $position; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount']; + } + + /** + * Sets clickCount + * + * @param int $clickCount the number of click event + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetClickThroughRateResponse.php b/clients/algoliasearch-client-php/lib/Model/GetClickThroughRateResponse.php new file mode 100644 index 0000000000..d7e234ef19 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetClickThroughRateResponse.php @@ -0,0 +1,393 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetClickThroughRateResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getClickThroughRateResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rate' => 'double', + 'clickCount' => 'int', + 'trackedSearchCount' => 'int', + 'dates' => '\Algolia\AlgoliaSearch\Model\GetClickThroughRateResponseDates[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rate' => 'double', + 'clickCount' => null, + 'trackedSearchCount' => null, + 'dates' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rate' => 'rate', + 'clickCount' => 'clickCount', + 'trackedSearchCount' => 'trackedSearchCount', + 'dates' => 'dates', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'clickCount' => 'setClickCount', + 'trackedSearchCount' => 'setTrackedSearchCount', + 'dates' => 'setDates', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'clickCount' => 'getClickCount', + 'trackedSearchCount' => 'getTrackedSearchCount', + 'dates' => 'getDates', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['rate'] = $data['rate'] ?? null; + $this->container['clickCount'] = $data['clickCount'] ?? null; + $this->container['trackedSearchCount'] = $data['trackedSearchCount'] ?? null; + $this->container['dates'] = $data['dates'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if ($this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + if ($this->container['trackedSearchCount'] === null) { + $invalidProperties[] = "'trackedSearchCount' can't be null"; + } + if ($this->container['dates'] === null) { + $invalidProperties[] = "'dates' 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 rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount']; + } + + /** + * Sets clickCount + * + * @param int $clickCount the number of click event + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + + /** + * Gets trackedSearchCount + * + * @return int + */ + public function getTrackedSearchCount() + { + return $this->container['trackedSearchCount']; + } + + /** + * Sets trackedSearchCount + * + * @param int $trackedSearchCount the number of tracked search click + * + * @return self + */ + public function setTrackedSearchCount($trackedSearchCount) + { + $this->container['trackedSearchCount'] = $trackedSearchCount; + + return $this; + } + + /** + * Gets dates + * + * @return \Algolia\AlgoliaSearch\Model\GetClickThroughRateResponseDates[] + */ + public function getDates() + { + return $this->container['dates']; + } + + /** + * Sets dates + * + * @param \Algolia\AlgoliaSearch\Model\GetClickThroughRateResponseDates[] $dates a list of click-through rate events with their date + * + * @return self + */ + public function setDates($dates) + { + $this->container['dates'] = $dates; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetClickThroughRateResponseDates.php b/clients/algoliasearch-client-php/lib/Model/GetClickThroughRateResponseDates.php new file mode 100644 index 0000000000..af5e0f50ee --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetClickThroughRateResponseDates.php @@ -0,0 +1,393 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetClickThroughRateResponseDates implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getClickThroughRateResponse_dates'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rate' => 'double', + 'clickCount' => 'int', + 'trackedSearchCount' => 'int', + 'date' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rate' => 'double', + 'clickCount' => null, + 'trackedSearchCount' => null, + 'date' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rate' => 'rate', + 'clickCount' => 'clickCount', + 'trackedSearchCount' => 'trackedSearchCount', + 'date' => 'date', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'clickCount' => 'setClickCount', + 'trackedSearchCount' => 'setTrackedSearchCount', + 'date' => 'setDate', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'clickCount' => 'getClickCount', + 'trackedSearchCount' => 'getTrackedSearchCount', + 'date' => 'getDate', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['rate'] = $data['rate'] ?? null; + $this->container['clickCount'] = $data['clickCount'] ?? null; + $this->container['trackedSearchCount'] = $data['trackedSearchCount'] ?? null; + $this->container['date'] = $data['date'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if ($this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + if ($this->container['trackedSearchCount'] === null) { + $invalidProperties[] = "'trackedSearchCount' can't be null"; + } + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' 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 rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount']; + } + + /** + * Sets clickCount + * + * @param int $clickCount the number of click event + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + + /** + * Gets trackedSearchCount + * + * @return int + */ + public function getTrackedSearchCount() + { + return $this->container['trackedSearchCount']; + } + + /** + * Sets trackedSearchCount + * + * @param int $trackedSearchCount the number of tracked search click + * + * @return self + */ + public function setTrackedSearchCount($trackedSearchCount) + { + $this->container['trackedSearchCount'] = $trackedSearchCount; + + return $this; + } + + /** + * Gets date + * + * @return string + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param string $date date of the event + * + * @return self + */ + public function setDate($date) + { + $this->container['date'] = $date; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetConversationRateResponse.php b/clients/algoliasearch-client-php/lib/Model/GetConversationRateResponse.php new file mode 100644 index 0000000000..88c60cbe36 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetConversationRateResponse.php @@ -0,0 +1,393 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetConversationRateResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getConversationRateResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rate' => 'double', + 'trackedSearchCount' => 'int', + 'conversionCount' => 'int', + 'dates' => '\Algolia\AlgoliaSearch\Model\GetConversationRateResponseDates[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rate' => 'double', + 'trackedSearchCount' => null, + 'conversionCount' => null, + 'dates' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rate' => 'rate', + 'trackedSearchCount' => 'trackedSearchCount', + 'conversionCount' => 'conversionCount', + 'dates' => 'dates', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'trackedSearchCount' => 'setTrackedSearchCount', + 'conversionCount' => 'setConversionCount', + 'dates' => 'setDates', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'trackedSearchCount' => 'getTrackedSearchCount', + 'conversionCount' => 'getConversionCount', + 'dates' => 'getDates', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['rate'] = $data['rate'] ?? null; + $this->container['trackedSearchCount'] = $data['trackedSearchCount'] ?? null; + $this->container['conversionCount'] = $data['conversionCount'] ?? null; + $this->container['dates'] = $data['dates'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if ($this->container['trackedSearchCount'] === null) { + $invalidProperties[] = "'trackedSearchCount' can't be null"; + } + if ($this->container['conversionCount'] === null) { + $invalidProperties[] = "'conversionCount' can't be null"; + } + if ($this->container['dates'] === null) { + $invalidProperties[] = "'dates' 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 rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets trackedSearchCount + * + * @return int + */ + public function getTrackedSearchCount() + { + return $this->container['trackedSearchCount']; + } + + /** + * Sets trackedSearchCount + * + * @param int $trackedSearchCount the number of tracked search click + * + * @return self + */ + public function setTrackedSearchCount($trackedSearchCount) + { + $this->container['trackedSearchCount'] = $trackedSearchCount; + + return $this; + } + + /** + * Gets conversionCount + * + * @return int + */ + public function getConversionCount() + { + return $this->container['conversionCount']; + } + + /** + * Sets conversionCount + * + * @param int $conversionCount the number of converted clicks + * + * @return self + */ + public function setConversionCount($conversionCount) + { + $this->container['conversionCount'] = $conversionCount; + + return $this; + } + + /** + * Gets dates + * + * @return \Algolia\AlgoliaSearch\Model\GetConversationRateResponseDates[] + */ + public function getDates() + { + return $this->container['dates']; + } + + /** + * Sets dates + * + * @param \Algolia\AlgoliaSearch\Model\GetConversationRateResponseDates[] $dates a list of conversion events with their date + * + * @return self + */ + public function setDates($dates) + { + $this->container['dates'] = $dates; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetConversationRateResponseDates.php b/clients/algoliasearch-client-php/lib/Model/GetConversationRateResponseDates.php new file mode 100644 index 0000000000..cc25e80af8 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetConversationRateResponseDates.php @@ -0,0 +1,393 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetConversationRateResponseDates implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getConversationRateResponse_dates'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rate' => 'double', + 'trackedSearchCount' => 'int', + 'conversionCount' => 'int', + 'date' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rate' => 'double', + 'trackedSearchCount' => null, + 'conversionCount' => null, + 'date' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rate' => 'rate', + 'trackedSearchCount' => 'trackedSearchCount', + 'conversionCount' => 'conversionCount', + 'date' => 'date', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'trackedSearchCount' => 'setTrackedSearchCount', + 'conversionCount' => 'setConversionCount', + 'date' => 'setDate', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'trackedSearchCount' => 'getTrackedSearchCount', + 'conversionCount' => 'getConversionCount', + 'date' => 'getDate', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['rate'] = $data['rate'] ?? null; + $this->container['trackedSearchCount'] = $data['trackedSearchCount'] ?? null; + $this->container['conversionCount'] = $data['conversionCount'] ?? null; + $this->container['date'] = $data['date'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if ($this->container['trackedSearchCount'] === null) { + $invalidProperties[] = "'trackedSearchCount' can't be null"; + } + if ($this->container['conversionCount'] === null) { + $invalidProperties[] = "'conversionCount' can't be null"; + } + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' 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 rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets trackedSearchCount + * + * @return int + */ + public function getTrackedSearchCount() + { + return $this->container['trackedSearchCount']; + } + + /** + * Sets trackedSearchCount + * + * @param int $trackedSearchCount the number of tracked search click + * + * @return self + */ + public function setTrackedSearchCount($trackedSearchCount) + { + $this->container['trackedSearchCount'] = $trackedSearchCount; + + return $this; + } + + /** + * Gets conversionCount + * + * @return int + */ + public function getConversionCount() + { + return $this->container['conversionCount']; + } + + /** + * Sets conversionCount + * + * @param int $conversionCount the number of converted clicks + * + * @return self + */ + public function setConversionCount($conversionCount) + { + $this->container['conversionCount'] = $conversionCount; + + return $this; + } + + /** + * Gets date + * + * @return string + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param string $date date of the event + * + * @return self + */ + public function setDate($date) + { + $this->container['date'] = $date; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetNoClickRateResponse.php b/clients/algoliasearch-client-php/lib/Model/GetNoClickRateResponse.php new file mode 100644 index 0000000000..2bfcd52cb9 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetNoClickRateResponse.php @@ -0,0 +1,393 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetNoClickRateResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getNoClickRateResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rate' => 'double', + 'count' => 'int', + 'noClickCount' => 'int', + 'dates' => '\Algolia\AlgoliaSearch\Model\GetNoClickRateResponseDates[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rate' => 'double', + 'count' => null, + 'noClickCount' => null, + 'dates' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rate' => 'rate', + 'count' => 'count', + 'noClickCount' => 'noClickCount', + 'dates' => 'dates', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'count' => 'setCount', + 'noClickCount' => 'setNoClickCount', + 'dates' => 'setDates', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'count' => 'getCount', + 'noClickCount' => 'getNoClickCount', + 'dates' => 'getDates', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['rate'] = $data['rate'] ?? null; + $this->container['count'] = $data['count'] ?? null; + $this->container['noClickCount'] = $data['noClickCount'] ?? null; + $this->container['dates'] = $data['dates'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['noClickCount'] === null) { + $invalidProperties[] = "'noClickCount' can't be null"; + } + if ($this->container['dates'] === null) { + $invalidProperties[] = "'dates' 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 rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of click event + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets noClickCount + * + * @return int + */ + public function getNoClickCount() + { + return $this->container['noClickCount']; + } + + /** + * Sets noClickCount + * + * @param int $noClickCount the number of click event + * + * @return self + */ + public function setNoClickCount($noClickCount) + { + $this->container['noClickCount'] = $noClickCount; + + return $this; + } + + /** + * Gets dates + * + * @return \Algolia\AlgoliaSearch\Model\GetNoClickRateResponseDates[] + */ + public function getDates() + { + return $this->container['dates']; + } + + /** + * Sets dates + * + * @param \Algolia\AlgoliaSearch\Model\GetNoClickRateResponseDates[] $dates a list of searches without clicks with their date, rate and counts + * + * @return self + */ + public function setDates($dates) + { + $this->container['dates'] = $dates; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetNoClickRateResponseDates.php b/clients/algoliasearch-client-php/lib/Model/GetNoClickRateResponseDates.php new file mode 100644 index 0000000000..67ff2b7012 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetNoClickRateResponseDates.php @@ -0,0 +1,393 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetNoClickRateResponseDates implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getNoClickRateResponse_dates'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rate' => 'double', + 'count' => 'int', + 'noClickCount' => 'int', + 'date' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rate' => 'double', + 'count' => null, + 'noClickCount' => null, + 'date' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rate' => 'rate', + 'count' => 'count', + 'noClickCount' => 'noClickCount', + 'date' => 'date', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'count' => 'setCount', + 'noClickCount' => 'setNoClickCount', + 'date' => 'setDate', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'count' => 'getCount', + 'noClickCount' => 'getNoClickCount', + 'date' => 'getDate', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['rate'] = $data['rate'] ?? null; + $this->container['count'] = $data['count'] ?? null; + $this->container['noClickCount'] = $data['noClickCount'] ?? null; + $this->container['date'] = $data['date'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['noClickCount'] === null) { + $invalidProperties[] = "'noClickCount' can't be null"; + } + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' 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 rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of click event + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets noClickCount + * + * @return int + */ + public function getNoClickCount() + { + return $this->container['noClickCount']; + } + + /** + * Sets noClickCount + * + * @param int $noClickCount the number of click event + * + * @return self + */ + public function setNoClickCount($noClickCount) + { + $this->container['noClickCount'] = $noClickCount; + + return $this; + } + + /** + * Gets date + * + * @return string + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param string $date date of the event + * + * @return self + */ + public function setDate($date) + { + $this->container['date'] = $date; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetNoResultsRateResponse.php b/clients/algoliasearch-client-php/lib/Model/GetNoResultsRateResponse.php new file mode 100644 index 0000000000..105d76583f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetNoResultsRateResponse.php @@ -0,0 +1,393 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetNoResultsRateResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getNoResultsRateResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'rate' => 'double', + 'count' => 'int', + 'noResultCount' => 'int', + 'dates' => '\Algolia\AlgoliaSearch\Model\GetNoResultsRateResponseDates[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'rate' => 'double', + 'count' => null, + 'noResultCount' => null, + 'dates' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'rate' => 'rate', + 'count' => 'count', + 'noResultCount' => 'noResultCount', + 'dates' => 'dates', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'count' => 'setCount', + 'noResultCount' => 'setNoResultCount', + 'dates' => 'setDates', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'count' => 'getCount', + 'noResultCount' => 'getNoResultCount', + 'dates' => 'getDates', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['rate'] = $data['rate'] ?? null; + $this->container['count'] = $data['count'] ?? null; + $this->container['noResultCount'] = $data['noResultCount'] ?? null; + $this->container['dates'] = $data['dates'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['noResultCount'] === null) { + $invalidProperties[] = "'noResultCount' can't be null"; + } + if ($this->container['dates'] === null) { + $invalidProperties[] = "'dates' 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 rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets noResultCount + * + * @return int + */ + public function getNoResultCount() + { + return $this->container['noResultCount']; + } + + /** + * Sets noResultCount + * + * @param int $noResultCount the number of occurrences + * + * @return self + */ + public function setNoResultCount($noResultCount) + { + $this->container['noResultCount'] = $noResultCount; + + return $this; + } + + /** + * Gets dates + * + * @return \Algolia\AlgoliaSearch\Model\GetNoResultsRateResponseDates[] + */ + public function getDates() + { + return $this->container['dates']; + } + + /** + * Sets dates + * + * @param \Algolia\AlgoliaSearch\Model\GetNoResultsRateResponseDates[] $dates a list of searches without results with their date, rate and counts + * + * @return self + */ + public function setDates($dates) + { + $this->container['dates'] = $dates; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetNoResultsRateResponseDates.php b/clients/algoliasearch-client-php/lib/Model/GetNoResultsRateResponseDates.php new file mode 100644 index 0000000000..cc440c6f5a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetNoResultsRateResponseDates.php @@ -0,0 +1,393 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetNoResultsRateResponseDates implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getNoResultsRateResponse_dates'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'date' => 'string', + 'noResultCount' => 'int', + 'count' => 'int', + 'rate' => 'double', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'date' => null, + 'noResultCount' => null, + 'count' => null, + 'rate' => 'double', + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'date' => 'date', + 'noResultCount' => 'noResultCount', + 'count' => 'count', + 'rate' => 'rate', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date' => 'setDate', + 'noResultCount' => 'setNoResultCount', + 'count' => 'setCount', + 'rate' => 'setRate', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date' => 'getDate', + 'noResultCount' => 'getNoResultCount', + 'count' => 'getCount', + 'rate' => 'getRate', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['date'] = $data['date'] ?? null; + $this->container['noResultCount'] = $data['noResultCount'] ?? null; + $this->container['count'] = $data['count'] ?? null; + $this->container['rate'] = $data['rate'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if ($this->container['noResultCount'] === null) { + $invalidProperties[] = "'noResultCount' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['rate'] === null) { + $invalidProperties[] = "'rate' 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 date + * + * @return string + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param string $date date of the event + * + * @return self + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets noResultCount + * + * @return int + */ + public function getNoResultCount() + { + return $this->container['noResultCount']; + } + + /** + * Sets noResultCount + * + * @param int $noResultCount the number of occurrences + * + * @return self + */ + public function setNoResultCount($noResultCount) + { + $this->container['noResultCount'] = $noResultCount; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate']; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetRecommendations.php b/clients/algoliasearch-client-php/lib/Model/GetRecommendations.php new file mode 100644 index 0000000000..eb22e73e3d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetRecommendations.php @@ -0,0 +1,296 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRecommendations implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getRecommendations'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'requests' => '\Algolia\AlgoliaSearch\Model\RecommendationRequest[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'requests' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'requests' => 'requests', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['requests'] = $data['requests'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['requests'] === null) { + $invalidProperties[] = "'requests' 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 requests + * + * @return \Algolia\AlgoliaSearch\Model\RecommendationRequest[] + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\RecommendationRequest[] $requests the `getRecommendations` requests + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetRecommendationsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetRecommendationsResponse.php new file mode 100644 index 0000000000..a8e38f3239 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetRecommendationsResponse.php @@ -0,0 +1,290 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetRecommendationsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getRecommendationsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'results' => '\Algolia\AlgoliaSearch\Model\RecommendationsResponse[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'results' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'results' => 'results', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['results'] = $data['results'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 results + * + * @return \Algolia\AlgoliaSearch\Model\RecommendationsResponse[]|null + */ + public function getResults() + { + return $this->container['results']; + } + + /** + * Sets results + * + * @param \Algolia\AlgoliaSearch\Model\RecommendationsResponse[]|null $results results + * + * @return self + */ + public function setResults($results) + { + $this->container['results'] = $results; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetSearchesCountResponse.php b/clients/algoliasearch-client-php/lib/Model/GetSearchesCountResponse.php new file mode 100644 index 0000000000..c69b2b71e3 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetSearchesCountResponse.php @@ -0,0 +1,327 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetSearchesCountResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getSearchesCountResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'dates' => '\Algolia\AlgoliaSearch\Model\GetSearchesCountResponseDates[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'dates' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'dates' => 'dates', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'dates' => 'setDates', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'dates' => 'getDates', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['count'] = $data['count'] ?? null; + $this->container['dates'] = $data['dates'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['dates'] === null) { + $invalidProperties[] = "'dates' 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 count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets dates + * + * @return \Algolia\AlgoliaSearch\Model\GetSearchesCountResponseDates[] + */ + public function getDates() + { + return $this->container['dates']; + } + + /** + * Sets dates + * + * @param \Algolia\AlgoliaSearch\Model\GetSearchesCountResponseDates[] $dates a list of search events with their date and count + * + * @return self + */ + public function setDates($dates) + { + $this->container['dates'] = $dates; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetSearchesCountResponseDates.php b/clients/algoliasearch-client-php/lib/Model/GetSearchesCountResponseDates.php new file mode 100644 index 0000000000..50b609d54b --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetSearchesCountResponseDates.php @@ -0,0 +1,327 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetSearchesCountResponseDates implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getSearchesCountResponse_dates'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'date' => 'string', + 'count' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'date' => null, + 'count' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'date' => 'date', + 'count' => 'count', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date' => 'setDate', + 'count' => 'setCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date' => 'getDate', + 'count' => 'getCount', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['date'] = $data['date'] ?? null; + $this->container['count'] = $data['count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' 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 date + * + * @return string + */ + public function getDate() + { + return $this->container['date']; + } + + /** + * Sets date + * + * @param string $date date of the event + * + * @return self + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetSearchesNoClicksResponse.php b/clients/algoliasearch-client-php/lib/Model/GetSearchesNoClicksResponse.php new file mode 100644 index 0000000000..f2be23a148 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetSearchesNoClicksResponse.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetSearchesNoClicksResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getSearchesNoClicksResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'searches' => '\Algolia\AlgoliaSearch\Model\GetSearchesNoClicksResponseSearches[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'searches' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'searches' => 'searches', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'searches' => 'setSearches', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'searches' => 'getSearches', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['searches'] = $data['searches'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['searches'] === null) { + $invalidProperties[] = "'searches' 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 searches + * + * @return \Algolia\AlgoliaSearch\Model\GetSearchesNoClicksResponseSearches[] + */ + public function getSearches() + { + return $this->container['searches']; + } + + /** + * Sets searches + * + * @param \Algolia\AlgoliaSearch\Model\GetSearchesNoClicksResponseSearches[] $searches a list of searches with no clicks and their count + * + * @return self + */ + public function setSearches($searches) + { + $this->container['searches'] = $searches; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetSearchesNoClicksResponseSearches.php b/clients/algoliasearch-client-php/lib/Model/GetSearchesNoClicksResponseSearches.php new file mode 100644 index 0000000000..2dc01d8049 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetSearchesNoClicksResponseSearches.php @@ -0,0 +1,360 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetSearchesNoClicksResponseSearches implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getSearchesNoClicksResponse_searches'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'search' => 'string', + 'count' => 'int', + 'withFilterCount' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'search' => null, + 'count' => null, + 'withFilterCount' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'search' => 'search', + 'count' => 'count', + 'withFilterCount' => 'withFilterCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'search' => 'setSearch', + 'count' => 'setCount', + 'withFilterCount' => 'setWithFilterCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'search' => 'getSearch', + 'count' => 'getCount', + 'withFilterCount' => 'getWithFilterCount', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['search'] = $data['search'] ?? null; + $this->container['count'] = $data['count'] ?? null; + $this->container['withFilterCount'] = $data['withFilterCount'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['search'] === null) { + $invalidProperties[] = "'search' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['withFilterCount'] === null) { + $invalidProperties[] = "'withFilterCount' 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 search + * + * @return string + */ + public function getSearch() + { + return $this->container['search']; + } + + /** + * Sets search + * + * @param string $search the search query + * + * @return self + */ + public function setSearch($search) + { + $this->container['search'] = $search; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets withFilterCount + * + * @return int + */ + public function getWithFilterCount() + { + return $this->container['withFilterCount']; + } + + /** + * Sets withFilterCount + * + * @param int $withFilterCount the number of occurrences + * + * @return self + */ + public function setWithFilterCount($withFilterCount) + { + $this->container['withFilterCount'] = $withFilterCount; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetSearchesNoResultsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetSearchesNoResultsResponse.php new file mode 100644 index 0000000000..799e6d9aed --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetSearchesNoResultsResponse.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetSearchesNoResultsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getSearchesNoResultsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'searches' => '\Algolia\AlgoliaSearch\Model\GetSearchesNoResultsResponseSearches[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'searches' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'searches' => 'searches', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'searches' => 'setSearches', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'searches' => 'getSearches', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['searches'] = $data['searches'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['searches'] === null) { + $invalidProperties[] = "'searches' 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 searches + * + * @return \Algolia\AlgoliaSearch\Model\GetSearchesNoResultsResponseSearches[] + */ + public function getSearches() + { + return $this->container['searches']; + } + + /** + * Sets searches + * + * @param \Algolia\AlgoliaSearch\Model\GetSearchesNoResultsResponseSearches[] $searches a list of searches with no results and their count + * + * @return self + */ + public function setSearches($searches) + { + $this->container['searches'] = $searches; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetSearchesNoResultsResponseSearches.php b/clients/algoliasearch-client-php/lib/Model/GetSearchesNoResultsResponseSearches.php new file mode 100644 index 0000000000..e62d855602 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetSearchesNoResultsResponseSearches.php @@ -0,0 +1,360 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetSearchesNoResultsResponseSearches implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getSearchesNoResultsResponse_searches'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'search' => 'string', + 'count' => 'int', + 'nbHits' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'search' => null, + 'count' => null, + 'nbHits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'search' => 'search', + 'count' => 'count', + 'nbHits' => 'nbHits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'search' => 'setSearch', + 'count' => 'setCount', + 'nbHits' => 'setNbHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'search' => 'getSearch', + 'count' => 'getCount', + 'nbHits' => 'getNbHits', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['search'] = $data['search'] ?? null; + $this->container['count'] = $data['count'] ?? null; + $this->container['nbHits'] = $data['nbHits'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['search'] === null) { + $invalidProperties[] = "'search' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' 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 search + * + * @return string + */ + public function getSearch() + { + return $this->container['search']; + } + + /** + * Sets search + * + * @param string $search the search query + * + * @return self + */ + public function setSearch($search) + { + $this->container['search'] = $search; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits']; + } + + /** + * Sets nbHits + * + * @param int $nbHits number of hits that the search query matched + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetStatusResponse.php b/clients/algoliasearch-client-php/lib/Model/GetStatusResponse.php new file mode 100644 index 0000000000..d6b6059123 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetStatusResponse.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetStatusResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getStatusResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'updatedAt' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'updatedAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'updatedAt' => 'updatedAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'updatedAt' => 'setUpdatedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'updatedAt' => 'getUpdatedAt', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['updatedAt'] = $data['updatedAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' 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 updatedAt + * + * @return string + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param string $updatedAt date of last update (ISO-8601 format) + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopCountriesResponse.php b/clients/algoliasearch-client-php/lib/Model/GetTopCountriesResponse.php new file mode 100644 index 0000000000..3f14dca7b0 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopCountriesResponse.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopCountriesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopCountriesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'countries' => '\Algolia\AlgoliaSearch\Model\GetTopCountriesResponseCountries[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'countries' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'countries' => 'countries', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'countries' => 'setCountries', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'countries' => 'getCountries', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['countries'] = $data['countries'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['countries'] === null) { + $invalidProperties[] = "'countries' 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 countries + * + * @return \Algolia\AlgoliaSearch\Model\GetTopCountriesResponseCountries[] + */ + public function getCountries() + { + return $this->container['countries']; + } + + /** + * Sets countries + * + * @param \Algolia\AlgoliaSearch\Model\GetTopCountriesResponseCountries[] $countries a list of countries with their count + * + * @return self + */ + public function setCountries($countries) + { + $this->container['countries'] = $countries; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopCountriesResponseCountries.php b/clients/algoliasearch-client-php/lib/Model/GetTopCountriesResponseCountries.php new file mode 100644 index 0000000000..9fb9efc54e --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopCountriesResponseCountries.php @@ -0,0 +1,327 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopCountriesResponseCountries implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopCountriesResponse_countries'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'country' => 'string', + 'count' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'country' => null, + 'count' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country' => 'country', + 'count' => 'count', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country' => 'setCountry', + 'count' => 'setCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country' => 'getCountry', + 'count' => 'getCount', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['country'] = $data['country'] ?? null; + $this->container['count'] = $data['count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' 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 country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country the country + * + * @return self + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopFilterAttribute.php b/clients/algoliasearch-client-php/lib/Model/GetTopFilterAttribute.php new file mode 100644 index 0000000000..4b6c98432c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopFilterAttribute.php @@ -0,0 +1,327 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopFilterAttribute implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopFilterAttribute'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'attribute' => 'string', + 'count' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'attribute' => null, + 'count' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'attribute' => 'attribute', + 'count' => 'count', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'attribute' => 'setAttribute', + 'count' => 'setCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'attribute' => 'getAttribute', + 'count' => 'getCount', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['attribute'] = $data['attribute'] ?? null; + $this->container['count'] = $data['count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['attribute'] === null) { + $invalidProperties[] = "'attribute' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' 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 attribute + * + * @return string + */ + public function getAttribute() + { + return $this->container['attribute']; + } + + /** + * Sets attribute + * + * @param string $attribute the attribute + * + * @return self + */ + public function setAttribute($attribute) + { + $this->container['attribute'] = $attribute; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopFilterAttributesResponse.php b/clients/algoliasearch-client-php/lib/Model/GetTopFilterAttributesResponse.php new file mode 100644 index 0000000000..d2beebbb36 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopFilterAttributesResponse.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopFilterAttributesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopFilterAttributesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'attributes' => '\Algolia\AlgoliaSearch\Model\GetTopFilterAttribute[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'attributes' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'attributes' => 'attributes', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'attributes' => 'setAttributes', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'attributes' => 'getAttributes', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['attributes'] = $data['attributes'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['attributes'] === null) { + $invalidProperties[] = "'attributes' 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 attributes + * + * @return \Algolia\AlgoliaSearch\Model\GetTopFilterAttribute[] + */ + public function getAttributes() + { + return $this->container['attributes']; + } + + /** + * Sets attributes + * + * @param \Algolia\AlgoliaSearch\Model\GetTopFilterAttribute[] $attributes a list of attributes with their count + * + * @return self + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopFilterForAttribute.php b/clients/algoliasearch-client-php/lib/Model/GetTopFilterForAttribute.php new file mode 100644 index 0000000000..2bbecff5be --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopFilterForAttribute.php @@ -0,0 +1,393 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopFilterForAttribute implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopFilterForAttribute'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'attribute' => 'string', + 'operator' => 'string', + 'value' => 'string', + 'count' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'attribute' => null, + 'operator' => null, + 'value' => null, + 'count' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'attribute' => 'attribute', + 'operator' => 'operator', + 'value' => 'value', + 'count' => 'count', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'attribute' => 'setAttribute', + 'operator' => 'setOperator', + 'value' => 'setValue', + 'count' => 'setCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'attribute' => 'getAttribute', + 'operator' => 'getOperator', + 'value' => 'getValue', + 'count' => 'getCount', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['attribute'] = $data['attribute'] ?? null; + $this->container['operator'] = $data['operator'] ?? null; + $this->container['value'] = $data['value'] ?? null; + $this->container['count'] = $data['count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['attribute'] === null) { + $invalidProperties[] = "'attribute' can't be null"; + } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' 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 attribute + * + * @return string + */ + public function getAttribute() + { + return $this->container['attribute']; + } + + /** + * Sets attribute + * + * @param string $attribute the attribute + * + * @return self + */ + public function setAttribute($attribute) + { + $this->container['attribute'] = $attribute; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator the operator + * + * @return self + */ + public function setOperator($operator) + { + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value the value of the attribute + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopFilterForAttributeResponse.php b/clients/algoliasearch-client-php/lib/Model/GetTopFilterForAttributeResponse.php new file mode 100644 index 0000000000..fd01bcaaa1 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopFilterForAttributeResponse.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopFilterForAttributeResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopFilterForAttributeResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'values' => '\Algolia\AlgoliaSearch\Model\GetTopFilterForAttribute[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'values' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'values' => 'values', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'values' => 'setValues', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'values' => 'getValues', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['values'] = $data['values'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['values'] === null) { + $invalidProperties[] = "'values' 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 values + * + * @return \Algolia\AlgoliaSearch\Model\GetTopFilterForAttribute[] + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param \Algolia\AlgoliaSearch\Model\GetTopFilterForAttribute[] $values a list of filters for the given attributes + * + * @return self + */ + public function setValues($values) + { + $this->container['values'] = $values; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsResponse.php new file mode 100644 index 0000000000..c0d0433c4b --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsResponse.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopFiltersNoResultsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopFiltersNoResultsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'values' => '\Algolia\AlgoliaSearch\Model\GetTopFiltersNoResultsValues[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'values' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'values' => 'values', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'values' => 'setValues', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'values' => 'getValues', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['values'] = $data['values'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['values'] === null) { + $invalidProperties[] = "'values' 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 values + * + * @return \Algolia\AlgoliaSearch\Model\GetTopFiltersNoResultsValues[] + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param \Algolia\AlgoliaSearch\Model\GetTopFiltersNoResultsValues[] $values a list of filters without results + * + * @return self + */ + public function setValues($values) + { + $this->container['values'] = $values; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsValue.php b/clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsValue.php new file mode 100644 index 0000000000..1c70c19d13 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsValue.php @@ -0,0 +1,360 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopFiltersNoResultsValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopFiltersNoResultsValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'attribute' => 'string', + 'operator' => 'string', + 'value' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'attribute' => null, + 'operator' => null, + 'value' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'attribute' => 'attribute', + 'operator' => 'operator', + 'value' => 'value', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'attribute' => 'setAttribute', + 'operator' => 'setOperator', + 'value' => 'setValue', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'attribute' => 'getAttribute', + 'operator' => 'getOperator', + 'value' => 'getValue', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['attribute'] = $data['attribute'] ?? null; + $this->container['operator'] = $data['operator'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['attribute'] === null) { + $invalidProperties[] = "'attribute' can't be null"; + } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' 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 attribute + * + * @return string + */ + public function getAttribute() + { + return $this->container['attribute']; + } + + /** + * Sets attribute + * + * @param string $attribute the attribute + * + * @return self + */ + public function setAttribute($attribute) + { + $this->container['attribute'] = $attribute; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator the operator + * + * @return self + */ + public function setOperator($operator) + { + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value the value of the attribute + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsValues.php b/clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsValues.php new file mode 100644 index 0000000000..ecf5b6f1c6 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsValues.php @@ -0,0 +1,327 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopFiltersNoResultsValues implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopFiltersNoResultsValues'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'values' => '\Algolia\AlgoliaSearch\Model\GetTopFiltersNoResultsValue[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'values' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'values' => 'values', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'values' => 'setValues', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'values' => 'getValues', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['count'] = $data['count'] ?? null; + $this->container['values'] = $data['values'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['values'] === null) { + $invalidProperties[] = "'values' 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 count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets values + * + * @return \Algolia\AlgoliaSearch\Model\GetTopFiltersNoResultsValue[] + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param \Algolia\AlgoliaSearch\Model\GetTopFiltersNoResultsValue[] $values a list of filters without results + * + * @return self + */ + public function setValues($values) + { + $this->container['values'] = $values; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponse.php b/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponse.php new file mode 100644 index 0000000000..8a035b1f6c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponse.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopHitsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopHitsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'hits' => '\Algolia\AlgoliaSearch\Model\GetTopHitsResponseHits[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'hits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'hits' => 'hits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['hits'] = $data['hits'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['hits'] === null) { + $invalidProperties[] = "'hits' 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 hits + * + * @return \Algolia\AlgoliaSearch\Model\GetTopHitsResponseHits[] + */ + public function getHits() + { + return $this->container['hits']; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\GetTopHitsResponseHits[] $hits a list of top hits with their count + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseHits.php b/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseHits.php new file mode 100644 index 0000000000..28ef3cb704 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseHits.php @@ -0,0 +1,327 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopHitsResponseHits implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopHitsResponse_hits'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'hit' => 'string', + 'count' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'hit' => null, + 'count' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'hit' => 'hit', + 'count' => 'count', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hit' => 'setHit', + 'count' => 'setCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hit' => 'getHit', + 'count' => 'getCount', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['hit'] = $data['hit'] ?? null; + $this->container['count'] = $data['count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['hit'] === null) { + $invalidProperties[] = "'hit' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' 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 hit + * + * @return string + */ + public function getHit() + { + return $this->container['hit']; + } + + /** + * Sets hit + * + * @param string $hit the hit + * + * @return self + */ + public function setHit($hit) + { + $this->container['hit'] = $hit; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseWithAnalytics.php b/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseWithAnalytics.php new file mode 100644 index 0000000000..793d687fe2 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseWithAnalytics.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopHitsResponseWithAnalytics implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopHitsResponseWithAnalytics'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'hits' => '\Algolia\AlgoliaSearch\Model\GetTopHitsResponseWithAnalyticsHits[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'hits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'hits' => 'hits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['hits'] = $data['hits'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['hits'] === null) { + $invalidProperties[] = "'hits' 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 hits + * + * @return \Algolia\AlgoliaSearch\Model\GetTopHitsResponseWithAnalyticsHits[] + */ + public function getHits() + { + return $this->container['hits']; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\GetTopHitsResponseWithAnalyticsHits[] $hits a list of top hits with their count and analytics + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseWithAnalyticsHits.php b/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseWithAnalyticsHits.php new file mode 100644 index 0000000000..79c0f96e23 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseWithAnalyticsHits.php @@ -0,0 +1,492 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopHitsResponseWithAnalyticsHits implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopHitsResponseWithAnalytics_hits'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'hit' => 'string', + 'count' => 'int', + 'clickThroughRate' => 'double', + 'conversionRate' => 'double', + 'trackedSearchCount' => 'int', + 'clickCount' => 'int', + 'conversionCount' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'hit' => null, + 'count' => null, + 'clickThroughRate' => 'double', + 'conversionRate' => 'double', + 'trackedSearchCount' => null, + 'clickCount' => null, + 'conversionCount' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'hit' => 'hit', + 'count' => 'count', + 'clickThroughRate' => 'clickThroughRate', + 'conversionRate' => 'conversionRate', + 'trackedSearchCount' => 'trackedSearchCount', + 'clickCount' => 'clickCount', + 'conversionCount' => 'conversionCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hit' => 'setHit', + 'count' => 'setCount', + 'clickThroughRate' => 'setClickThroughRate', + 'conversionRate' => 'setConversionRate', + 'trackedSearchCount' => 'setTrackedSearchCount', + 'clickCount' => 'setClickCount', + 'conversionCount' => 'setConversionCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hit' => 'getHit', + 'count' => 'getCount', + 'clickThroughRate' => 'getClickThroughRate', + 'conversionRate' => 'getConversionRate', + 'trackedSearchCount' => 'getTrackedSearchCount', + 'clickCount' => 'getClickCount', + 'conversionCount' => 'getConversionCount', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['hit'] = $data['hit'] ?? null; + $this->container['count'] = $data['count'] ?? null; + $this->container['clickThroughRate'] = $data['clickThroughRate'] ?? null; + $this->container['conversionRate'] = $data['conversionRate'] ?? null; + $this->container['trackedSearchCount'] = $data['trackedSearchCount'] ?? null; + $this->container['clickCount'] = $data['clickCount'] ?? null; + $this->container['conversionCount'] = $data['conversionCount'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['hit'] === null) { + $invalidProperties[] = "'hit' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['clickThroughRate'] === null) { + $invalidProperties[] = "'clickThroughRate' can't be null"; + } + if ($this->container['conversionRate'] === null) { + $invalidProperties[] = "'conversionRate' can't be null"; + } + if ($this->container['trackedSearchCount'] === null) { + $invalidProperties[] = "'trackedSearchCount' can't be null"; + } + if ($this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + if ($this->container['conversionCount'] === null) { + $invalidProperties[] = "'conversionCount' 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 hit + * + * @return string + */ + public function getHit() + { + return $this->container['hit']; + } + + /** + * Sets hit + * + * @param string $hit the hit + * + * @return self + */ + public function setHit($hit) + { + $this->container['hit'] = $hit; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets clickThroughRate + * + * @return float + */ + public function getClickThroughRate() + { + return $this->container['clickThroughRate']; + } + + /** + * Sets clickThroughRate + * + * @param float $clickThroughRate the click-through rate + * + * @return self + */ + public function setClickThroughRate($clickThroughRate) + { + $this->container['clickThroughRate'] = $clickThroughRate; + + return $this; + } + + /** + * Gets conversionRate + * + * @return float + */ + public function getConversionRate() + { + return $this->container['conversionRate']; + } + + /** + * Sets conversionRate + * + * @param float $conversionRate the conversion rate + * + * @return self + */ + public function setConversionRate($conversionRate) + { + $this->container['conversionRate'] = $conversionRate; + + return $this; + } + + /** + * Gets trackedSearchCount + * + * @return int + */ + public function getTrackedSearchCount() + { + return $this->container['trackedSearchCount']; + } + + /** + * Sets trackedSearchCount + * + * @param int $trackedSearchCount the number of tracked search click + * + * @return self + */ + public function setTrackedSearchCount($trackedSearchCount) + { + $this->container['trackedSearchCount'] = $trackedSearchCount; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount']; + } + + /** + * Sets clickCount + * + * @param int $clickCount the number of click event + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + + /** + * Gets conversionCount + * + * @return int + */ + public function getConversionCount() + { + return $this->container['conversionCount']; + } + + /** + * Sets conversionCount + * + * @param int $conversionCount the number of converted clicks + * + * @return self + */ + public function setConversionCount($conversionCount) + { + $this->container['conversionCount'] = $conversionCount; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponse.php b/clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponse.php new file mode 100644 index 0000000000..3d8c6f9479 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponse.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopSearchesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopSearchesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'searches' => '\Algolia\AlgoliaSearch\Model\GetSearchesNoResultsResponseSearches[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'searches' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'searches' => 'searches', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'searches' => 'setSearches', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'searches' => 'getSearches', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['searches'] = $data['searches'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['searches'] === null) { + $invalidProperties[] = "'searches' 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 searches + * + * @return \Algolia\AlgoliaSearch\Model\GetSearchesNoResultsResponseSearches[] + */ + public function getSearches() + { + return $this->container['searches']; + } + + /** + * Sets searches + * + * @param \Algolia\AlgoliaSearch\Model\GetSearchesNoResultsResponseSearches[] $searches a list of top searches with their count + * + * @return self + */ + public function setSearches($searches) + { + $this->container['searches'] = $searches; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponseWithAnalytics.php b/clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponseWithAnalytics.php new file mode 100644 index 0000000000..0d0db16e04 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponseWithAnalytics.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopSearchesResponseWithAnalytics implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopSearchesResponseWithAnalytics'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'searches' => '\Algolia\AlgoliaSearch\Model\GetTopSearchesResponseWithAnalyticsSearches[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'searches' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'searches' => 'searches', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'searches' => 'setSearches', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'searches' => 'getSearches', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['searches'] = $data['searches'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['searches'] === null) { + $invalidProperties[] = "'searches' 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 searches + * + * @return \Algolia\AlgoliaSearch\Model\GetTopSearchesResponseWithAnalyticsSearches[] + */ + public function getSearches() + { + return $this->container['searches']; + } + + /** + * Sets searches + * + * @param \Algolia\AlgoliaSearch\Model\GetTopSearchesResponseWithAnalyticsSearches[] $searches a list of top searches with their count and analytics + * + * @return self + */ + public function setSearches($searches) + { + $this->container['searches'] = $searches; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponseWithAnalyticsSearches.php b/clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponseWithAnalyticsSearches.php new file mode 100644 index 0000000000..78f499d88c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponseWithAnalyticsSearches.php @@ -0,0 +1,558 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetTopSearchesResponseWithAnalyticsSearches implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getTopSearchesResponseWithAnalytics_searches'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'search' => 'string', + 'count' => 'int', + 'clickThroughRate' => 'double', + 'averageClickPosition' => 'int', + 'conversionRate' => 'double', + 'trackedSearchCount' => 'int', + 'clickCount' => 'int', + 'conversionCount' => 'int', + 'nbHits' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'search' => null, + 'count' => null, + 'clickThroughRate' => 'double', + 'averageClickPosition' => null, + 'conversionRate' => 'double', + 'trackedSearchCount' => null, + 'clickCount' => null, + 'conversionCount' => null, + 'nbHits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'search' => 'search', + 'count' => 'count', + 'clickThroughRate' => 'clickThroughRate', + 'averageClickPosition' => 'averageClickPosition', + 'conversionRate' => 'conversionRate', + 'trackedSearchCount' => 'trackedSearchCount', + 'clickCount' => 'clickCount', + 'conversionCount' => 'conversionCount', + 'nbHits' => 'nbHits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'search' => 'setSearch', + 'count' => 'setCount', + 'clickThroughRate' => 'setClickThroughRate', + 'averageClickPosition' => 'setAverageClickPosition', + 'conversionRate' => 'setConversionRate', + 'trackedSearchCount' => 'setTrackedSearchCount', + 'clickCount' => 'setClickCount', + 'conversionCount' => 'setConversionCount', + 'nbHits' => 'setNbHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'search' => 'getSearch', + 'count' => 'getCount', + 'clickThroughRate' => 'getClickThroughRate', + 'averageClickPosition' => 'getAverageClickPosition', + 'conversionRate' => 'getConversionRate', + 'trackedSearchCount' => 'getTrackedSearchCount', + 'clickCount' => 'getClickCount', + 'conversionCount' => 'getConversionCount', + 'nbHits' => 'getNbHits', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['search'] = $data['search'] ?? null; + $this->container['count'] = $data['count'] ?? null; + $this->container['clickThroughRate'] = $data['clickThroughRate'] ?? null; + $this->container['averageClickPosition'] = $data['averageClickPosition'] ?? null; + $this->container['conversionRate'] = $data['conversionRate'] ?? null; + $this->container['trackedSearchCount'] = $data['trackedSearchCount'] ?? null; + $this->container['clickCount'] = $data['clickCount'] ?? null; + $this->container['conversionCount'] = $data['conversionCount'] ?? null; + $this->container['nbHits'] = $data['nbHits'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['search'] === null) { + $invalidProperties[] = "'search' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['clickThroughRate'] === null) { + $invalidProperties[] = "'clickThroughRate' can't be null"; + } + if ($this->container['averageClickPosition'] === null) { + $invalidProperties[] = "'averageClickPosition' can't be null"; + } + if ($this->container['conversionRate'] === null) { + $invalidProperties[] = "'conversionRate' can't be null"; + } + if ($this->container['trackedSearchCount'] === null) { + $invalidProperties[] = "'trackedSearchCount' can't be null"; + } + if ($this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + if ($this->container['conversionCount'] === null) { + $invalidProperties[] = "'conversionCount' can't be null"; + } + if ($this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' 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 search + * + * @return string + */ + public function getSearch() + { + return $this->container['search']; + } + + /** + * Sets search + * + * @param string $search the search query + * + * @return self + */ + public function setSearch($search) + { + $this->container['search'] = $search; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets clickThroughRate + * + * @return float + */ + public function getClickThroughRate() + { + return $this->container['clickThroughRate']; + } + + /** + * Sets clickThroughRate + * + * @param float $clickThroughRate the click-through rate + * + * @return self + */ + public function setClickThroughRate($clickThroughRate) + { + $this->container['clickThroughRate'] = $clickThroughRate; + + return $this; + } + + /** + * Gets averageClickPosition + * + * @return int + */ + public function getAverageClickPosition() + { + return $this->container['averageClickPosition']; + } + + /** + * Sets averageClickPosition + * + * @param int $averageClickPosition the average position of all the click count event + * + * @return self + */ + public function setAverageClickPosition($averageClickPosition) + { + $this->container['averageClickPosition'] = $averageClickPosition; + + return $this; + } + + /** + * Gets conversionRate + * + * @return float + */ + public function getConversionRate() + { + return $this->container['conversionRate']; + } + + /** + * Sets conversionRate + * + * @param float $conversionRate the conversion rate + * + * @return self + */ + public function setConversionRate($conversionRate) + { + $this->container['conversionRate'] = $conversionRate; + + return $this; + } + + /** + * Gets trackedSearchCount + * + * @return int + */ + public function getTrackedSearchCount() + { + return $this->container['trackedSearchCount']; + } + + /** + * Sets trackedSearchCount + * + * @param int $trackedSearchCount the number of tracked search click + * + * @return self + */ + public function setTrackedSearchCount($trackedSearchCount) + { + $this->container['trackedSearchCount'] = $trackedSearchCount; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount']; + } + + /** + * Sets clickCount + * + * @param int $clickCount the number of click event + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + + /** + * Gets conversionCount + * + * @return int + */ + public function getConversionCount() + { + return $this->container['conversionCount']; + } + + /** + * Sets conversionCount + * + * @param int $conversionCount the number of converted clicks + * + * @return self + */ + public function setConversionCount($conversionCount) + { + $this->container['conversionCount'] = $conversionCount; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits']; + } + + /** + * Sets nbHits + * + * @param int $nbHits number of hits that the search query matched + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetUserTokenResponse.php b/clients/algoliasearch-client-php/lib/Model/GetUserTokenResponse.php new file mode 100644 index 0000000000..ada51dd20d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetUserTokenResponse.php @@ -0,0 +1,360 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetUserTokenResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getUserTokenResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'userToken' => 'string', + 'lastEventAt' => 'string', + 'scores' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'userToken' => null, + 'lastEventAt' => null, + 'scores' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'userToken' => 'userToken', + 'lastEventAt' => 'lastEventAt', + 'scores' => 'scores', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userToken' => 'setUserToken', + 'lastEventAt' => 'setLastEventAt', + 'scores' => 'setScores', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userToken' => 'getUserToken', + 'lastEventAt' => 'getLastEventAt', + 'scores' => 'getScores', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['userToken'] = $data['userToken'] ?? null; + $this->container['lastEventAt'] = $data['lastEventAt'] ?? null; + $this->container['scores'] = $data['scores'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['userToken'] === null) { + $invalidProperties[] = "'userToken' can't be null"; + } + if ($this->container['lastEventAt'] === null) { + $invalidProperties[] = "'lastEventAt' can't be null"; + } + if ($this->container['scores'] === null) { + $invalidProperties[] = "'scores' 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 userToken + * + * @return string + */ + public function getUserToken() + { + return $this->container['userToken']; + } + + /** + * Sets userToken + * + * @param string $userToken userToken representing the user for which to fetch the Personalization profile + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets lastEventAt + * + * @return string + */ + public function getLastEventAt() + { + return $this->container['lastEventAt']; + } + + /** + * Sets lastEventAt + * + * @param string $lastEventAt Date of last event update. (ISO-8601 format) + * + * @return self + */ + public function setLastEventAt($lastEventAt) + { + $this->container['lastEventAt'] = $lastEventAt; + + return $this; + } + + /** + * Gets scores + * + * @return object + */ + public function getScores() + { + return $this->container['scores']; + } + + /** + * Sets scores + * + * @param object $scores the userToken scores + * + * @return self + */ + public function setScores($scores) + { + $this->container['scores'] = $scores; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetUsersCountResponse.php b/clients/algoliasearch-client-php/lib/Model/GetUsersCountResponse.php new file mode 100644 index 0000000000..cb0f65544c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/GetUsersCountResponse.php @@ -0,0 +1,327 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetUsersCountResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getUsersCountResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'count' => 'int', + 'dates' => '\Algolia\AlgoliaSearch\Model\GetSearchesCountResponseDates[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'count' => null, + 'dates' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'count' => 'count', + 'dates' => 'dates', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'dates' => 'setDates', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'dates' => 'getDates', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['count'] = $data['count'] ?? null; + $this->container['dates'] = $data['dates'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['dates'] === null) { + $invalidProperties[] = "'dates' 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 count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets dates + * + * @return \Algolia\AlgoliaSearch\Model\GetSearchesCountResponseDates[] + */ + public function getDates() + { + return $this->container['dates']; + } + + /** + * Sets dates + * + * @param \Algolia\AlgoliaSearch\Model\GetSearchesCountResponseDates[] $dates a list of users count with their date + * + * @return self + */ + public function setDates($dates) + { + $this->container['dates'] = $dates; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/IndexName.php b/clients/algoliasearch-client-php/lib/Model/IndexName.php new file mode 100644 index 0000000000..53adbac337 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/IndexName.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class IndexName implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'IndexName'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'indexName' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'indexName' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'indexName' => 'indexName', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'indexName' => 'getIndexName', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['indexName'] = $data['indexName'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' 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 indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName']; + } + + /** + * Sets indexName + * + * @param string $indexName index name to target + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/InsightEvent.php b/clients/algoliasearch-client-php/lib/Model/InsightEvent.php new file mode 100644 index 0000000000..a3e9fd6e04 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/InsightEvent.php @@ -0,0 +1,582 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InsightEvent implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InsightEvent'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'eventType' => 'string', + 'eventName' => 'string', + 'index' => 'string', + 'userToken' => 'string', + 'timestamp' => 'int', + 'queryID' => 'string', + 'objectIDs' => 'string[]', + 'filters' => 'string[]', + 'positions' => 'int[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'eventType' => null, + 'eventName' => null, + 'index' => null, + 'userToken' => null, + 'timestamp' => null, + 'queryID' => null, + 'objectIDs' => null, + 'filters' => null, + 'positions' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'eventType' => 'eventType', + 'eventName' => 'eventName', + 'index' => 'index', + 'userToken' => 'userToken', + 'timestamp' => 'timestamp', + 'queryID' => 'queryID', + 'objectIDs' => 'objectIDs', + 'filters' => 'filters', + 'positions' => 'positions', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'eventType' => 'setEventType', + 'eventName' => 'setEventName', + 'index' => 'setIndex', + 'userToken' => 'setUserToken', + 'timestamp' => 'setTimestamp', + 'queryID' => 'setQueryID', + 'objectIDs' => 'setObjectIDs', + 'filters' => 'setFilters', + 'positions' => 'setPositions', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'eventType' => 'getEventType', + 'eventName' => 'getEventName', + 'index' => 'getIndex', + 'userToken' => 'getUserToken', + 'timestamp' => 'getTimestamp', + 'queryID' => 'getQueryID', + 'objectIDs' => 'getObjectIDs', + 'filters' => 'getFilters', + 'positions' => 'getPositions', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const EVENT_TYPE_CLICK = 'click'; + const EVENT_TYPE_CONVERSION = 'conversion'; + const EVENT_TYPE_VIEW = 'view'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEventTypeAllowableValues() + { + return [ + self::EVENT_TYPE_CLICK, + self::EVENT_TYPE_CONVERSION, + self::EVENT_TYPE_VIEW, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['eventType'] = $data['eventType'] ?? null; + $this->container['eventName'] = $data['eventName'] ?? null; + $this->container['index'] = $data['index'] ?? null; + $this->container['userToken'] = $data['userToken'] ?? null; + $this->container['timestamp'] = $data['timestamp'] ?? null; + $this->container['queryID'] = $data['queryID'] ?? null; + $this->container['objectIDs'] = $data['objectIDs'] ?? null; + $this->container['filters'] = $data['filters'] ?? null; + $this->container['positions'] = $data['positions'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['eventType'] === null) { + $invalidProperties[] = "'eventType' can't be null"; + } + $allowedValues = $this->getEventTypeAllowableValues(); + if (!is_null($this->container['eventType']) && !in_array($this->container['eventType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'eventType', must be one of '%s'", + $this->container['eventType'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['eventName'] === null) { + $invalidProperties[] = "'eventName' can't be null"; + } + if ($this->container['index'] === null) { + $invalidProperties[] = "'index' can't be null"; + } + if ($this->container['userToken'] === null) { + $invalidProperties[] = "'userToken' 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 eventType + * + * @return string + */ + public function getEventType() + { + return $this->container['eventType']; + } + + /** + * Sets eventType + * + * @param string $eventType an eventType can be a click, a conversion, or a view + * + * @return self + */ + public function setEventType($eventType) + { + $allowedValues = $this->getEventTypeAllowableValues(); + if (!in_array($eventType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'eventType', must be one of '%s'", + $eventType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['eventType'] = $eventType; + + return $this; + } + + /** + * Gets eventName + * + * @return string + */ + public function getEventName() + { + return $this->container['eventName']; + } + + /** + * Sets eventName + * + * @param string $eventName a user-defined string used to categorize events + * + * @return self + */ + public function setEventName($eventName) + { + $this->container['eventName'] = $eventName; + + return $this; + } + + /** + * Gets index + * + * @return string + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param string $index name of the targeted index + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets userToken + * + * @return string + */ + public function getUserToken() + { + return $this->container['userToken']; + } + + /** + * Sets userToken + * + * @param string $userToken A user identifier. Depending if the user is logged-in or not, several strategies can be used from a sessionId to a technical identifier. + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets timestamp + * + * @return int|null + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int|null $timestamp time of the event expressed in milliseconds since the Unix epoch + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets queryID + * + * @return string|null + */ + public function getQueryID() + { + return $this->container['queryID']; + } + + /** + * Sets queryID + * + * @param string|null $queryID Algolia queryID. This is required when an event is tied to a search. + * + * @return self + */ + public function setQueryID($queryID) + { + $this->container['queryID'] = $queryID; + + return $this; + } + + /** + * Gets objectIDs + * + * @return string[]|null + */ + public function getObjectIDs() + { + return $this->container['objectIDs']; + } + + /** + * Sets objectIDs + * + * @param string[]|null $objectIDs An array of index objectID. Limited to 20 objects. An event can’t have both objectIDs and filters at the same time. + * + * @return self + */ + public function setObjectIDs($objectIDs) + { + $this->container['objectIDs'] = $objectIDs; + + return $this; + } + + /** + * Gets filters + * + * @return string[]|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param string[]|null $filters An array of filters. Limited to 10 filters. An event can’t have both objectIDs and filters at the same time. + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets positions + * + * @return int[]|null + */ + public function getPositions() + { + return $this->container['positions']; + } + + /** + * Sets positions + * + * @param int[]|null $positions Position of the click in the list of Algolia search results. This field is required if a queryID is provided. One position must be provided for each objectID. + * + * @return self + */ + public function setPositions($positions) + { + $this->container['positions'] = $positions; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/InsightEvents.php b/clients/algoliasearch-client-php/lib/Model/InsightEvents.php new file mode 100644 index 0000000000..82e03abbd3 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/InsightEvents.php @@ -0,0 +1,296 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class InsightEvents implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InsightEvents'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'events' => '\Algolia\AlgoliaSearch\Model\InsightEvent[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'events' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'events' => 'events', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'events' => 'setEvents', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'events' => 'getEvents', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['events'] = $data['events'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['events'] === null) { + $invalidProperties[] = "'events' 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 events + * + * @return \Algolia\AlgoliaSearch\Model\InsightEvent[] + */ + public function getEvents() + { + return $this->container['events']; + } + + /** + * Sets events + * + * @param \Algolia\AlgoliaSearch\Model\InsightEvent[] $events array of events sent + * + * @return self + */ + public function setEvents($events) + { + $this->container['events'] = $events; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/ListABTestsResponse.php b/clients/algoliasearch-client-php/lib/Model/ListABTestsResponse.php new file mode 100644 index 0000000000..7cd41af6e9 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/ListABTestsResponse.php @@ -0,0 +1,360 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListABTestsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'listABTestsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'abtests' => '\Algolia\AlgoliaSearch\Model\ABTest[]', + 'count' => 'int', + 'total' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'abtests' => null, + 'count' => null, + 'total' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'abtests' => 'abtests', + 'count' => 'count', + 'total' => 'total', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abtests' => 'setAbtests', + 'count' => 'setCount', + 'total' => 'setTotal', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abtests' => 'getAbtests', + 'count' => 'getCount', + 'total' => 'getTotal', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['abtests'] = $data['abtests'] ?? null; + $this->container['count'] = $data['count'] ?? null; + $this->container['total'] = $data['total'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['abtests'] === null) { + $invalidProperties[] = "'abtests' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' 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 abtests + * + * @return \Algolia\AlgoliaSearch\Model\ABTest[] + */ + public function getAbtests() + { + return $this->container['abtests']; + } + + /** + * Sets abtests + * + * @param \Algolia\AlgoliaSearch\Model\ABTest[] $abtests list of A/B tests + * + * @return self + */ + public function setAbtests($abtests) + { + $this->container['abtests'] = $abtests; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count number of A/B tests found for the app + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int $total number of A/B tests retrievable + * + * @return self + */ + public function setTotal($total) + { + $this->container['total'] = $total; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/LogFile.php b/clients/algoliasearch-client-php/lib/Model/LogFile.php new file mode 100644 index 0000000000..321cd2857c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/LogFile.php @@ -0,0 +1,430 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class LogFile implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LogFile'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'timestamp' => 'string', + 'level' => 'string', + 'message' => 'string', + 'contextLevel' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'timestamp' => null, + 'level' => null, + 'message' => null, + 'contextLevel' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'timestamp' => 'timestamp', + 'level' => 'level', + 'message' => 'message', + 'contextLevel' => 'contextLevel', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'timestamp' => 'setTimestamp', + 'level' => 'setLevel', + 'message' => 'setMessage', + 'contextLevel' => 'setContextLevel', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'timestamp' => 'getTimestamp', + 'level' => 'getLevel', + 'message' => 'getMessage', + 'contextLevel' => 'getContextLevel', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const LEVEL_INFO = 'INFO'; + const LEVEL_SKIP = 'SKIP'; + const LEVEL_ERROR = 'ERROR'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getLevelAllowableValues() + { + return [ + self::LEVEL_INFO, + self::LEVEL_SKIP, + self::LEVEL_ERROR, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['timestamp'] = $data['timestamp'] ?? null; + $this->container['level'] = $data['level'] ?? null; + $this->container['message'] = $data['message'] ?? null; + $this->container['contextLevel'] = $data['contextLevel'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if ($this->container['level'] === null) { + $invalidProperties[] = "'level' can't be null"; + } + $allowedValues = $this->getLevelAllowableValues(); + if (!is_null($this->container['level']) && !in_array($this->container['level'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'level', must be one of '%s'", + $this->container['level'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + if ($this->container['contextLevel'] === null) { + $invalidProperties[] = "'contextLevel' 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 timestamp + * + * @return string + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param string $timestamp date and time of creation of the record + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets level + * + * @return string + */ + public function getLevel() + { + return $this->container['level']; + } + + /** + * Sets level + * + * @param string $level type of the record, can be one of three values (INFO, SKIP or ERROR) + * + * @return self + */ + public function setLevel($level) + { + $allowedValues = $this->getLevelAllowableValues(); + if (!in_array($level, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'level', must be one of '%s'", + $level, + implode("', '", $allowedValues) + ) + ); + } + $this->container['level'] = $level; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message detailed description of what happened + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets contextLevel + * + * @return int + */ + public function getContextLevel() + { + return $this->container['contextLevel']; + } + + /** + * Sets contextLevel + * + * @param int $contextLevel indicates the hierarchy of the records. For example, a record with contextLevel=1 belongs to a preceding record with contextLevel=0. + * + * @return self + */ + public function setContextLevel($contextLevel) + { + $this->container['contextLevel'] = $contextLevel; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/PersonalizationStrategyObject.php b/clients/algoliasearch-client-php/lib/Model/PersonalizationStrategyObject.php new file mode 100644 index 0000000000..746d941183 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/PersonalizationStrategyObject.php @@ -0,0 +1,360 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonalizationStrategyObject implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'personalizationStrategyObject'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'eventScoring' => '\Algolia\AlgoliaSearch\Model\EventScoring[]', + 'facetScoring' => '\Algolia\AlgoliaSearch\Model\FacetScoring[]', + 'personalizationImpact' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'eventScoring' => null, + 'facetScoring' => null, + 'personalizationImpact' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'eventScoring' => 'eventScoring', + 'facetScoring' => 'facetScoring', + 'personalizationImpact' => 'personalizationImpact', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'eventScoring' => 'setEventScoring', + 'facetScoring' => 'setFacetScoring', + 'personalizationImpact' => 'setPersonalizationImpact', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'eventScoring' => 'getEventScoring', + 'facetScoring' => 'getFacetScoring', + 'personalizationImpact' => 'getPersonalizationImpact', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['eventScoring'] = $data['eventScoring'] ?? null; + $this->container['facetScoring'] = $data['facetScoring'] ?? null; + $this->container['personalizationImpact'] = $data['personalizationImpact'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['eventScoring'] === null) { + $invalidProperties[] = "'eventScoring' can't be null"; + } + if ($this->container['facetScoring'] === null) { + $invalidProperties[] = "'facetScoring' can't be null"; + } + if ($this->container['personalizationImpact'] === null) { + $invalidProperties[] = "'personalizationImpact' 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 eventScoring + * + * @return \Algolia\AlgoliaSearch\Model\EventScoring[] + */ + public function getEventScoring() + { + return $this->container['eventScoring']; + } + + /** + * Sets eventScoring + * + * @param \Algolia\AlgoliaSearch\Model\EventScoring[] $eventScoring scores associated with the events + * + * @return self + */ + public function setEventScoring($eventScoring) + { + $this->container['eventScoring'] = $eventScoring; + + return $this; + } + + /** + * Gets facetScoring + * + * @return \Algolia\AlgoliaSearch\Model\FacetScoring[] + */ + public function getFacetScoring() + { + return $this->container['facetScoring']; + } + + /** + * Sets facetScoring + * + * @param \Algolia\AlgoliaSearch\Model\FacetScoring[] $facetScoring scores associated with the facets + * + * @return self + */ + public function setFacetScoring($facetScoring) + { + $this->container['facetScoring'] = $facetScoring; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact']; + } + + /** + * Sets personalizationImpact + * + * @param int $personalizationImpact the impact that personalization has on search results: a number between 0 (personalization disabled) and 100 (personalization fully enabled) + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/PushEventsResponse.php b/clients/algoliasearch-client-php/lib/Model/PushEventsResponse.php new file mode 100644 index 0000000000..b3c5b2a229 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/PushEventsResponse.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PushEventsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'pushEventsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($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 message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message a message confirming the event push + * + * @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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndex.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndex.php new file mode 100644 index 0000000000..d3d86d5abe --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndex.php @@ -0,0 +1,393 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class QuerySuggestionsIndex implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'QuerySuggestionsIndex'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'indexName' => 'string', + 'sourceIndices' => '\Algolia\AlgoliaSearch\Model\SourceIndexWithReplicas[]', + 'languages' => 'string[]', + 'exclude' => 'string[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'indexName' => null, + 'sourceIndices' => null, + 'languages' => null, + 'exclude' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'indexName' => 'indexName', + 'sourceIndices' => 'sourceIndices', + 'languages' => 'languages', + 'exclude' => 'exclude', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + 'sourceIndices' => 'setSourceIndices', + 'languages' => 'setLanguages', + 'exclude' => 'setExclude', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'indexName' => 'getIndexName', + 'sourceIndices' => 'getSourceIndices', + 'languages' => 'getLanguages', + 'exclude' => 'getExclude', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['indexName'] = $data['indexName'] ?? null; + $this->container['sourceIndices'] = $data['sourceIndices'] ?? null; + $this->container['languages'] = $data['languages'] ?? null; + $this->container['exclude'] = $data['exclude'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + if ($this->container['sourceIndices'] === null) { + $invalidProperties[] = "'sourceIndices' can't be null"; + } + if ($this->container['languages'] === null) { + $invalidProperties[] = "'languages' can't be null"; + } + if ($this->container['exclude'] === null) { + $invalidProperties[] = "'exclude' 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 indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName']; + } + + /** + * Sets indexName + * + * @param string $indexName index name to target + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets sourceIndices + * + * @return \Algolia\AlgoliaSearch\Model\SourceIndexWithReplicas[] + */ + public function getSourceIndices() + { + return $this->container['sourceIndices']; + } + + /** + * Sets sourceIndices + * + * @param \Algolia\AlgoliaSearch\Model\SourceIndexWithReplicas[] $sourceIndices list of source indices used to generate a Query Suggestions index + * + * @return self + */ + public function setSourceIndices($sourceIndices) + { + $this->container['sourceIndices'] = $sourceIndices; + + return $this; + } + + /** + * Gets languages + * + * @return string[] + */ + public function getLanguages() + { + return $this->container['languages']; + } + + /** + * Sets languages + * + * @param string[] $languages De-duplicate singular and plural suggestions. For example, let's say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain. + * + * @return self + */ + public function setLanguages($languages) + { + $this->container['languages'] = $languages; + + return $this; + } + + /** + * Gets exclude + * + * @return string[] + */ + public function getExclude() + { + return $this->container['exclude']; + } + + /** + * Sets exclude + * + * @param string[] $exclude list of words and patterns to exclude from the Query Suggestions index + * + * @return self + */ + public function setExclude($exclude) + { + $this->container['exclude'] = $exclude; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndexParam.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndexParam.php new file mode 100644 index 0000000000..a657792718 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndexParam.php @@ -0,0 +1,354 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class QuerySuggestionsIndexParam implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'QuerySuggestionsIndexParam'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'sourceIndices' => '\Algolia\AlgoliaSearch\Model\SourceIndex[]', + 'languages' => 'string[]', + 'exclude' => 'string[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'sourceIndices' => null, + 'languages' => null, + 'exclude' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sourceIndices' => 'sourceIndices', + 'languages' => 'languages', + 'exclude' => 'exclude', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sourceIndices' => 'setSourceIndices', + 'languages' => 'setLanguages', + 'exclude' => 'setExclude', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sourceIndices' => 'getSourceIndices', + 'languages' => 'getLanguages', + 'exclude' => 'getExclude', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['sourceIndices'] = $data['sourceIndices'] ?? null; + $this->container['languages'] = $data['languages'] ?? null; + $this->container['exclude'] = $data['exclude'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['sourceIndices'] === null) { + $invalidProperties[] = "'sourceIndices' 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 sourceIndices + * + * @return \Algolia\AlgoliaSearch\Model\SourceIndex[] + */ + public function getSourceIndices() + { + return $this->container['sourceIndices']; + } + + /** + * Sets sourceIndices + * + * @param \Algolia\AlgoliaSearch\Model\SourceIndex[] $sourceIndices list of source indices used to generate a Query Suggestions index + * + * @return self + */ + public function setSourceIndices($sourceIndices) + { + $this->container['sourceIndices'] = $sourceIndices; + + return $this; + } + + /** + * Gets languages + * + * @return string[]|null + */ + public function getLanguages() + { + return $this->container['languages']; + } + + /** + * Sets languages + * + * @param string[]|null $languages De-duplicate singular and plural suggestions. For example, let's say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain. + * + * @return self + */ + public function setLanguages($languages) + { + $this->container['languages'] = $languages; + + return $this; + } + + /** + * Gets exclude + * + * @return string[]|null + */ + public function getExclude() + { + return $this->container['exclude']; + } + + /** + * Sets exclude + * + * @param string[]|null $exclude list of words and patterns to exclude from the Query Suggestions index + * + * @return self + */ + public function setExclude($exclude) + { + $this->container['exclude'] = $exclude; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndexWithIndexParam.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndexWithIndexParam.php new file mode 100644 index 0000000000..6ddaf4b39f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndexWithIndexParam.php @@ -0,0 +1,387 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class QuerySuggestionsIndexWithIndexParam implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'QuerySuggestionsIndexWithIndexParam'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'sourceIndices' => '\Algolia\AlgoliaSearch\Model\SourceIndex[]', + 'languages' => 'string[]', + 'exclude' => 'string[]', + 'indexName' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'sourceIndices' => null, + 'languages' => null, + 'exclude' => null, + 'indexName' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sourceIndices' => 'sourceIndices', + 'languages' => 'languages', + 'exclude' => 'exclude', + 'indexName' => 'indexName', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sourceIndices' => 'setSourceIndices', + 'languages' => 'setLanguages', + 'exclude' => 'setExclude', + 'indexName' => 'setIndexName', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sourceIndices' => 'getSourceIndices', + 'languages' => 'getLanguages', + 'exclude' => 'getExclude', + 'indexName' => 'getIndexName', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['sourceIndices'] = $data['sourceIndices'] ?? null; + $this->container['languages'] = $data['languages'] ?? null; + $this->container['exclude'] = $data['exclude'] ?? null; + $this->container['indexName'] = $data['indexName'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['sourceIndices'] === null) { + $invalidProperties[] = "'sourceIndices' can't be null"; + } + if ($this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' 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 sourceIndices + * + * @return \Algolia\AlgoliaSearch\Model\SourceIndex[] + */ + public function getSourceIndices() + { + return $this->container['sourceIndices']; + } + + /** + * Sets sourceIndices + * + * @param \Algolia\AlgoliaSearch\Model\SourceIndex[] $sourceIndices list of source indices used to generate a Query Suggestions index + * + * @return self + */ + public function setSourceIndices($sourceIndices) + { + $this->container['sourceIndices'] = $sourceIndices; + + return $this; + } + + /** + * Gets languages + * + * @return string[]|null + */ + public function getLanguages() + { + return $this->container['languages']; + } + + /** + * Sets languages + * + * @param string[]|null $languages De-duplicate singular and plural suggestions. For example, let's say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain. + * + * @return self + */ + public function setLanguages($languages) + { + $this->container['languages'] = $languages; + + return $this; + } + + /** + * Gets exclude + * + * @return string[]|null + */ + public function getExclude() + { + return $this->container['exclude']; + } + + /** + * Sets exclude + * + * @param string[]|null $exclude list of words and patterns to exclude from the Query Suggestions index + * + * @return self + */ + public function setExclude($exclude) + { + $this->container['exclude'] = $exclude; + + return $this; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName']; + } + + /** + * Sets indexName + * + * @param string $indexName index name to target + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/RecommendHits.php b/clients/algoliasearch-client-php/lib/Model/RecommendHits.php new file mode 100644 index 0000000000..79323dd78c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/RecommendHits.php @@ -0,0 +1,290 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecommendHits implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'recommendHits'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'hits' => '\Algolia\AlgoliaSearch\Model\RecommendRecord[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'hits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'hits' => 'hits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['hits'] = $data['hits'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 hits + * + * @return \Algolia\AlgoliaSearch\Model\RecommendRecord[]|null + */ + public function getHits() + { + return $this->container['hits']; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\RecommendRecord[]|null $hits hits + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/RecommendRecord.php b/clients/algoliasearch-client-php/lib/Model/RecommendRecord.php new file mode 100644 index 0000000000..d3c5b65cde --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/RecommendRecord.php @@ -0,0 +1,463 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecommendRecord implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'recommendRecord'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'objectID' => 'string', + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\HighlightResult', + 'snippetResult' => '\Algolia\AlgoliaSearch\Model\SnippetResult', + 'rankingInfo' => '\Algolia\AlgoliaSearch\Model\RankingInfo', + 'distinctSeqID' => 'int', + 'score' => 'double', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'objectID' => null, + 'highlightResult' => null, + 'snippetResult' => null, + 'rankingInfo' => null, + 'distinctSeqID' => null, + 'score' => 'double', + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'objectID' => 'objectID', + 'highlightResult' => '_highlightResult', + 'snippetResult' => '_snippetResult', + 'rankingInfo' => '_rankingInfo', + 'distinctSeqID' => '_distinctSeqID', + 'score' => '_score', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'highlightResult' => 'setHighlightResult', + 'snippetResult' => 'setSnippetResult', + 'rankingInfo' => 'setRankingInfo', + 'distinctSeqID' => 'setDistinctSeqID', + 'score' => 'setScore', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'highlightResult' => 'getHighlightResult', + 'snippetResult' => 'getSnippetResult', + 'rankingInfo' => 'getRankingInfo', + 'distinctSeqID' => 'getDistinctSeqID', + 'score' => 'getScore', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['objectID'] = $data['objectID'] ?? null; + $this->container['highlightResult'] = $data['highlightResult'] ?? null; + $this->container['snippetResult'] = $data['snippetResult'] ?? null; + $this->container['rankingInfo'] = $data['rankingInfo'] ?? null; + $this->container['distinctSeqID'] = $data['distinctSeqID'] ?? null; + $this->container['score'] = $data['score'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if ($this->container['score'] === null) { + $invalidProperties[] = "'score' can't be null"; + } + if (($this->container['score'] > 100)) { + $invalidProperties[] = "invalid value for 'score', must be smaller than or equal to 100."; + } + + if (($this->container['score'] < 0)) { + $invalidProperties[] = "invalid value for 'score', must be bigger than or equal to 0."; + } + + 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 objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets highlightResult + * + * @return \Algolia\AlgoliaSearch\Model\HighlightResult|null + */ + public function getHighlightResult() + { + return $this->container['highlightResult']; + } + + /** + * Sets highlightResult + * + * @param \Algolia\AlgoliaSearch\Model\HighlightResult|null $highlightResult highlightResult + * + * @return self + */ + public function setHighlightResult($highlightResult) + { + $this->container['highlightResult'] = $highlightResult; + + return $this; + } + + /** + * Gets snippetResult + * + * @return \Algolia\AlgoliaSearch\Model\SnippetResult|null + */ + public function getSnippetResult() + { + return $this->container['snippetResult']; + } + + /** + * Sets snippetResult + * + * @param \Algolia\AlgoliaSearch\Model\SnippetResult|null $snippetResult snippetResult + * + * @return self + */ + public function setSnippetResult($snippetResult) + { + $this->container['snippetResult'] = $snippetResult; + + return $this; + } + + /** + * Gets rankingInfo + * + * @return \Algolia\AlgoliaSearch\Model\RankingInfo|null + */ + public function getRankingInfo() + { + return $this->container['rankingInfo']; + } + + /** + * Sets rankingInfo + * + * @param \Algolia\AlgoliaSearch\Model\RankingInfo|null $rankingInfo rankingInfo + * + * @return self + */ + public function setRankingInfo($rankingInfo) + { + $this->container['rankingInfo'] = $rankingInfo; + + return $this; + } + + /** + * Gets distinctSeqID + * + * @return int|null + */ + public function getDistinctSeqID() + { + return $this->container['distinctSeqID']; + } + + /** + * Sets distinctSeqID + * + * @param int|null $distinctSeqID distinctSeqID + * + * @return self + */ + public function setDistinctSeqID($distinctSeqID) + { + $this->container['distinctSeqID'] = $distinctSeqID; + + return $this; + } + + /** + * Gets score + * + * @return float + */ + public function getScore() + { + return $this->container['score']; + } + + /** + * Sets score + * + * @param float $score the recommendation score + * + * @return self + */ + public function setScore($score) + { + if (($score > 100)) { + throw new \InvalidArgumentException('invalid value for $score when calling RecommendRecord., must be smaller than or equal to 100.'); + } + if (($score < 0)) { + throw new \InvalidArgumentException('invalid value for $score when calling RecommendRecord., must be bigger than or equal to 0.'); + } + + $this->container['score'] = $score; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/RecommendationRequest.php b/clients/algoliasearch-client-php/lib/Model/RecommendationRequest.php new file mode 100644 index 0000000000..d72630b8e5 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/RecommendationRequest.php @@ -0,0 +1,532 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecommendationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'recommendationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'indexName' => 'string', + 'objectID' => 'string', + 'model' => 'string', + 'threshold' => 'int', + 'maxRecommendations' => 'int', + 'queryParameters' => '\Algolia\AlgoliaSearch\Model\SearchParams', + 'fallbackParameters' => '\Algolia\AlgoliaSearch\Model\SearchParams', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'indexName' => null, + 'objectID' => null, + 'model' => null, + 'threshold' => null, + 'maxRecommendations' => null, + 'queryParameters' => null, + 'fallbackParameters' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'indexName' => 'indexName', + 'objectID' => 'objectID', + 'model' => 'model', + 'threshold' => 'threshold', + 'maxRecommendations' => 'maxRecommendations', + 'queryParameters' => 'queryParameters', + 'fallbackParameters' => 'fallbackParameters', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + 'objectID' => 'setObjectID', + 'model' => 'setModel', + 'threshold' => 'setThreshold', + 'maxRecommendations' => 'setMaxRecommendations', + 'queryParameters' => 'setQueryParameters', + 'fallbackParameters' => 'setFallbackParameters', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'indexName' => 'getIndexName', + 'objectID' => 'getObjectID', + 'model' => 'getModel', + 'threshold' => 'getThreshold', + 'maxRecommendations' => 'getMaxRecommendations', + 'queryParameters' => 'getQueryParameters', + 'fallbackParameters' => 'getFallbackParameters', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const MODEL_RELATED_PRODUCTS = 'related-products'; + const MODEL_BOUGHT_TOGETHER = 'bought-together'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getModelAllowableValues() + { + return [ + self::MODEL_RELATED_PRODUCTS, + self::MODEL_BOUGHT_TOGETHER, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['indexName'] = $data['indexName'] ?? null; + $this->container['objectID'] = $data['objectID'] ?? null; + $this->container['model'] = $data['model'] ?? null; + $this->container['threshold'] = $data['threshold'] ?? null; + $this->container['maxRecommendations'] = $data['maxRecommendations'] ?? 0; + $this->container['queryParameters'] = $data['queryParameters'] ?? null; + $this->container['fallbackParameters'] = $data['fallbackParameters'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + if ($this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if ($this->container['model'] === null) { + $invalidProperties[] = "'model' can't be null"; + } + $allowedValues = $this->getModelAllowableValues(); + if (!is_null($this->container['model']) && !in_array($this->container['model'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'model', must be one of '%s'", + $this->container['model'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['threshold'] === null) { + $invalidProperties[] = "'threshold' can't be null"; + } + if (($this->container['threshold'] > 100)) { + $invalidProperties[] = "invalid value for 'threshold', must be smaller than or equal to 100."; + } + + if (($this->container['threshold'] < 0)) { + $invalidProperties[] = "invalid value for 'threshold', must be bigger than or equal to 0."; + } + + 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 indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName']; + } + + /** + * Sets indexName + * + * @param string $indexName the Algolia index name + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets model + * + * @return string + */ + public function getModel() + { + return $this->container['model']; + } + + /** + * Sets model + * + * @param string $model the recommendation model to use + * + * @return self + */ + public function setModel($model) + { + $allowedValues = $this->getModelAllowableValues(); + if (!in_array($model, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'model', must be one of '%s'", + $model, + implode("', '", $allowedValues) + ) + ); + } + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets threshold + * + * @return int + */ + public function getThreshold() + { + return $this->container['threshold']; + } + + /** + * Sets threshold + * + * @param int $threshold the threshold to use when filtering recommendations by their score + * + * @return self + */ + public function setThreshold($threshold) + { + if (($threshold > 100)) { + throw new \InvalidArgumentException('invalid value for $threshold when calling RecommendationRequest., must be smaller than or equal to 100.'); + } + if (($threshold < 0)) { + throw new \InvalidArgumentException('invalid value for $threshold when calling RecommendationRequest., must be bigger than or equal to 0.'); + } + + $this->container['threshold'] = $threshold; + + return $this; + } + + /** + * Gets maxRecommendations + * + * @return int|null + */ + public function getMaxRecommendations() + { + return $this->container['maxRecommendations']; + } + + /** + * Sets maxRecommendations + * + * @param int|null $maxRecommendations The max number of recommendations to retrieve. If it's set to 0, all the recommendations of the objectID may be returned. + * + * @return self + */ + public function setMaxRecommendations($maxRecommendations) + { + $this->container['maxRecommendations'] = $maxRecommendations; + + return $this; + } + + /** + * Gets queryParameters + * + * @return \Algolia\AlgoliaSearch\Model\SearchParams|null + */ + public function getQueryParameters() + { + return $this->container['queryParameters']; + } + + /** + * Sets queryParameters + * + * @param \Algolia\AlgoliaSearch\Model\SearchParams|null $queryParameters queryParameters + * + * @return self + */ + public function setQueryParameters($queryParameters) + { + $this->container['queryParameters'] = $queryParameters; + + return $this; + } + + /** + * Gets fallbackParameters + * + * @return \Algolia\AlgoliaSearch\Model\SearchParams|null + */ + public function getFallbackParameters() + { + return $this->container['fallbackParameters']; + } + + /** + * Sets fallbackParameters + * + * @param \Algolia\AlgoliaSearch\Model\SearchParams|null $fallbackParameters fallbackParameters + * + * @return self + */ + public function setFallbackParameters($fallbackParameters) + { + $this->container['fallbackParameters'] = $fallbackParameters; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/RecommendationsResponse.php b/clients/algoliasearch-client-php/lib/Model/RecommendationsResponse.php new file mode 100644 index 0000000000..3bdf0b5864 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/RecommendationsResponse.php @@ -0,0 +1,1049 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecommendationsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'recommendationsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'abTestID' => 'int', + 'abTestVariantID' => 'int', + 'aroundLatLng' => 'string', + 'automaticRadius' => 'string', + 'exhaustiveFacetsCount' => 'bool', + 'exhaustiveNbHits' => 'bool', + 'exhaustiveTypo' => 'bool', + 'facets' => 'array>', + 'facetsStats' => 'array', + 'hitsPerPage' => 'int', + 'index' => 'string', + 'indexUsed' => 'string', + 'message' => 'string', + 'nbHits' => 'int', + 'nbPages' => 'int', + 'nbSortedHits' => 'int', + 'page' => 'int', + 'params' => 'string', + 'parsedQuery' => 'string', + 'processingTimeMS' => 'int', + 'query' => 'string', + 'queryAfterRemoval' => 'string', + 'serverUsed' => 'string', + 'userData' => 'object', + 'hits' => '\Algolia\AlgoliaSearch\Model\RecommendRecord[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'abTestID' => null, + 'abTestVariantID' => null, + 'aroundLatLng' => null, + 'automaticRadius' => null, + 'exhaustiveFacetsCount' => null, + 'exhaustiveNbHits' => null, + 'exhaustiveTypo' => null, + 'facets' => null, + 'facetsStats' => null, + 'hitsPerPage' => null, + 'index' => null, + 'indexUsed' => null, + 'message' => null, + 'nbHits' => null, + 'nbPages' => null, + 'nbSortedHits' => null, + 'page' => null, + 'params' => null, + 'parsedQuery' => null, + 'processingTimeMS' => null, + 'query' => null, + 'queryAfterRemoval' => null, + 'serverUsed' => null, + 'userData' => null, + 'hits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'abTestID' => 'abTestID', + 'abTestVariantID' => 'abTestVariantID', + 'aroundLatLng' => 'aroundLatLng', + 'automaticRadius' => 'automaticRadius', + 'exhaustiveFacetsCount' => 'exhaustiveFacetsCount', + 'exhaustiveNbHits' => 'exhaustiveNbHits', + 'exhaustiveTypo' => 'exhaustiveTypo', + 'facets' => 'facets', + 'facetsStats' => 'facets_stats', + 'hitsPerPage' => 'hitsPerPage', + 'index' => 'index', + 'indexUsed' => 'indexUsed', + 'message' => 'message', + 'nbHits' => 'nbHits', + 'nbPages' => 'nbPages', + 'nbSortedHits' => 'nbSortedHits', + 'page' => 'page', + 'params' => 'params', + 'parsedQuery' => 'parsedQuery', + 'processingTimeMS' => 'processingTimeMS', + 'query' => 'query', + 'queryAfterRemoval' => 'queryAfterRemoval', + 'serverUsed' => 'serverUsed', + 'userData' => 'userData', + 'hits' => 'hits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abTestID' => 'setAbTestID', + 'abTestVariantID' => 'setAbTestVariantID', + 'aroundLatLng' => 'setAroundLatLng', + 'automaticRadius' => 'setAutomaticRadius', + 'exhaustiveFacetsCount' => 'setExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'setExhaustiveNbHits', + 'exhaustiveTypo' => 'setExhaustiveTypo', + 'facets' => 'setFacets', + 'facetsStats' => 'setFacetsStats', + 'hitsPerPage' => 'setHitsPerPage', + 'index' => 'setIndex', + 'indexUsed' => 'setIndexUsed', + 'message' => 'setMessage', + 'nbHits' => 'setNbHits', + 'nbPages' => 'setNbPages', + 'nbSortedHits' => 'setNbSortedHits', + 'page' => 'setPage', + 'params' => 'setParams', + 'parsedQuery' => 'setParsedQuery', + 'processingTimeMS' => 'setProcessingTimeMS', + 'query' => 'setQuery', + 'queryAfterRemoval' => 'setQueryAfterRemoval', + 'serverUsed' => 'setServerUsed', + 'userData' => 'setUserData', + 'hits' => 'setHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abTestID' => 'getAbTestID', + 'abTestVariantID' => 'getAbTestVariantID', + 'aroundLatLng' => 'getAroundLatLng', + 'automaticRadius' => 'getAutomaticRadius', + 'exhaustiveFacetsCount' => 'getExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'getExhaustiveNbHits', + 'exhaustiveTypo' => 'getExhaustiveTypo', + 'facets' => 'getFacets', + 'facetsStats' => 'getFacetsStats', + 'hitsPerPage' => 'getHitsPerPage', + 'index' => 'getIndex', + 'indexUsed' => 'getIndexUsed', + 'message' => 'getMessage', + 'nbHits' => 'getNbHits', + 'nbPages' => 'getNbPages', + 'nbSortedHits' => 'getNbSortedHits', + 'page' => 'getPage', + 'params' => 'getParams', + 'parsedQuery' => 'getParsedQuery', + 'processingTimeMS' => 'getProcessingTimeMS', + 'query' => 'getQuery', + 'queryAfterRemoval' => 'getQueryAfterRemoval', + 'serverUsed' => 'getServerUsed', + 'userData' => 'getUserData', + 'hits' => 'getHits', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['abTestID'] = $data['abTestID'] ?? null; + $this->container['abTestVariantID'] = $data['abTestVariantID'] ?? null; + $this->container['aroundLatLng'] = $data['aroundLatLng'] ?? null; + $this->container['automaticRadius'] = $data['automaticRadius'] ?? null; + $this->container['exhaustiveFacetsCount'] = $data['exhaustiveFacetsCount'] ?? null; + $this->container['exhaustiveNbHits'] = $data['exhaustiveNbHits'] ?? null; + $this->container['exhaustiveTypo'] = $data['exhaustiveTypo'] ?? null; + $this->container['facets'] = $data['facets'] ?? null; + $this->container['facetsStats'] = $data['facetsStats'] ?? null; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['index'] = $data['index'] ?? null; + $this->container['indexUsed'] = $data['indexUsed'] ?? null; + $this->container['message'] = $data['message'] ?? null; + $this->container['nbHits'] = $data['nbHits'] ?? null; + $this->container['nbPages'] = $data['nbPages'] ?? null; + $this->container['nbSortedHits'] = $data['nbSortedHits'] ?? null; + $this->container['page'] = $data['page'] ?? 0; + $this->container['params'] = $data['params'] ?? null; + $this->container['parsedQuery'] = $data['parsedQuery'] ?? null; + $this->container['processingTimeMS'] = $data['processingTimeMS'] ?? null; + $this->container['query'] = $data['query'] ?? ''; + $this->container['queryAfterRemoval'] = $data['queryAfterRemoval'] ?? null; + $this->container['serverUsed'] = $data['serverUsed'] ?? null; + $this->container['userData'] = $data['userData'] ?? null; + $this->container['hits'] = $data['hits'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['aroundLatLng']) && !preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $this->container['aroundLatLng'])) { + $invalidProperties[] = "invalid value for 'aroundLatLng', must be conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."; + } + + if ($this->container['exhaustiveNbHits'] === null) { + $invalidProperties[] = "'exhaustiveNbHits' can't be null"; + } + if ($this->container['exhaustiveTypo'] === null) { + $invalidProperties[] = "'exhaustiveTypo' can't be null"; + } + if ($this->container['hitsPerPage'] === null) { + $invalidProperties[] = "'hitsPerPage' can't be null"; + } + if ($this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if ($this->container['nbPages'] === null) { + $invalidProperties[] = "'nbPages' can't be null"; + } + if ($this->container['page'] === null) { + $invalidProperties[] = "'page' can't be null"; + } + if ($this->container['params'] === null) { + $invalidProperties[] = "'params' can't be null"; + } + if ($this->container['processingTimeMS'] === null) { + $invalidProperties[] = "'processingTimeMS' can't be null"; + } + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + if ($this->container['hits'] === null) { + $invalidProperties[] = "'hits' 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 abTestID + * + * @return int|null + */ + public function getAbTestID() + { + return $this->container['abTestID']; + } + + /** + * Sets abTestID + * + * @param int|null $abTestID if a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets abTestVariantID + * + * @return int|null + */ + public function getAbTestVariantID() + { + return $this->container['abTestVariantID']; + } + + /** + * Sets abTestVariantID + * + * @param int|null $abTestVariantID if a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used + * + * @return self + */ + public function setAbTestVariantID($abTestVariantID) + { + $this->container['abTestVariantID'] = $abTestVariantID; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng']; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng the computed geo location + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + if (!is_null($aroundLatLng) && (!preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $aroundLatLng))) { + throw new \InvalidArgumentException("invalid value for $aroundLatLng when calling RecommendationsResponse., must conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."); + } + + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets automaticRadius + * + * @return string|null + */ + public function getAutomaticRadius() + { + return $this->container['automaticRadius']; + } + + /** + * Sets automaticRadius + * + * @param string|null $automaticRadius The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. + * + * @return self + */ + public function setAutomaticRadius($automaticRadius) + { + $this->container['automaticRadius'] = $automaticRadius; + + return $this; + } + + /** + * Gets exhaustiveFacetsCount + * + * @return bool|null + */ + public function getExhaustiveFacetsCount() + { + return $this->container['exhaustiveFacetsCount']; + } + + /** + * Sets exhaustiveFacetsCount + * + * @param bool|null $exhaustiveFacetsCount whether the facet count is exhaustive or approximate + * + * @return self + */ + public function setExhaustiveFacetsCount($exhaustiveFacetsCount) + { + $this->container['exhaustiveFacetsCount'] = $exhaustiveFacetsCount; + + return $this; + } + + /** + * Gets exhaustiveNbHits + * + * @return bool + */ + public function getExhaustiveNbHits() + { + return $this->container['exhaustiveNbHits']; + } + + /** + * Sets exhaustiveNbHits + * + * @param bool $exhaustiveNbHits Indicate if the nbHits count was exhaustive or approximate + * + * @return self + */ + public function setExhaustiveNbHits($exhaustiveNbHits) + { + $this->container['exhaustiveNbHits'] = $exhaustiveNbHits; + + return $this; + } + + /** + * Gets exhaustiveTypo + * + * @return bool + */ + public function getExhaustiveTypo() + { + return $this->container['exhaustiveTypo']; + } + + /** + * Sets exhaustiveTypo + * + * @param bool $exhaustiveTypo Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * + * @return self + */ + public function setExhaustiveTypo($exhaustiveTypo) + { + $this->container['exhaustiveTypo'] = $exhaustiveTypo; + + return $this; + } + + /** + * Gets facets + * + * @return array>|null + */ + public function getFacets() + { + return $this->container['facets']; + } + + /** + * Sets facets + * + * @param array>|null $facets a mapping of each facet name to the corresponding facet counts + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets facetsStats + * + * @return array|null + */ + public function getFacetsStats() + { + return $this->container['facetsStats']; + } + + /** + * Sets facetsStats + * + * @param array|null $facetsStats statistics for numerical facets + * + * @return self + */ + public function setFacetsStats($facetsStats) + { + $this->container['facetsStats'] = $facetsStats; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets index + * + * @return string|null + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param string|null $index index name used for the query + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets indexUsed + * + * @return string|null + */ + public function getIndexUsed() + { + return $this->container['indexUsed']; + } + + /** + * Sets indexUsed + * + * @param string|null $indexUsed Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. + * + * @return self + */ + public function setIndexUsed($indexUsed) + { + $this->container['indexUsed'] = $indexUsed; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message used to return warnings about the query + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits']; + } + + /** + * Sets nbHits + * + * @param int $nbHits number of hits that the search query matched + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets nbPages + * + * @return int + */ + public function getNbPages() + { + return $this->container['nbPages']; + } + + /** + * Sets nbPages + * + * @param int $nbPages Number of pages available for the current query + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + + /** + * Gets nbSortedHits + * + * @return int|null + */ + public function getNbSortedHits() + { + return $this->container['nbSortedHits']; + } + + /** + * Sets nbSortedHits + * + * @param int|null $nbSortedHits The number of hits selected and sorted by the relevant sort algorithm + * + * @return self + */ + public function setNbSortedHits($nbSortedHits) + { + $this->container['nbSortedHits'] = $nbSortedHits; + + return $this; + } + + /** + * Gets page + * + * @return int + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets params + * + * @return string + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param string $params a url-encoded string of all search parameters + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets parsedQuery + * + * @return string|null + */ + public function getParsedQuery() + { + return $this->container['parsedQuery']; + } + + /** + * Sets parsedQuery + * + * @param string|null $parsedQuery the query string that will be searched, after normalization + * + * @return self + */ + public function setParsedQuery($parsedQuery) + { + $this->container['parsedQuery'] = $parsedQuery; + + return $this; + } + + /** + * Gets processingTimeMS + * + * @return int + */ + public function getProcessingTimeMS() + { + return $this->container['processingTimeMS']; + } + + /** + * Sets processingTimeMS + * + * @param int $processingTimeMS time the server took to process the request, in milliseconds + * + * @return self + */ + public function setProcessingTimeMS($processingTimeMS) + { + $this->container['processingTimeMS'] = $processingTimeMS; + + return $this; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets queryAfterRemoval + * + * @return string|null + */ + public function getQueryAfterRemoval() + { + return $this->container['queryAfterRemoval']; + } + + /** + * Sets queryAfterRemoval + * + * @param string|null $queryAfterRemoval a markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set + * + * @return self + */ + public function setQueryAfterRemoval($queryAfterRemoval) + { + $this->container['queryAfterRemoval'] = $queryAfterRemoval; + + return $this; + } + + /** + * Gets serverUsed + * + * @return string|null + */ + public function getServerUsed() + { + return $this->container['serverUsed']; + } + + /** + * Sets serverUsed + * + * @param string|null $serverUsed actual host name of the server that processed the request + * + * @return self + */ + public function setServerUsed($serverUsed) + { + $this->container['serverUsed'] = $serverUsed; + + return $this; + } + + /** + * Gets userData + * + * @return object|null + */ + public function getUserData() + { + return $this->container['userData']; + } + + /** + * Sets userData + * + * @param object|null $userData lets you store custom data in your indices + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + + /** + * Gets hits + * + * @return \Algolia\AlgoliaSearch\Model\RecommendRecord[] + */ + public function getHits() + { + return $this->container['hits']; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\RecommendRecord[] $hits hits + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchParams.php b/clients/algoliasearch-client-php/lib/Model/SearchParams.php index ec002c5001..8753205295 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchParams.php @@ -31,7 +31,6 @@ class SearchParams implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'params' => 'string', 'similarQuery' => 'string', 'filters' => 'string', 'facetFilters' => 'string[]', @@ -119,7 +118,6 @@ class SearchParams implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'params' => null, 'similarQuery' => null, 'filters' => null, 'facetFilters' => null, @@ -226,7 +224,6 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ - 'params' => 'params', 'similarQuery' => 'similarQuery', 'filters' => 'filters', 'facetFilters' => 'facetFilters', @@ -312,7 +309,6 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ - 'params' => 'setParams', 'similarQuery' => 'setSimilarQuery', 'filters' => 'setFilters', 'facetFilters' => 'setFacetFilters', @@ -398,7 +394,6 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ - 'params' => 'getParams', 'similarQuery' => 'getSimilarQuery', 'filters' => 'getFilters', 'facetFilters' => 'getFacetFilters', @@ -639,7 +634,6 @@ public function getAdvancedSyntaxFeaturesAllowableValues() */ public function __construct(array $data = null) { - $this->container['params'] = $data['params'] ?? ''; $this->container['similarQuery'] = $data['similarQuery'] ?? ''; $this->container['filters'] = $data['filters'] ?? ''; $this->container['facetFilters'] = $data['facetFilters'] ?? null; @@ -813,30 +807,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** - * Gets params - * - * @return string|null - */ - public function getParams() - { - return $this->container['params']; - } - - /** - * Sets params - * - * @param string|null $params search parameters as URL-encoded query string - * - * @return self - */ - public function setParams($params) - { - $this->container['params'] = $params; - - return $this; - } - /** * Gets similarQuery * diff --git a/clients/algoliasearch-client-php/lib/Model/SetPersonalizationStrategyResponse.php b/clients/algoliasearch-client-php/lib/Model/SetPersonalizationStrategyResponse.php new file mode 100644 index 0000000000..e7c8487322 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SetPersonalizationStrategyResponse.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SetPersonalizationStrategyResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'setPersonalizationStrategyResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($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 message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message a message confirming the strategy update + * + * @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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/SourceIndex.php b/clients/algoliasearch-client-php/lib/Model/SourceIndex.php new file mode 100644 index 0000000000..694af304e5 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SourceIndex.php @@ -0,0 +1,474 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SourceIndex implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SourceIndex'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'indexName' => 'string', + 'analyticsTags' => 'string[]', + 'facets' => 'object[]', + 'minHits' => 'int', + 'minLetters' => 'int', + 'generate' => 'string[][]', + 'external' => '\Algolia\AlgoliaSearch\Model\SourceIndexExternal[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '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 openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'indexName' => 'indexName', + 'analyticsTags' => 'analyticsTags', + 'facets' => 'facets', + 'minHits' => 'minHits', + 'minLetters' => 'minLetters', + 'generate' => 'generate', + 'external' => 'external', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + '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 = [ + 'indexName' => 'getIndexName', + 'analyticsTags' => 'getAnalyticsTags', + 'facets' => 'getFacets', + 'minHits' => 'getMinHits', + 'minLetters' => 'getMinLetters', + 'generate' => 'getGenerate', + 'external' => 'getExternal', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['indexName'] = $data['indexName'] ?? null; + $this->container['analyticsTags'] = $data['analyticsTags'] ?? null; + $this->container['facets'] = $data['facets'] ?? null; + $this->container['minHits'] = $data['minHits'] ?? null; + $this->container['minLetters'] = $data['minLetters'] ?? null; + $this->container['generate'] = $data['generate'] ?? null; + $this->container['external'] = $data['external'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' 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 indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName']; + } + + /** + * Sets indexName + * + * @param string $indexName source index name + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[]|null + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags']; + } + + /** + * Sets analyticsTags + * + * @param string[]|null $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[]|null + */ + public function getFacets() + { + return $this->container['facets']; + } + + /** + * Sets facets + * + * @param object[]|null $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|null + */ + public function getMinHits() + { + return $this->container['minHits']; + } + + /** + * Sets minHits + * + * @param int|null $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|null + */ + public function getMinLetters() + { + return $this->container['minLetters']; + } + + /** + * Sets minLetters + * + * @param int|null $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[][]|null + */ + public function getGenerate() + { + return $this->container['generate']; + } + + /** + * Sets generate + * + * @param string[][]|null $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\SourceIndexExternal[]|null + */ + public function getExternal() + { + return $this->container['external']; + } + + /** + * Sets external + * + * @param \Algolia\AlgoliaSearch\Model\SourceIndexExternal[]|null $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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/SourceIndexExternal.php b/clients/algoliasearch-client-php/lib/Model/SourceIndexExternal.php new file mode 100644 index 0000000000..77019cf1ef --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SourceIndexExternal.php @@ -0,0 +1,327 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SourceIndexExternal implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SourceIndexExternal'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'query' => 'string', + 'count' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'query' => null, + 'count' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'query' => 'query', + 'count' => 'count', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'count' => 'setCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'count' => 'getCount', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['query'] = $data['query'] ?? null; + $this->container['count'] = $data['count'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + if ($this->container['count'] === null) { + $invalidProperties[] = "'count' 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 query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query The suggestion you would like to add + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int $count The measure of the suggestion relative popularity + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/SourceIndexWithReplicas.php b/clients/algoliasearch-client-php/lib/Model/SourceIndexWithReplicas.php new file mode 100644 index 0000000000..0a3789713f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SourceIndexWithReplicas.php @@ -0,0 +1,525 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SourceIndexWithReplicas implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SourceIndexWithReplicas'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'indexName' => 'string', + 'replicas' => 'bool', + 'analyticsTags' => 'string[]', + 'facets' => 'object[]', + 'minHits' => 'int', + 'minLetters' => 'int', + 'generate' => 'string[][]', + 'external' => '\Algolia\AlgoliaSearch\Model\SourceIndexExternal[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'indexName' => null, + 'replicas' => 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 openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'indexName' => 'indexName', + 'replicas' => 'replicas', + 'analyticsTags' => 'analyticsTags', + 'facets' => 'facets', + 'minHits' => 'minHits', + 'minLetters' => 'minLetters', + 'generate' => 'generate', + 'external' => 'external', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + 'replicas' => 'setReplicas', + '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 = [ + 'indexName' => 'getIndexName', + 'replicas' => 'getReplicas', + 'analyticsTags' => 'getAnalyticsTags', + 'facets' => 'getFacets', + 'minHits' => 'getMinHits', + 'minLetters' => 'getMinLetters', + 'generate' => 'getGenerate', + 'external' => 'getExternal', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['indexName'] = $data['indexName'] ?? null; + $this->container['replicas'] = $data['replicas'] ?? null; + $this->container['analyticsTags'] = $data['analyticsTags'] ?? null; + $this->container['facets'] = $data['facets'] ?? null; + $this->container['minHits'] = $data['minHits'] ?? null; + $this->container['minLetters'] = $data['minLetters'] ?? null; + $this->container['generate'] = $data['generate'] ?? null; + $this->container['external'] = $data['external'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + if ($this->container['replicas'] === null) { + $invalidProperties[] = "'replicas' can't be null"; + } + if ($this->container['analyticsTags'] === null) { + $invalidProperties[] = "'analyticsTags' can't be null"; + } + if ($this->container['facets'] === null) { + $invalidProperties[] = "'facets' can't be null"; + } + if ($this->container['minHits'] === null) { + $invalidProperties[] = "'minHits' can't be null"; + } + if ($this->container['minLetters'] === null) { + $invalidProperties[] = "'minLetters' can't be null"; + } + if ($this->container['generate'] === null) { + $invalidProperties[] = "'generate' can't be null"; + } + if ($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 indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName']; + } + + /** + * Sets indexName + * + * @param string $indexName source index name + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets replicas + * + * @return bool + */ + public function getReplicas() + { + return $this->container['replicas']; + } + + /** + * 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 analyticsTags + * + * @return string[] + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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\SourceIndexExternal[] + */ + public function getExternal() + { + return $this->container['external']; + } + + /** + * Sets external + * + * @param \Algolia\AlgoliaSearch\Model\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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Status.php b/clients/algoliasearch-client-php/lib/Model/Status.php new file mode 100644 index 0000000000..a5deb8d041 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Status.php @@ -0,0 +1,360 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Status implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Status'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'indexName' => 'string', + 'isRunning' => 'bool', + 'lastBuiltAt' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'indexName' => null, + 'isRunning' => null, + 'lastBuiltAt' => 'data-time', + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'indexName' => 'indexName', + 'isRunning' => 'isRunning', + 'lastBuiltAt' => 'lastBuiltAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + 'isRunning' => 'setIsRunning', + 'lastBuiltAt' => 'setLastBuiltAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'indexName' => 'getIndexName', + 'isRunning' => 'getIsRunning', + 'lastBuiltAt' => 'getLastBuiltAt', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['indexName'] = $data['indexName'] ?? null; + $this->container['isRunning'] = $data['isRunning'] ?? null; + $this->container['lastBuiltAt'] = $data['lastBuiltAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + if ($this->container['isRunning'] === null) { + $invalidProperties[] = "'isRunning' can't be null"; + } + if ($this->container['lastBuiltAt'] === null) { + $invalidProperties[] = "'lastBuiltAt' 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 indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName']; + } + + /** + * Sets indexName + * + * @param string $indexName the targeted index name + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets isRunning + * + * @return bool + */ + public function getIsRunning() + { + return $this->container['isRunning']; + } + + /** + * Sets isRunning + * + * @param bool $isRunning true if the Query Suggestions index is running + * + * @return self + */ + public function setIsRunning($isRunning) + { + $this->container['isRunning'] = $isRunning; + + return $this; + } + + /** + * Gets lastBuiltAt + * + * @return string + */ + public function getLastBuiltAt() + { + return $this->container['lastBuiltAt']; + } + + /** + * Sets lastBuiltAt + * + * @param string $lastBuiltAt date and time of the last build + * + * @return self + */ + public function setLastBuiltAt($lastBuiltAt) + { + $this->container['lastBuiltAt'] = $lastBuiltAt; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/SucessResponse.php b/clients/algoliasearch-client-php/lib/Model/SucessResponse.php new file mode 100644 index 0000000000..32ce446a55 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SucessResponse.php @@ -0,0 +1,327 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SucessResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SucessResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'int', + 'message' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null, + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status', + 'message' => 'message', + ]; + + /** + * 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 where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['status'] = $data['status'] ?? null; + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($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']; + } + + /** + * 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']; + } + + /** + * 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Variant.php b/clients/algoliasearch-client-php/lib/Model/Variant.php new file mode 100644 index 0000000000..8ba679d40a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Variant.php @@ -0,0 +1,657 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Variant implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'variant'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'averageClickPosition' => 'int', + 'clickCount' => 'int', + 'clickThroughRate' => 'double', + 'conversionCount' => 'int', + 'conversionRate' => 'double', + 'description' => 'string', + 'index' => 'string', + 'noResultCount' => 'int', + 'searchCount' => 'int', + 'trackedSearchCount' => 'int', + 'trafficPercentage' => 'int', + 'userCount' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'averageClickPosition' => null, + 'clickCount' => null, + 'clickThroughRate' => 'double', + 'conversionCount' => null, + 'conversionRate' => 'double', + 'description' => null, + 'index' => null, + 'noResultCount' => null, + 'searchCount' => null, + 'trackedSearchCount' => null, + 'trafficPercentage' => null, + 'userCount' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'averageClickPosition' => 'averageClickPosition', + 'clickCount' => 'clickCount', + 'clickThroughRate' => 'clickThroughRate', + 'conversionCount' => 'conversionCount', + 'conversionRate' => 'conversionRate', + 'description' => 'description', + 'index' => 'index', + 'noResultCount' => 'noResultCount', + 'searchCount' => 'searchCount', + 'trackedSearchCount' => 'trackedSearchCount', + 'trafficPercentage' => 'trafficPercentage', + 'userCount' => 'userCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'averageClickPosition' => 'setAverageClickPosition', + 'clickCount' => 'setClickCount', + 'clickThroughRate' => 'setClickThroughRate', + 'conversionCount' => 'setConversionCount', + 'conversionRate' => 'setConversionRate', + 'description' => 'setDescription', + 'index' => 'setIndex', + 'noResultCount' => 'setNoResultCount', + 'searchCount' => 'setSearchCount', + 'trackedSearchCount' => 'setTrackedSearchCount', + 'trafficPercentage' => 'setTrafficPercentage', + 'userCount' => 'setUserCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'averageClickPosition' => 'getAverageClickPosition', + 'clickCount' => 'getClickCount', + 'clickThroughRate' => 'getClickThroughRate', + 'conversionCount' => 'getConversionCount', + 'conversionRate' => 'getConversionRate', + 'description' => 'getDescription', + 'index' => 'getIndex', + 'noResultCount' => 'getNoResultCount', + 'searchCount' => 'getSearchCount', + 'trackedSearchCount' => 'getTrackedSearchCount', + 'trafficPercentage' => 'getTrafficPercentage', + 'userCount' => 'getUserCount', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['averageClickPosition'] = $data['averageClickPosition'] ?? null; + $this->container['clickCount'] = $data['clickCount'] ?? null; + $this->container['clickThroughRate'] = $data['clickThroughRate'] ?? null; + $this->container['conversionCount'] = $data['conversionCount'] ?? null; + $this->container['conversionRate'] = $data['conversionRate'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['index'] = $data['index'] ?? null; + $this->container['noResultCount'] = $data['noResultCount'] ?? null; + $this->container['searchCount'] = $data['searchCount'] ?? null; + $this->container['trackedSearchCount'] = $data['trackedSearchCount'] ?? null; + $this->container['trafficPercentage'] = $data['trafficPercentage'] ?? null; + $this->container['userCount'] = $data['userCount'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['averageClickPosition'] === null) { + $invalidProperties[] = "'averageClickPosition' can't be null"; + } + if ($this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + if ($this->container['clickThroughRate'] === null) { + $invalidProperties[] = "'clickThroughRate' can't be null"; + } + if ($this->container['conversionCount'] === null) { + $invalidProperties[] = "'conversionCount' can't be null"; + } + if ($this->container['conversionRate'] === null) { + $invalidProperties[] = "'conversionRate' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['index'] === null) { + $invalidProperties[] = "'index' can't be null"; + } + if ($this->container['noResultCount'] === null) { + $invalidProperties[] = "'noResultCount' can't be null"; + } + if ($this->container['searchCount'] === null) { + $invalidProperties[] = "'searchCount' can't be null"; + } + if ($this->container['trackedSearchCount'] === null) { + $invalidProperties[] = "'trackedSearchCount' can't be null"; + } + if ($this->container['trafficPercentage'] === null) { + $invalidProperties[] = "'trafficPercentage' can't be null"; + } + if ($this->container['userCount'] === null) { + $invalidProperties[] = "'userCount' 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 averageClickPosition + * + * @return int + */ + public function getAverageClickPosition() + { + return $this->container['averageClickPosition']; + } + + /** + * Sets averageClickPosition + * + * @param int $averageClickPosition average click position for the variant + * + * @return self + */ + public function setAverageClickPosition($averageClickPosition) + { + $this->container['averageClickPosition'] = $averageClickPosition; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount']; + } + + /** + * Sets clickCount + * + * @param int $clickCount distinct click count for the variant + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + + /** + * Gets clickThroughRate + * + * @return float + */ + public function getClickThroughRate() + { + return $this->container['clickThroughRate']; + } + + /** + * Sets clickThroughRate + * + * @param float $clickThroughRate click through rate for the variant + * + * @return self + */ + public function setClickThroughRate($clickThroughRate) + { + $this->container['clickThroughRate'] = $clickThroughRate; + + return $this; + } + + /** + * Gets conversionCount + * + * @return int + */ + public function getConversionCount() + { + return $this->container['conversionCount']; + } + + /** + * Sets conversionCount + * + * @param int $conversionCount distinct conversion count for the variant + * + * @return self + */ + public function setConversionCount($conversionCount) + { + $this->container['conversionCount'] = $conversionCount; + + return $this; + } + + /** + * Gets conversionRate + * + * @return float + */ + public function getConversionRate() + { + return $this->container['conversionRate']; + } + + /** + * Sets conversionRate + * + * @param float $conversionRate conversion rate for the variant + * + * @return self + */ + public function setConversionRate($conversionRate) + { + $this->container['conversionRate'] = $conversionRate; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description the A/B test description + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets index + * + * @return string + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param string $index the index performing the A/B test + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets noResultCount + * + * @return int + */ + public function getNoResultCount() + { + return $this->container['noResultCount']; + } + + /** + * Sets noResultCount + * + * @param int $noResultCount the number of occurrences + * + * @return self + */ + public function setNoResultCount($noResultCount) + { + $this->container['noResultCount'] = $noResultCount; + + return $this; + } + + /** + * Gets searchCount + * + * @return int + */ + public function getSearchCount() + { + return $this->container['searchCount']; + } + + /** + * Sets searchCount + * + * @param int $searchCount the number of search during the A/B test + * + * @return self + */ + public function setSearchCount($searchCount) + { + $this->container['searchCount'] = $searchCount; + + return $this; + } + + /** + * Gets trackedSearchCount + * + * @return int + */ + public function getTrackedSearchCount() + { + return $this->container['trackedSearchCount']; + } + + /** + * Sets trackedSearchCount + * + * @param int $trackedSearchCount the number of tracked search click + * + * @return self + */ + public function setTrackedSearchCount($trackedSearchCount) + { + $this->container['trackedSearchCount'] = $trackedSearchCount; + + return $this; + } + + /** + * Gets trafficPercentage + * + * @return int + */ + public function getTrafficPercentage() + { + return $this->container['trafficPercentage']; + } + + /** + * Sets trafficPercentage + * + * @param int $trafficPercentage the traffic perfecentage for the A/B test + * + * @return self + */ + public function setTrafficPercentage($trafficPercentage) + { + $this->container['trafficPercentage'] = $trafficPercentage; + + return $this; + } + + /** + * Gets userCount + * + * @return int + */ + public function getUserCount() + { + return $this->container['userCount']; + } + + /** + * Sets userCount + * + * @param int $userCount the number of user during the A/B test + * + * @return self + */ + public function setUserCount($userCount) + { + $this->container['userCount'] = $userCount; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/RequestOptions/RequestOptionsFactory.php b/clients/algoliasearch-client-php/lib/RequestOptions/RequestOptionsFactory.php index d2ac6a6623..f02eca5c7e 100644 --- a/clients/algoliasearch-client-php/lib/RequestOptions/RequestOptionsFactory.php +++ b/clients/algoliasearch-client-php/lib/RequestOptions/RequestOptionsFactory.php @@ -2,7 +2,7 @@ namespace Algolia\AlgoliaSearch\RequestOptions; -use Algolia\AlgoliaSearch\Configuration\AbstractConfig; +use Algolia\AlgoliaSearch\Configuration\Configuration; use Algolia\AlgoliaSearch\Support\UserAgent; final class RequestOptionsFactory @@ -22,7 +22,7 @@ final class RequestOptionsFactory 'createIfNotExists', ]; - public function __construct(AbstractConfig $config) + public function __construct(Configuration $config) { $this->config = $config; } diff --git a/clients/algoliasearch-client-php/lib/RetryStrategy/ApiWrapper.php b/clients/algoliasearch-client-php/lib/RetryStrategy/ApiWrapper.php index b52ba94c24..ce4d782241 100644 --- a/clients/algoliasearch-client-php/lib/RetryStrategy/ApiWrapper.php +++ b/clients/algoliasearch-client-php/lib/RetryStrategy/ApiWrapper.php @@ -3,7 +3,7 @@ namespace Algolia\AlgoliaSearch\RetryStrategy; use Algolia\AlgoliaSearch\Algolia; -use Algolia\AlgoliaSearch\Configuration\AbstractConfig; +use Algolia\AlgoliaSearch\Configuration\Configuration; use Algolia\AlgoliaSearch\Exceptions\AlgoliaException; use Algolia\AlgoliaSearch\Exceptions\BadRequestException; use Algolia\AlgoliaSearch\Exceptions\NotFoundException; @@ -29,7 +29,7 @@ final class ApiWrapper implements ApiWrapperInterface private $http; /** - * @var AbstractConfig + * @var Configuration */ private $config; @@ -55,7 +55,7 @@ final class ApiWrapper implements ApiWrapperInterface public function __construct( HttpClientInterface $http, - AbstractConfig $config, + Configuration $config, ClusterHosts $clusterHosts, RequestOptionsFactory $RqstOptsFactory = null, LoggerInterface $logger = null diff --git a/clients/algoliasearch-client-php/lib/RetryStrategy/ClusterHosts.php b/clients/algoliasearch-client-php/lib/RetryStrategy/ClusterHosts.php index 8c5a423ed0..57ce7a90a9 100644 --- a/clients/algoliasearch-client-php/lib/RetryStrategy/ClusterHosts.php +++ b/clients/algoliasearch-client-php/lib/RetryStrategy/ClusterHosts.php @@ -93,6 +93,11 @@ public static function createForRecommendation($region) return static::create('recommendation.'.$region.'.algolia.com'); } + public static function createForQuerySuggestions($region) + { + return static::create('query-suggestions.'.$region.'.algolia.com'); + } + public static function createFromCache($cacheKey) { if (!Algolia::isCacheEnabled()) { diff --git a/openapitools.json b/openapitools.json index 4b292eb426..e9a1a771f6 100644 --- a/openapitools.json +++ b/openapitools.json @@ -181,13 +181,129 @@ "templateDir": "#{cwd}/templates/php/", "config": "#{cwd}/openapitools.json", "output": "#{cwd}/clients/algoliasearch-client-php", - "apiPackage": "", "glob": "specs/search/spec.yml", "gitHost": "algolia", "gitUserId": "algolia", "gitRepoId": "algoliasearch-client-php", "invokerPackage": "Algolia\\AlgoliaSearch", "additionalProperties": { + "configClassname": "SearchConfig", + "clusterHostsMethod":"createFromAppId", + "useCache": true, + "variableNamingConvention": "camelCase", + "packageName": "algoliasearch-client-php" + } + }, + "php-recommend": { + "generatorName": "php", + "templateDir": "#{cwd}/templates/php/", + "config": "#{cwd}/openapitools.json", + "output": "#{cwd}/clients/algoliasearch-client-php", + "glob": "specs/recommend/spec.yml", + "gitHost": "algolia", + "gitUserId": "algolia", + "gitRepoId": "algoliasearch-client-php", + "invokerPackage": "Algolia\\AlgoliaSearch", + "additionalProperties": { + "configClassname": "RecommendConfig", + "clusterHostsMethod":"createFromAppId", + "hasRegionalHost": true, + "allowedRegions": "us-de", + "variableNamingConvention": "camelCase", + "packageName": "algoliasearch-client-php" + } + }, + "php-personalization": { + "generatorName": "php", + "templateDir": "#{cwd}/templates/php/", + "config": "#{cwd}/openapitools.json", + "output": "#{cwd}/clients/algoliasearch-client-php", + "glob": "specs/personalization/spec.yml", + "gitHost": "algolia", + "gitUserId": "algolia", + "gitRepoId": "algoliasearch-client-php", + "invokerPackage": "Algolia\\AlgoliaSearch", + "additionalProperties": { + "configClassname": "PersonalizationConfig", + "clusterHostsMethod":"createForRecommendation", + "hasRegionalHost": true, + "allowedRegions": "us-eu", + "variableNamingConvention": "camelCase", + "packageName": "algoliasearch-client-php" + } + }, + "php-analytics": { + "generatorName": "php", + "templateDir": "#{cwd}/templates/php/", + "config": "#{cwd}/openapitools.json", + "output": "#{cwd}/clients/algoliasearch-client-php", + "glob": "specs/analytics/spec.yml", + "gitHost": "algolia", + "gitUserId": "algolia", + "gitRepoId": "algoliasearch-client-php", + "invokerPackage": "Algolia\\AlgoliaSearch", + "additionalProperties": { + "configClassname": "AnalyticsConfig", + "clusterHostsMethod":"createForAnalytics", + "hasRegionalHost": true, + "allowedRegions": "us-de", + "variableNamingConvention": "camelCase", + "packageName": "algoliasearch-client-php" + } + }, + "php-insights": { + "generatorName": "php", + "templateDir": "#{cwd}/templates/php/", + "config": "#{cwd}/openapitools.json", + "output": "#{cwd}/clients/algoliasearch-client-php", + "glob": "specs/insights/spec.yml", + "gitHost": "algolia", + "gitUserId": "algolia", + "gitRepoId": "algoliasearch-client-php", + "invokerPackage": "Algolia\\AlgoliaSearch", + "additionalProperties": { + "configClassname": "InsightsConfig", + "clusterHostsMethod":"createForInsights", + "hasRegionalHost": true, + "allowedRegions": "us-de", + "variableNamingConvention": "camelCase", + "packageName": "algoliasearch-client-php" + } + }, + "php-abtesting": { + "generatorName": "php", + "templateDir": "#{cwd}/templates/php/", + "config": "#{cwd}/openapitools.json", + "output": "#{cwd}/clients/algoliasearch-client-php", + "glob": "specs/abtesting/spec.yml", + "gitHost": "algolia", + "gitUserId": "algolia", + "gitRepoId": "algoliasearch-client-php", + "invokerPackage": "Algolia\\AlgoliaSearch", + "additionalProperties": { + "configClassname": "AbTestingConfig", + "clusterHostsMethod":"createForAnalytics", + "hasRegionalHost": true, + "allowedRegions": "us-de", + "variableNamingConvention": "camelCase", + "packageName": "algoliasearch-client-php" + } + }, + "php-query-suggestions": { + "generatorName": "php", + "templateDir": "#{cwd}/templates/php/", + "config": "#{cwd}/openapitools.json", + "output": "#{cwd}/clients/algoliasearch-client-php", + "glob": "specs/query-suggestions/spec.yml", + "gitHost": "algolia", + "gitUserId": "algolia", + "gitRepoId": "algoliasearch-client-php", + "invokerPackage": "Algolia\\AlgoliaSearch", + "additionalProperties": { + "configClassname": "QuerySuggestionsConfig", + "clusterHostsMethod":"createForQuerySuggestions", + "hasRegionalHost": true, + "allowedRegions": "us-eu", "variableNamingConvention": "camelCase", "packageName": "algoliasearch-client-php" } diff --git a/playground/php/src/abtesting.php b/playground/php/src/abtesting.php new file mode 100644 index 0000000000..bfb6356276 --- /dev/null +++ b/playground/php/src/abtesting.php @@ -0,0 +1,27 @@ + 'testing', + 'variants' => [ + [ + 'index' => 'test1', + 'trafficPercentage' => 30, + 'description' => 'a description', + ], + [ + 'index' => 'test2', + 'trafficPercentage' => 50, + ], + ], + 'endAt' => '2022-02-01', +]; + +var_dump( + $client->addABTests($abTest) +); diff --git a/playground/php/src/analytics.php b/playground/php/src/analytics.php new file mode 100644 index 0000000000..807977921b --- /dev/null +++ b/playground/php/src/analytics.php @@ -0,0 +1,15 @@ +getTopFilterForAttribute( + 'myAttribute1,myAttribute2', + $indexName + ) +); diff --git a/playground/php/src/insights.php b/playground/php/src/insights.php new file mode 100644 index 0000000000..cc18646d4d --- /dev/null +++ b/playground/php/src/insights.php @@ -0,0 +1,23 @@ + 'click', + 'eventName' => 'foo', + 'index' => 'sending_events', + 'userToken' => 'bar', + 'objectIDs' => ['one', 'two'], + 'timestamp' => $twoDaysAgoMs, +]; + +var_dump( + $client->pushEvents([$event]) +); diff --git a/playground/php/src/personalization.php b/playground/php/src/personalization.php new file mode 100644 index 0000000000..fcd77c8aa4 --- /dev/null +++ b/playground/php/src/personalization.php @@ -0,0 +1,11 @@ +deleteUserProfile('userToken') +); diff --git a/playground/php/src/query-suggestions.php b/playground/php/src/query-suggestions.php new file mode 100644 index 0000000000..cac6136a4b --- /dev/null +++ b/playground/php/src/query-suggestions.php @@ -0,0 +1,9 @@ +getAllConfigs()); diff --git a/playground/php/src/recommend.php b/playground/php/src/recommend.php new file mode 100644 index 0000000000..073f1e27f6 --- /dev/null +++ b/playground/php/src/recommend.php @@ -0,0 +1,22 @@ +getRecommendations( + [ + 'requests' => [ + [ + 'indexName' => $indexName, + 'model' => 'bought-together', + 'objectID' => $query, + 'threshold' => 0 + ] + ] + ] +)); diff --git a/scripts/post-gen/php.sh b/scripts/post-gen/php.sh index 74a7dc8764..e550b0c355 100755 --- a/scripts/post-gen/php.sh +++ b/scripts/post-gen/php.sh @@ -18,7 +18,7 @@ lint_client() { else PHP="php8" fi - PHP_CS_FIXER_IGNORE_ENV=1 $PHP vendor/bin/php-cs-fixer fix lib/ -v --using-cache=no --allow-risky=yes + PHP_CS_FIXER_IGNORE_ENV=1 $PHP vendor/bin/php-cs-fixer fix lib/ --using-cache=no --allow-risky=yes } lint_client diff --git a/templates/php/Configuration.mustache b/templates/php/Configuration.mustache index dad3b4dd00..2e0fb46f4e 100644 --- a/templates/php/Configuration.mustache +++ b/templates/php/Configuration.mustache @@ -9,7 +9,7 @@ namespace {{invokerPackage}}\Configuration; * @category Class * @package {{invokerPackage}} */ -class Configuration extends AbstractConfig +abstract class Configuration { /** * Associate array to store API key(s) @@ -60,6 +60,14 @@ class Configuration extends AbstractConfig */ protected $tempFolderPath; + protected $config; + + protected $defaultReadTimeout = 5; + + protected $defaultWriteTimeout = 30; + + protected $defaultConnectTimeout = 2; + public function __construct(array $config = []) { $this->tempFolderPath = sys_get_temp_dir(); @@ -246,4 +254,131 @@ class Configuration extends AbstractConfig return $keyWithPrefix; } + + public function getDefaultConfiguration() + { + return [ + 'appId' => '', + 'apiKey' => '', + 'hosts' => null, + 'readTimeout' => $this->defaultReadTimeout, + 'writeTimeout' => $this->defaultWriteTimeout, + 'connectTimeout' => $this->defaultConnectTimeout, + 'defaultHeaders' => [], + ]; + } + + public function getAppId() + { + return $this->config['appId']; + } + + public function setAppId($appId) + { + $this->config['appId'] = $appId; + + return $this; + } + + public function getAlgoliaApiKey() + { + return $this->config['apiKey']; + } + + public function setAlgoliaApiKey($apiKey) + { + $this->config['apiKey'] = $apiKey; + + return $this; + } + + public function getHosts() + { + return $this->config['hosts']; + } + + public function setHosts($hosts) + { + $this->config['hosts'] = $hosts; + + return $this; + } + + public function getReadTimeout() + { + return $this->config['readTimeout']; + } + + public function setReadTimeout($readTimeout) + { + $this->config['readTimeout'] = $readTimeout; + + return $this; + } + + public function getWriteTimeout() + { + return $this->config['writeTimeout']; + } + + public function setWriteTimeout($writeTimeout) + { + $this->config['writeTimeout'] = $writeTimeout; + + return $this; + } + + public function getConnectTimeout() + { + return $this->config['connectTimeout']; + } + + public function setConnectTimeout($connectTimeout) + { + $this->config['connectTimeout'] = $connectTimeout; + + return $this; + } + + public function getDefaultHeaders() + { + return $this->config['defaultHeaders']; + } + + public function setDefaultHeaders(array $defaultHeaders) + { + $this->config['defaultHeaders'] = $defaultHeaders; + + return $this; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } } diff --git a/templates/php/api.mustache b/templates/php/api.mustache index b6b23880c3..f6d0508239 100644 --- a/templates/php/api.mustache +++ b/templates/php/api.mustache @@ -9,7 +9,7 @@ use GuzzleHttp\RequestOptions; use GuzzleHttp\Utils; use {{invokerPackage}}\Algolia; use {{invokerPackage}}\ApiException; -use {{invokerPackage}}\Configuration\Configuration; +use {{invokerPackage}}\Configuration\{{configClassname}}; use {{invokerPackage}}\HeaderSelector; use {{invokerPackage}}\ObjectSerializer; use {{invokerPackage}}\RetryStrategy\ApiWrapper; @@ -30,7 +30,7 @@ use {{invokerPackage}}\RetryStrategy\ClusterHosts; protected $api; /** - * @var Configuration + * @var {{configClassname}} */ protected $config; @@ -40,10 +40,10 @@ use {{invokerPackage}}\RetryStrategy\ClusterHosts; protected $headerSelector; /** - * @param Configuration $config + * @param {{configClassname}} $config * @param ApiWrapperInterface $apiWrapper */ - public function __construct(ApiWrapperInterface $apiWrapper, Configuration $config) + public function __construct(ApiWrapperInterface $apiWrapper, {{configClassname}} $config) { $this->config = $config; @@ -51,6 +51,24 @@ use {{invokerPackage}}\RetryStrategy\ClusterHosts; $this->headerSelector = new HeaderSelector(); } + {{#hasRegionalHost}} + /** + * Instantiate the client with basic credentials and region + * + * @param string $appId Application ID + * @param string $apiKey Algolia API Key + * @param string $region Region + */ + public static function create($appId = null, $apiKey = null, $region = null) + { + $allowedRegions = explode('-', '{{{allowedRegions}}}'); + $config = {{configClassname}}::create($appId, $apiKey, $region, $allowedRegions); + + return static::createWithConfig($config); + } + {{/hasRegionalHost}} + + {{^hasRegionalHost}} /** * Instantiate the client with basic credentials * @@ -59,18 +77,20 @@ use {{invokerPackage}}\RetryStrategy\ClusterHosts; */ public static function create($appId = null, $apiKey = null) { - return static::createWithConfig(Configuration::create($appId, $apiKey)); + return static::createWithConfig({{configClassname}}::create($appId, $apiKey)); } - + {{/hasRegionalHost}} + /** * Instantiate the client with congiguration * - * @param Configuration $config Configuration + * @param {{configClassname}} $config Configuration */ - public static function createWithConfig(Configuration $config) + public static function createWithConfig({{configClassname}} $config) { $config = clone $config; + {{#useCache}} $cacheKey = sprintf('%s-clusterHosts-%s', __CLASS__, $config->getAppId()); if ($hosts = $config->getHosts()) { @@ -79,9 +99,19 @@ use {{invokerPackage}}\RetryStrategy\ClusterHosts; } elseif (false === ($clusterHosts = ClusterHosts::createFromCache($cacheKey))) { // We'll try to restore the ClusterHost from cache, if we cannot // we create a new instance and set the cache key - $clusterHosts = ClusterHosts::createFromAppId($config->getAppId()) + $clusterHosts = ClusterHosts::{{clusterHostsMethod}}($config->getAppId()) ->setCacheKey($cacheKey); } + {{/useCache}} + + {{^useCache}} + if ($hosts = $config->getHosts()) { + // If a list of hosts was passed, we ignore the cache + $clusterHosts = ClusterHosts::create($hosts); + } else { + $clusterHosts = ClusterHosts::{{clusterHostsMethod}}($config->getAppId()); + } + {{/useCache}} $apiWrapper = new ApiWrapper( Algolia::getHttpClient(), @@ -93,9 +123,9 @@ use {{invokerPackage}}\RetryStrategy\ClusterHosts; } /** - * @return Configuration + * @return {{configClassname}} */ - public function getConfig() + public function getClientConfig() { return $this->config; } diff --git a/templates/php/composer.mustache b/templates/php/composer.mustache index dc58dcb590..3cfdb1bfa6 100644 --- a/templates/php/composer.mustache +++ b/templates/php/composer.mustache @@ -5,7 +5,7 @@ {{#artifactVersion}} "version": "{{.}}", {{/artifactVersion}} - "description": "{{{appDescription}}}", + "description": "API powering the features of Algolia.", "keywords": [ "openapitools", "openapi-generator", From 9153f4cece95421a0f122277941cd0273df30fbc Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Tue, 1 Feb 2022 15:37:10 +0100 Subject: [PATCH 10/26] fix: store spec in CI script --- scripts/ci/create-spec-matrix.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ci/create-spec-matrix.sh b/scripts/ci/create-spec-matrix.sh index 5272f91c20..749ea7dbbc 100755 --- a/scripts/ci/create-spec-matrix.sh +++ b/scripts/ci/create-spec-matrix.sh @@ -11,6 +11,7 @@ for generator in "${GENERATORS[@]}"; do client=${generator#*-} if [[ ! ${SPECS[*]} =~ $client ]]; then changed=$(git diff --shortstat origin/$BASE_BRANCH..HEAD -- specs/$client | wc -l) + SPECS+=($client) if [[ $BASE_CHANGED == "true" || $changed > 0 ]]; then to_check=$(echo $to_check | jq --arg client $client '.client |= .+ [$client]') fi From 16fdef69e93e679873266f0df4ef254e3a77d65f Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Tue, 1 Feb 2022 15:56:22 +0100 Subject: [PATCH 11/26] fix: CI --- scripts/formatter.sh | 7 +++++++ scripts/post-gen/php.sh | 21 ++------------------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/scripts/formatter.sh b/scripts/formatter.sh index 3ffb323d43..2475595e79 100755 --- a/scripts/formatter.sh +++ b/scripts/formatter.sh @@ -14,6 +14,13 @@ if [[ $LANGUAGE == 'javascript' ]]; then # jsdoc/require-hyphen-before-param-description fails to lint more than # 6 parameters, we re-run the script if failed to lint the rest CMD="yarn eslint --ext=ts ${FOLDER} --fix || yarn eslint --ext=ts ${FOLDER} --fix" +elif [[ $LANGUAGE == 'php' ]]; then + if [[ $CI ]]; then + PHP="php" + else + PHP="php8" + fi + CMD= "composer update && composer dump-autoload && PHP_CS_FIXER_IGNORE_ENV=1 $PHP vendor/bin/php-cs-fixer fix lib/ --using-cache=no --allow-risky=yes" elif [[ $LANGUAGE == 'java' ]]; then CMD="find $FOLDER -type f -name \"*.java\" | xargs java --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ diff --git a/scripts/post-gen/php.sh b/scripts/post-gen/php.sh index e550b0c355..df070ad7e1 100755 --- a/scripts/post-gen/php.sh +++ b/scripts/post-gen/php.sh @@ -1,24 +1,7 @@ #!/bin/bash set -e -export GENERATOR=$1 -export CLIENT=$(cat openapitools.json | jq -r --arg generator "$GENERATOR" '."generator-cli".generators[$generator].output' | sed 's/#{cwd}\///g') +FOLDER=$1 #Move Configuration file -mv ./$CLIENT/lib/Configuration.php ./$CLIENT/lib/Configuration/ +mv ./$FOLDER/lib/Configuration.php ./$FOLDER/lib/Configuration/ -lint_client() { - - echo "> Linting ${GENERATOR}..." - cd $CLIENT - composer update - composer dump-autoload - - if [[ $CI ]]; then - PHP="php" - else - PHP="php8" - fi - PHP_CS_FIXER_IGNORE_ENV=1 $PHP vendor/bin/php-cs-fixer fix lib/ --using-cache=no --allow-risky=yes -} - -lint_client From 11ba4ed4a09c3a0dda722ac09e9fe2958a5f19d4 Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Tue, 1 Feb 2022 16:38:46 +0100 Subject: [PATCH 12/26] fix: CI --- scripts/formatter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/formatter.sh b/scripts/formatter.sh index 2475595e79..aba65c1b96 100755 --- a/scripts/formatter.sh +++ b/scripts/formatter.sh @@ -20,7 +20,7 @@ elif [[ $LANGUAGE == 'php' ]]; then else PHP="php8" fi - CMD= "composer update && composer dump-autoload && PHP_CS_FIXER_IGNORE_ENV=1 $PHP vendor/bin/php-cs-fixer fix lib/ --using-cache=no --allow-risky=yes" + CMD= "cd $FOLDER && composer update && composer dump-autoload && PHP_CS_FIXER_IGNORE_ENV=1 $PHP vendor/bin/php-cs-fixer fix lib/ --using-cache=no --allow-risky=yes" elif [[ $LANGUAGE == 'java' ]]; then CMD="find $FOLDER -type f -name \"*.java\" | xargs java --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ From aa0695142b26786370d0a9fc09ce1ba8060e6a9a Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Tue, 1 Feb 2022 17:18:05 +0100 Subject: [PATCH 13/26] fix: openapitools.json --- openapitools.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openapitools.json b/openapitools.json index c64600132a..407bbc85ba 100644 --- a/openapitools.json +++ b/openapitools.json @@ -204,7 +204,7 @@ "templateDir": "#{cwd}/templates/php/", "config": "#{cwd}/openapitools.json", "output": "#{cwd}/clients/algoliasearch-client-php", - "glob": "specs/search/spec.yml", + "glob": "specs/dist/search.yml", "gitHost": "algolia", "gitUserId": "algolia", "gitRepoId": "algoliasearch-client-php", @@ -222,7 +222,7 @@ "templateDir": "#{cwd}/templates/php/", "config": "#{cwd}/openapitools.json", "output": "#{cwd}/clients/algoliasearch-client-php", - "glob": "specs/recommend/spec.yml", + "glob": "specs/dist/recommend.yml", "gitHost": "algolia", "gitUserId": "algolia", "gitRepoId": "algoliasearch-client-php", @@ -241,7 +241,7 @@ "templateDir": "#{cwd}/templates/php/", "config": "#{cwd}/openapitools.json", "output": "#{cwd}/clients/algoliasearch-client-php", - "glob": "specs/personalization/spec.yml", + "glob": "specs/dist/personalization.yml", "gitHost": "algolia", "gitUserId": "algolia", "gitRepoId": "algoliasearch-client-php", @@ -260,7 +260,7 @@ "templateDir": "#{cwd}/templates/php/", "config": "#{cwd}/openapitools.json", "output": "#{cwd}/clients/algoliasearch-client-php", - "glob": "specs/analytics/spec.yml", + "glob": "specs/dist/analytics.yml", "gitHost": "algolia", "gitUserId": "algolia", "gitRepoId": "algoliasearch-client-php", @@ -279,7 +279,7 @@ "templateDir": "#{cwd}/templates/php/", "config": "#{cwd}/openapitools.json", "output": "#{cwd}/clients/algoliasearch-client-php", - "glob": "specs/insights/spec.yml", + "glob": "specs/dist/insights.yml", "gitHost": "algolia", "gitUserId": "algolia", "gitRepoId": "algoliasearch-client-php", @@ -298,7 +298,7 @@ "templateDir": "#{cwd}/templates/php/", "config": "#{cwd}/openapitools.json", "output": "#{cwd}/clients/algoliasearch-client-php", - "glob": "specs/abtesting/spec.yml", + "glob": "specs/dist/abtesting.yml", "gitHost": "algolia", "gitUserId": "algolia", "gitRepoId": "algoliasearch-client-php", @@ -317,7 +317,7 @@ "templateDir": "#{cwd}/templates/php/", "config": "#{cwd}/openapitools.json", "output": "#{cwd}/clients/algoliasearch-client-php", - "glob": "specs/query-suggestions/spec.yml", + "glob": "specs/dist/query-suggestions.yml", "gitHost": "algolia", "gitUserId": "algolia", "gitRepoId": "algoliasearch-client-php", From 9a5f6daa0d01aefb94df01ad4d0cb62c6f40bebb Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Tue, 1 Feb 2022 17:39:49 +0100 Subject: [PATCH 14/26] fix: update ci --- .github/actions/cache/action.yml | 7 ------- .github/workflows/check.yml | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml index f62088bf9b..35832800a4 100644 --- a/.github/actions/cache/action.yml +++ b/.github/actions/cache/action.yml @@ -95,13 +95,6 @@ runs: path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-java-2/target key: ${{ runner.os }}-1-java-client-${{ hashFiles('clients/algoliasearch-client-java-2/**') }}-${{ hashFiles('specs/dist/search.yml') }} - - name: Restore built PHP search client - if: ${{ inputs.job == 'cts' }} - uses: actions/cache@v2 - with: - path: /home/runner/work/api-clients-automation/api-clients-automation/clients/algoliasearch-client-php/dist - key: ${{ runner.os }}-php-client-${{ hashFiles('clients/algoliasearch-client-php/**') }} - # setup yarn - name: Get yarn cache directory path shell: bash diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 32738dbcab..25a8498400 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -157,8 +157,8 @@ jobs: id: cache uses: actions/cache@v2 with: - path: '/home/runner/work/api-clients-automation/api-clients-automation/${{ matrix.client.folder }}/dist' - key: ${{ runner.os }}-php-client-${{ matrix.client.name }}-${{ hashFiles(format('{0}/**', matrix.client.folder)) }} + path: '/home/runner/work/api-clients-automation/api-clients-automation/${{ matrix.client.folder }}/target' + key: ${{ runner.os }}-1-php-client-${{ matrix.client.name }}-${{ hashFiles(format('{0}/**', matrix.client.folder)) }}-${{ hashFiles(format('specs/dist/{0}.yml', matrix.client.name)) }} }} - name: Generate ${{ matrix.client.name }} client if: steps.cache.outputs.cache-hit != 'true' From 663750e167ccceeb540fb8bf14e8bcc60e1c30be Mon Sep 17 00:00:00 2001 From: Pierre Millot Date: Tue, 1 Feb 2022 17:47:33 +0100 Subject: [PATCH 15/26] fix CI --- .github/workflows/check.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 25a8498400..c20ed2090b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -151,7 +151,9 @@ jobs: - name: Restore cache uses: ./.github/actions/cache with: - job: php + job: client + language: php + spec: ${{ matrix.client.name }} - name: Cache ${{ matrix.client.name }} client id: cache @@ -164,6 +166,10 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: yarn generate php ${{ matrix.client.name }} + - name: Check diff with pushed client + if: steps.cache.outputs.cache-hit != 'true' + run: exit $(git status --porcelain ${{ matrix.client.folder }} | wc -l) + - name: Build ${{ matrix.client.name }} client if: steps.cache.outputs.cache-hit != 'true' run: yarn build:clients php ${{ matrix.client.name }} From 490bd273a695d6c36a269f40e31856bb0e279fc9 Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Tue, 1 Feb 2022 17:48:07 +0100 Subject: [PATCH 16/26] fix: update ci --- .github/workflows/check.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 25a8498400..c20ed2090b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -151,7 +151,9 @@ jobs: - name: Restore cache uses: ./.github/actions/cache with: - job: php + job: client + language: php + spec: ${{ matrix.client.name }} - name: Cache ${{ matrix.client.name }} client id: cache @@ -164,6 +166,10 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: yarn generate php ${{ matrix.client.name }} + - name: Check diff with pushed client + if: steps.cache.outputs.cache-hit != 'true' + run: exit $(git status --porcelain ${{ matrix.client.folder }} | wc -l) + - name: Build ${{ matrix.client.name }} client if: steps.cache.outputs.cache-hit != 'true' run: yarn build:clients php ${{ matrix.client.name }} From cc586f21ab95fff7ba73eefc87018b0f9062c2cc Mon Sep 17 00:00:00 2001 From: KLMcreator Date: Tue, 1 Feb 2022 18:50:41 +0100 Subject: [PATCH 17/26] fix: php cmd --- .../lib/Api/AbtestingApi.php | 22 +- .../lib/Api/AnalyticsApi.php | 979 +++++++++++------- .../lib/Api/PersonalizationApi.php | 16 +- .../lib/Api/QuerySuggestionsApi.php | 14 + .../lib/Api/RecommendApi.php | 2 + .../lib/Api/SearchApi.php | 467 +++++---- .../lib/Model/AssignUserIdParams.php | 296 ++++++ .../lib/Model/BatchAssignUserIdsParams.php | 329 ++++++ .../Model/BatchDictionaryEntriesRequest.php | 41 +- .../lib/Model/BatchParams.php | 292 ++++++ .../lib/Model/BatchWriteParams.php | 292 ++++++ .../lib/Model/BrowseResponse.php | 6 +- .../lib/Model/BuiltInOperation.php | 374 +++++++ .../lib/Model/DictionaryAction.php | 35 + .../lib/Model/DictionaryEntry.php | 42 +- .../lib/Model/DictionaryEntryState.php | 35 + .../lib/Model/GetObjectsParams.php | 292 ++++++ .../lib/Model/Hit.php | 416 ++++++++ .../lib/Model/Indice.php | 615 +++++++++++ .../lib/Model/Key.php | 586 +++++++++++ .../lib/Model/ListApiKeysResponse.php | 6 +- .../lib/Model/ListIndicesResponse.php | 6 +- .../lib/Model/MultipleGetObjectsParams.php | 359 +++++++ .../lib/Model/MultipleQueries.php | 42 +- .../lib/Model/MultipleQueriesParams.php | 324 ++++++ .../lib/Model/MultipleQueriesStrategy.php | 33 + .../lib/Model/MultipleQueriesType.php | 35 + .../lib/Model/OperationIndexParams.php | 357 +++++++ .../lib/Model/OperationType.php | 35 + .../Model/PersonalizationStrategyParams.php | 360 +++++++ .../lib/Model/QuerySuggestionsIndex.php | 6 +- .../lib/Model/RecommendHit.php | 463 +++++++++ .../lib/Model/RecommendHits.php | 6 +- .../lib/Model/RecommendationsResponse.php | 6 +- .../lib/Model/ScopeType.php | 36 + .../lib/Model/SearchHits.php | 6 +- .../lib/Model/SearchResponse.php | 6 +- .../lib/Model/SearchUserIdsParams.php | 386 +++++++ .../lib/Model/SearchUserIdsResponseHits.php | 14 +- .../lib/Model/SourceIndiceWithReplicas.php | 527 ++++++++++ .../lib/Model/SynonymHit.php | 46 +- .../lib/Model/SynonymType.php | 44 + .../lib/Model/UserId.php | 8 + scripts/formatter.sh | 2 +- 44 files changed, 7527 insertions(+), 737 deletions(-) create mode 100644 clients/algoliasearch-client-php/lib/Model/AssignUserIdParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BatchParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BatchWriteParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/BuiltInOperation.php create mode 100644 clients/algoliasearch-client-php/lib/Model/DictionaryAction.php create mode 100644 clients/algoliasearch-client-php/lib/Model/DictionaryEntryState.php create mode 100644 clients/algoliasearch-client-php/lib/Model/GetObjectsParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Hit.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Indice.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Key.php create mode 100644 clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/MultipleQueriesParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/MultipleQueriesStrategy.php create mode 100644 clients/algoliasearch-client-php/lib/Model/MultipleQueriesType.php create mode 100644 clients/algoliasearch-client-php/lib/Model/OperationIndexParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/OperationType.php create mode 100644 clients/algoliasearch-client-php/lib/Model/PersonalizationStrategyParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/RecommendHit.php create mode 100644 clients/algoliasearch-client-php/lib/Model/ScopeType.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SearchUserIdsParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SourceIndiceWithReplicas.php create mode 100644 clients/algoliasearch-client-php/lib/Model/SynonymType.php diff --git a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php index 2e9a51fc3b..cb9898adee 100644 --- a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php +++ b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php @@ -267,18 +267,24 @@ public function listABTests($offset = 0, $limit = 10) $headerParams = []; $httpBody = []; // query params - if (is_array($offset)) { - $offset = ObjectSerializer::serializeCollection($offset, '', true); - } if ($offset !== null) { - $queryParams['offset'] = $offset; + if ('form' === 'form' && is_array($offset)) { + foreach ($offset as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['offset'] = $offset; + } } // query params - if (is_array($limit)) { - $limit = ObjectSerializer::serializeCollection($limit, '', true); - } if ($limit !== null) { - $queryParams['limit'] = $limit; + if ('form' === 'form' && is_array($limit)) { + foreach ($limit as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['limit'] = $limit; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], diff --git a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php index 27530eed23..8df52cd75b 100644 --- a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php @@ -129,32 +129,44 @@ public function getAverageClickPosition($index, $startDate = null, $endDate = nu $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -212,32 +224,44 @@ public function getClickPositions($index, $startDate = null, $endDate = null, $t $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -295,32 +319,44 @@ public function getClickThroughRate($index, $startDate = null, $endDate = null, $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -378,32 +414,44 @@ public function getConversationRate($index, $startDate = null, $endDate = null, $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -461,32 +509,44 @@ public function getNoClickRate($index, $startDate = null, $endDate = null, $tags $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -544,32 +604,44 @@ public function getNoResultsRate($index, $startDate = null, $endDate = null, $ta $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -627,32 +699,44 @@ public function getSearchesCount($index, $startDate = null, $endDate = null, $ta $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -712,46 +796,64 @@ public function getSearchesNoClicks($index, $startDate = null, $endDate = null, $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($limit)) { - $limit = ObjectSerializer::serializeCollection($limit, '', true); - } if ($limit !== null) { - $queryParams['limit'] = $limit; + if ('form' === 'form' && is_array($limit)) { + foreach ($limit as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['limit'] = $limit; + } } // query params - if (is_array($offset)) { - $offset = ObjectSerializer::serializeCollection($offset, '', true); - } if ($offset !== null) { - $queryParams['offset'] = $offset; + if ('form' === 'form' && is_array($offset)) { + foreach ($offset as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['offset'] = $offset; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -811,46 +913,64 @@ public function getSearchesNoResults($index, $startDate = null, $endDate = null, $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($limit)) { - $limit = ObjectSerializer::serializeCollection($limit, '', true); - } if ($limit !== null) { - $queryParams['limit'] = $limit; + if ('form' === 'form' && is_array($limit)) { + foreach ($limit as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['limit'] = $limit; + } } // query params - if (is_array($offset)) { - $offset = ObjectSerializer::serializeCollection($offset, '', true); - } if ($offset !== null) { - $queryParams['offset'] = $offset; + if ('form' === 'form' && is_array($offset)) { + foreach ($offset as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['offset'] = $offset; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -898,11 +1018,14 @@ public function getStatus($index) $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -962,46 +1085,64 @@ public function getTopCountries($index, $startDate = null, $endDate = null, $lim $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($limit)) { - $limit = ObjectSerializer::serializeCollection($limit, '', true); - } if ($limit !== null) { - $queryParams['limit'] = $limit; + if ('form' === 'form' && is_array($limit)) { + foreach ($limit as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['limit'] = $limit; + } } // query params - if (is_array($offset)) { - $offset = ObjectSerializer::serializeCollection($offset, '', true); - } if ($offset !== null) { - $queryParams['offset'] = $offset; + if ('form' === 'form' && is_array($offset)) { + foreach ($offset as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['offset'] = $offset; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -1062,53 +1203,74 @@ public function getTopFilterAttributes($index, $search = null, $startDate = null $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($search)) { - $search = ObjectSerializer::serializeCollection($search, '', true); - } if ($search !== null) { - $queryParams['search'] = $search; + if ('form' === 'form' && is_array($search)) { + foreach ($search as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['search'] = $search; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($limit)) { - $limit = ObjectSerializer::serializeCollection($limit, '', true); - } if ($limit !== null) { - $queryParams['limit'] = $limit; + if ('form' === 'form' && is_array($limit)) { + foreach ($limit as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['limit'] = $limit; + } } // query params - if (is_array($offset)) { - $offset = ObjectSerializer::serializeCollection($offset, '', true); - } if ($offset !== null) { - $queryParams['offset'] = $offset; + if ('form' === 'form' && is_array($offset)) { + foreach ($offset as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['offset'] = $offset; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -1176,53 +1338,74 @@ public function getTopFilterForAttribute($attribute, $index, $search = null, $st $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($search)) { - $search = ObjectSerializer::serializeCollection($search, '', true); - } if ($search !== null) { - $queryParams['search'] = $search; + if ('form' === 'form' && is_array($search)) { + foreach ($search as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['search'] = $search; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($limit)) { - $limit = ObjectSerializer::serializeCollection($limit, '', true); - } if ($limit !== null) { - $queryParams['limit'] = $limit; + if ('form' === 'form' && is_array($limit)) { + foreach ($limit as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['limit'] = $limit; + } } // query params - if (is_array($offset)) { - $offset = ObjectSerializer::serializeCollection($offset, '', true); - } if ($offset !== null) { - $queryParams['offset'] = $offset; + if ('form' === 'form' && is_array($offset)) { + foreach ($offset as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['offset'] = $offset; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } // path params if ($attribute !== null) { @@ -1291,53 +1474,74 @@ public function getTopFiltersNoResults($index, $search = null, $startDate = null $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($search)) { - $search = ObjectSerializer::serializeCollection($search, '', true); - } if ($search !== null) { - $queryParams['search'] = $search; + if ('form' === 'form' && is_array($search)) { + foreach ($search as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['search'] = $search; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($limit)) { - $limit = ObjectSerializer::serializeCollection($limit, '', true); - } if ($limit !== null) { - $queryParams['limit'] = $limit; + if ('form' === 'form' && is_array($limit)) { + foreach ($limit as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['limit'] = $limit; + } } // query params - if (is_array($offset)) { - $offset = ObjectSerializer::serializeCollection($offset, '', true); - } if ($offset !== null) { - $queryParams['offset'] = $offset; + if ('form' === 'form' && is_array($offset)) { + foreach ($offset as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['offset'] = $offset; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -1399,60 +1603,84 @@ public function getTopHits($index, $search = null, $clickAnalytics = false, $sta $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($search)) { - $search = ObjectSerializer::serializeCollection($search, '', true); - } if ($search !== null) { - $queryParams['search'] = $search; + if ('form' === 'form' && is_array($search)) { + foreach ($search as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['search'] = $search; + } } // query params - if (is_array($clickAnalytics)) { - $clickAnalytics = ObjectSerializer::serializeCollection($clickAnalytics, '', true); - } if ($clickAnalytics !== null) { - $queryParams['clickAnalytics'] = $clickAnalytics; + if ('form' === 'form' && is_array($clickAnalytics)) { + foreach ($clickAnalytics as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['clickAnalytics'] = $clickAnalytics; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($limit)) { - $limit = ObjectSerializer::serializeCollection($limit, '', true); - } if ($limit !== null) { - $queryParams['limit'] = $limit; + if ('form' === 'form' && is_array($limit)) { + foreach ($limit as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['limit'] = $limit; + } } // query params - if (is_array($offset)) { - $offset = ObjectSerializer::serializeCollection($offset, '', true); - } if ($offset !== null) { - $queryParams['offset'] = $offset; + if ('form' === 'form' && is_array($offset)) { + foreach ($offset as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['offset'] = $offset; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -1515,67 +1743,94 @@ public function getTopSearches($index, $clickAnalytics = false, $startDate = nul $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($clickAnalytics)) { - $clickAnalytics = ObjectSerializer::serializeCollection($clickAnalytics, '', true); - } if ($clickAnalytics !== null) { - $queryParams['clickAnalytics'] = $clickAnalytics; + if ('form' === 'form' && is_array($clickAnalytics)) { + foreach ($clickAnalytics as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['clickAnalytics'] = $clickAnalytics; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($orderBy)) { - $orderBy = ObjectSerializer::serializeCollection($orderBy, '', true); - } if ($orderBy !== null) { - $queryParams['orderBy'] = $orderBy; + if ('form' === 'form' && is_array($orderBy)) { + foreach ($orderBy as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['orderBy'] = $orderBy; + } } // query params - if (is_array($direction)) { - $direction = ObjectSerializer::serializeCollection($direction, '', true); - } if ($direction !== null) { - $queryParams['direction'] = $direction; + if ('form' === 'form' && is_array($direction)) { + foreach ($direction as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['direction'] = $direction; + } } // query params - if (is_array($limit)) { - $limit = ObjectSerializer::serializeCollection($limit, '', true); - } if ($limit !== null) { - $queryParams['limit'] = $limit; + if ('form' === 'form' && is_array($limit)) { + foreach ($limit as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['limit'] = $limit; + } } // query params - if (is_array($offset)) { - $offset = ObjectSerializer::serializeCollection($offset, '', true); - } if ($offset !== null) { - $queryParams['offset'] = $offset; + if ('form' === 'form' && is_array($offset)) { + foreach ($offset as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['offset'] = $offset; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -1633,32 +1888,44 @@ public function getUsersCount($index, $startDate = null, $endDate = null, $tags $headerParams = []; $httpBody = []; // query params - if (is_array($index)) { - $index = ObjectSerializer::serializeCollection($index, '', true); - } if ($index !== null) { - $queryParams['index'] = $index; + if ('form' === 'form' && is_array($index)) { + foreach ($index as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['index'] = $index; + } } // query params - if (is_array($startDate)) { - $startDate = ObjectSerializer::serializeCollection($startDate, '', true); - } if ($startDate !== null) { - $queryParams['startDate'] = $startDate; + if ('form' === 'form' && is_array($startDate)) { + foreach ($startDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['startDate'] = $startDate; + } } // query params - if (is_array($endDate)) { - $endDate = ObjectSerializer::serializeCollection($endDate, '', true); - } if ($endDate !== null) { - $queryParams['endDate'] = $endDate; + if ('form' === 'form' && is_array($endDate)) { + foreach ($endDate as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['endDate'] = $endDate; + } } // query params - if (is_array($tags)) { - $tags = ObjectSerializer::serializeCollection($tags, '', true); - } if ($tags !== null) { - $queryParams['tags'] = $tags; + if ('form' === 'form' && is_array($tags)) { + foreach ($tags as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['tags'] = $tags; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], diff --git a/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php b/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php index 00979a65df..f20762cd3a 100644 --- a/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php +++ b/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php @@ -155,7 +155,7 @@ public function deleteUserProfile($userToken) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\PersonalizationStrategyObject|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\PersonalizationStrategyParams|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getPersonalizationStrategy() { @@ -241,19 +241,19 @@ public function getUserTokenProfile($userToken) * * Set a new personalization strategy. * - * @param \Algolia\AlgoliaSearch\Model\PersonalizationStrategyObject $personalizationStrategyObject personalizationStrategyObject (required) + * @param \Algolia\AlgoliaSearch\Model\PersonalizationStrategyParams $personalizationStrategyParams personalizationStrategyParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * * @return \Algolia\AlgoliaSearch\Model\SetPersonalizationStrategyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ - public function setPersonalizationStrategy($personalizationStrategyObject) + public function setPersonalizationStrategy($personalizationStrategyParams) { - // verify the required parameter 'personalizationStrategyObject' is set - if ($personalizationStrategyObject === null || (is_array($personalizationStrategyObject) && count($personalizationStrategyObject) === 0)) { + // verify the required parameter 'personalizationStrategyParams' is set + if ($personalizationStrategyParams === null || (is_array($personalizationStrategyParams) && count($personalizationStrategyParams) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $personalizationStrategyObject when calling setPersonalizationStrategy' + 'Missing the required parameter $personalizationStrategyParams when calling setPersonalizationStrategy' ); } @@ -265,8 +265,8 @@ public function setPersonalizationStrategy($personalizationStrategyObject) ['application/json'], ['application/json'] ); - if (isset($personalizationStrategyObject)) { - $httpBody = $personalizationStrategyObject; + if (isset($personalizationStrategyParams)) { + $httpBody = $personalizationStrategyParams; } $defaultHeaders = []; diff --git a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php index 6c6cce5669..edf2293756 100644 --- a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php @@ -96,6 +96,8 @@ public function getClientConfig() /** * Operation createConfig * + * Create a configuration of a Query Suggestions index. + * * @param \Algolia\AlgoliaSearch\Model\QuerySuggestionsIndexWithIndexParam $querySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response @@ -142,6 +144,8 @@ public function createConfig($querySuggestionsIndexWithIndexParam) /** * Operation deleteConfig * + * Delete a configuration of a Query Suggestion's index. + * * @param string $indexName The index in which to perform the request. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response @@ -193,6 +197,8 @@ public function deleteConfig($indexName) /** * Operation getAllConfigs * + * Get all the configurations of Query Suggestions. + * * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -228,6 +234,8 @@ public function getAllConfigs() /** * Operation getConfig * + * Get the configuration of a single Query Suggestions index. + * * @param string $indexName The index in which to perform the request. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response @@ -279,6 +287,8 @@ public function getConfig($indexName) /** * Operation getConfigStatus * + * Get the status of a Query Suggestion's index. + * * @param string $indexName The index in which to perform the request. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response @@ -330,6 +340,8 @@ public function getConfigStatus($indexName) /** * Operation getLogFile * + * Get the log file of the last build of a single Query Suggestion index. + * * @param string $indexName The index in which to perform the request. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response @@ -381,6 +393,8 @@ public function getLogFile($indexName) /** * Operation updateConfig * + * Update the configuration of a Query Suggestions index. + * * @param string $indexName The index in which to perform the request. (required) * @param \Algolia\AlgoliaSearch\Model\QuerySuggestionsIndexParam $querySuggestionsIndexParam querySuggestionsIndexParam (required) * diff --git a/clients/algoliasearch-client-php/lib/Api/RecommendApi.php b/clients/algoliasearch-client-php/lib/Api/RecommendApi.php index a9305a9de4..0e8a133d42 100644 --- a/clients/algoliasearch-client-php/lib/Api/RecommendApi.php +++ b/clients/algoliasearch-client-php/lib/Api/RecommendApi.php @@ -95,6 +95,8 @@ public function getClientConfig() /** * Operation getRecommendations * + * Returns recommendations for a specific model and objectID. + * * @param \Algolia\AlgoliaSearch\Model\GetRecommendations $getRecommendations getRecommendations (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response diff --git a/clients/algoliasearch-client-php/lib/Api/SearchApi.php b/clients/algoliasearch-client-php/lib/Api/SearchApi.php index ed7473ff95..8ef3109bde 100644 --- a/clients/algoliasearch-client-php/lib/Api/SearchApi.php +++ b/clients/algoliasearch-client-php/lib/Api/SearchApi.php @@ -223,12 +223,14 @@ public function addOrUpdateObject($indexName, $objectID, $body) /** * Operation appendSource * + * Add a single source. + * * @param \Algolia\AlgoliaSearch\Model\Source $source The source to add. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse + * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function appendSource($source) { @@ -272,14 +274,14 @@ public function appendSource($source) * Assign or Move userID * * @param string $xAlgoliaUserID userID to assign. (required) - * @param \Algolia\AlgoliaSearch\Model\AssignUserIdObject $assignUserIdObject assignUserIdObject (required) + * @param \Algolia\AlgoliaSearch\Model\AssignUserIdParams $assignUserIdParams assignUserIdParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ - public function assignUserId($xAlgoliaUserID, $assignUserIdObject) + public function assignUserId($xAlgoliaUserID, $assignUserIdParams) { // verify the required parameter 'xAlgoliaUserID' is set if ($xAlgoliaUserID === null || (is_array($xAlgoliaUserID) && count($xAlgoliaUserID) === 0)) { @@ -291,10 +293,10 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdObject) throw new \InvalidArgumentException('invalid value for "xAlgoliaUserID" when calling SearchApi.assignUserId, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/.'); } - // verify the required parameter 'assignUserIdObject' is set - if ($assignUserIdObject === null || (is_array($assignUserIdObject) && count($assignUserIdObject) === 0)) { + // verify the required parameter 'assignUserIdParams' is set + if ($assignUserIdParams === null || (is_array($assignUserIdParams) && count($assignUserIdParams) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $assignUserIdObject when calling assignUserId' + 'Missing the required parameter $assignUserIdParams when calling assignUserId' ); } @@ -303,18 +305,21 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdObject) $headerParams = []; $httpBody = []; // query params - if (is_array($xAlgoliaUserID)) { - $xAlgoliaUserID = ObjectSerializer::serializeCollection($xAlgoliaUserID, '', true); - } if ($xAlgoliaUserID !== null) { - $queryParams['X-Algolia-User-ID'] = $xAlgoliaUserID; + if ('form' === 'form' && is_array($xAlgoliaUserID)) { + foreach ($xAlgoliaUserID as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['X-Algolia-User-ID'] = $xAlgoliaUserID; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); - if (isset($assignUserIdObject)) { - $httpBody = $assignUserIdObject; + if (isset($assignUserIdParams)) { + $httpBody = $assignUserIdParams; } $defaultHeaders = []; @@ -335,15 +340,17 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdObject) /** * Operation batch * + * Performs multiple write operations in a single API call. + * * @param string $indexName The index in which to perform the request. (required) - * @param \Algolia\AlgoliaSearch\Model\BatchWriteObject $batchWriteObject batchWriteObject (required) + * @param \Algolia\AlgoliaSearch\Model\BatchWriteParams $batchWriteParams batchWriteParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * * @return \Algolia\AlgoliaSearch\Model\BatchResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ - public function batch($indexName, $batchWriteObject) + public function batch($indexName, $batchWriteParams) { // verify the required parameter 'indexName' is set if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { @@ -351,10 +358,10 @@ public function batch($indexName, $batchWriteObject) 'Missing the required parameter $indexName when calling batch' ); } - // verify the required parameter 'batchWriteObject' is set - if ($batchWriteObject === null || (is_array($batchWriteObject) && count($batchWriteObject) === 0)) { + // verify the required parameter 'batchWriteParams' is set + if ($batchWriteParams === null || (is_array($batchWriteParams) && count($batchWriteParams) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $batchWriteObject when calling batch' + 'Missing the required parameter $batchWriteParams when calling batch' ); } @@ -374,8 +381,8 @@ public function batch($indexName, $batchWriteObject) ['application/json'], ['application/json'] ); - if (isset($batchWriteObject)) { - $httpBody = $batchWriteObject; + if (isset($batchWriteParams)) { + $httpBody = $batchWriteParams; } $defaultHeaders = []; @@ -399,14 +406,14 @@ public function batch($indexName, $batchWriteObject) * Batch assign userIDs * * @param string $xAlgoliaUserID userID to assign. (required) - * @param \Algolia\AlgoliaSearch\Model\BatchAssignUserIdsObject $batchAssignUserIdsObject batchAssignUserIdsObject (required) + * @param \Algolia\AlgoliaSearch\Model\BatchAssignUserIdsParams $batchAssignUserIdsParams batchAssignUserIdsParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ - public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject) + public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsParams) { // verify the required parameter 'xAlgoliaUserID' is set if ($xAlgoliaUserID === null || (is_array($xAlgoliaUserID) && count($xAlgoliaUserID) === 0)) { @@ -418,10 +425,10 @@ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject) throw new \InvalidArgumentException('invalid value for "xAlgoliaUserID" when calling SearchApi.batchAssignUserIds, must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/.'); } - // verify the required parameter 'batchAssignUserIdsObject' is set - if ($batchAssignUserIdsObject === null || (is_array($batchAssignUserIdsObject) && count($batchAssignUserIdsObject) === 0)) { + // verify the required parameter 'batchAssignUserIdsParams' is set + if ($batchAssignUserIdsParams === null || (is_array($batchAssignUserIdsParams) && count($batchAssignUserIdsParams) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $batchAssignUserIdsObject when calling batchAssignUserIds' + 'Missing the required parameter $batchAssignUserIdsParams when calling batchAssignUserIds' ); } @@ -430,18 +437,21 @@ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsObject) $headerParams = []; $httpBody = []; // query params - if (is_array($xAlgoliaUserID)) { - $xAlgoliaUserID = ObjectSerializer::serializeCollection($xAlgoliaUserID, '', true); - } if ($xAlgoliaUserID !== null) { - $queryParams['X-Algolia-User-ID'] = $xAlgoliaUserID; + if ('form' === 'form' && is_array($xAlgoliaUserID)) { + foreach ($xAlgoliaUserID as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['X-Algolia-User-ID'] = $xAlgoliaUserID; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); - if (isset($batchAssignUserIdsObject)) { - $httpBody = $batchAssignUserIdsObject; + if (isset($batchAssignUserIdsParams)) { + $httpBody = $batchAssignUserIdsParams; } $defaultHeaders = []; @@ -557,18 +567,24 @@ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearE $headerParams = []; $httpBody = []; // query params - if (is_array($forwardToReplicas)) { - $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); - } if ($forwardToReplicas !== null) { - $queryParams['forwardToReplicas'] = $forwardToReplicas; + if ('form' === 'form' && is_array($forwardToReplicas)) { + foreach ($forwardToReplicas as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } } // query params - if (is_array($clearExistingRules)) { - $clearExistingRules = ObjectSerializer::serializeCollection($clearExistingRules, '', true); - } if ($clearExistingRules !== null) { - $queryParams['clearExistingRules'] = $clearExistingRules; + if ('form' === 'form' && is_array($clearExistingRules)) { + foreach ($clearExistingRules as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['clearExistingRules'] = $clearExistingRules; + } } // path params if ($indexName !== null) { @@ -685,11 +701,14 @@ public function clearAllSynonyms($indexName, $forwardToReplicas = null) $headerParams = []; $httpBody = []; // query params - if (is_array($forwardToReplicas)) { - $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); - } if ($forwardToReplicas !== null) { - $queryParams['forwardToReplicas'] = $forwardToReplicas; + if ('form' === 'form' && is_array($forwardToReplicas)) { + foreach ($forwardToReplicas as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } } // path params if ($indexName !== null) { @@ -799,11 +818,14 @@ public function clearRules($indexName, $forwardToReplicas = null) $headerParams = []; $httpBody = []; // query params - if (is_array($forwardToReplicas)) { - $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); - } if ($forwardToReplicas !== null) { - $queryParams['forwardToReplicas'] = $forwardToReplicas; + if ('form' === 'form' && is_array($forwardToReplicas)) { + foreach ($forwardToReplicas as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } } // path params if ($indexName !== null) { @@ -1104,11 +1126,14 @@ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) $headerParams = []; $httpBody = []; // query params - if (is_array($forwardToReplicas)) { - $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); - } if ($forwardToReplicas !== null) { - $queryParams['forwardToReplicas'] = $forwardToReplicas; + if ('form' === 'form' && is_array($forwardToReplicas)) { + foreach ($forwardToReplicas as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } } // path params if ($indexName !== null) { @@ -1149,12 +1174,14 @@ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) /** * Operation deleteSource * + * Remove a single source. + * * @param string $source The IP range of the source. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\DeleteSourceResponse + * @return \Algolia\AlgoliaSearch\Model\DeleteSourceResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function deleteSource($source) { @@ -1231,11 +1258,14 @@ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) $headerParams = []; $httpBody = []; // query params - if (is_array($forwardToReplicas)) { - $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); - } if ($forwardToReplicas !== null) { - $queryParams['forwardToReplicas'] = $forwardToReplicas; + if ('form' === 'form' && is_array($forwardToReplicas)) { + foreach ($forwardToReplicas as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } } // path params if ($indexName !== null) { @@ -1283,7 +1313,7 @@ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\KeyObject|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Key|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getApiKey($key) { @@ -1403,9 +1433,11 @@ public function getDictionarySettings() /** * Operation getLogs * + * Return the lastest log entries. + * * @param int $offset First entry to retrieve (zero-based). Log entries are sorted by decreasing date, therefore 0 designates the most recent log entry. (optional, default to 0) * @param int $length Maximum number of entries to retrieve. The maximum allowed value is 1000. (optional, default to 10) - * @param string $indexName Index for which log entries should be retrieved. When omitted, log entries are retrieved across all indices. (optional) + * @param string $indexName Index for which log entries should be retrieved. When omitted, log entries are retrieved across all indices. (optional, default to 'null') * @param string $type Type of log entries to retrieve. When omitted, all log entries are retrieved. (optional, default to 'all') * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response @@ -1413,7 +1445,7 @@ public function getDictionarySettings() * * @return \Algolia\AlgoliaSearch\Model\GetLogsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ - public function getLogs($offset = 0, $length = 10, $indexName = null, $type = 'all') + public function getLogs($offset = 0, $length = 10, $indexName = 'null', $type = 'all') { if ($length !== null && $length > 1000) { throw new \InvalidArgumentException('invalid value for "$length" when calling SearchApi.getLogs, must be smaller than or equal to 1000.'); @@ -1424,32 +1456,44 @@ public function getLogs($offset = 0, $length = 10, $indexName = null, $type = 'a $headerParams = []; $httpBody = []; // query params - if (is_array($offset)) { - $offset = ObjectSerializer::serializeCollection($offset, '', true); - } if ($offset !== null) { - $queryParams['offset'] = $offset; + if ('form' === 'form' && is_array($offset)) { + foreach ($offset as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['offset'] = $offset; + } } // query params - if (is_array($length)) { - $length = ObjectSerializer::serializeCollection($length, '', true); - } if ($length !== null) { - $queryParams['length'] = $length; + if ('form' === 'form' && is_array($length)) { + foreach ($length as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['length'] = $length; + } } // query params - if (is_array($indexName)) { - $indexName = ObjectSerializer::serializeCollection($indexName, '', true); - } if ($indexName !== null) { - $queryParams['indexName'] = $indexName; + if ('form' === 'form' && is_array($indexName)) { + foreach ($indexName as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['indexName'] = $indexName; + } } // query params - if (is_array($type)) { - $type = ObjectSerializer::serializeCollection($type, '', true); - } if ($type !== null) { - $queryParams['type'] = $type; + if ('form' === 'form' && is_array($type)) { + foreach ($type as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['type'] = $type; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -1505,11 +1549,14 @@ public function getObject($indexName, $objectID, $attributesToRetrieve = null) $headerParams = []; $httpBody = []; // query params - if (is_array($attributesToRetrieve)) { - $attributesToRetrieve = ObjectSerializer::serializeCollection($attributesToRetrieve, 'csv', true); - } if ($attributesToRetrieve !== null) { - $queryParams['attributesToRetrieve'] = $attributesToRetrieve; + if ('form' === 'form' && is_array($attributesToRetrieve)) { + foreach ($attributesToRetrieve as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['attributesToRetrieve'] = $attributesToRetrieve; + } } // path params if ($indexName !== null) { @@ -1552,19 +1599,19 @@ public function getObject($indexName, $objectID, $attributesToRetrieve = null) * * Retrieve one or more objects. * - * @param \Algolia\AlgoliaSearch\Model\GetObjectsObject $getObjectsObject getObjectsObject (required) + * @param \Algolia\AlgoliaSearch\Model\GetObjectsParams $getObjectsParams getObjectsParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * * @return \Algolia\AlgoliaSearch\Model\GetObjectsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ - public function getObjects($getObjectsObject) + public function getObjects($getObjectsParams) { - // verify the required parameter 'getObjectsObject' is set - if ($getObjectsObject === null || (is_array($getObjectsObject) && count($getObjectsObject) === 0)) { + // verify the required parameter 'getObjectsParams' is set + if ($getObjectsParams === null || (is_array($getObjectsParams) && count($getObjectsParams) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $getObjectsObject when calling getObjects' + 'Missing the required parameter $getObjectsParams when calling getObjects' ); } @@ -1576,8 +1623,8 @@ public function getObjects($getObjectsObject) ['application/json'], ['application/json'] ); - if (isset($getObjectsObject)) { - $httpBody = $getObjectsObject; + if (isset($getObjectsParams)) { + $httpBody = $getObjectsParams; } $defaultHeaders = []; @@ -1666,6 +1713,8 @@ public function getRule($indexName, $objectID) /** * Operation getSettings * + * Retrieve settings of a given indexName. + * * @param string $indexName The index in which to perform the request. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response @@ -1717,11 +1766,13 @@ public function getSettings($indexName) /** * Operation getSources * + * List all allowed sources. + * * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\Source[] + * @return \Algolia\AlgoliaSearch\Model\Source[]|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function getSources() { @@ -1820,6 +1871,8 @@ public function getSynonym($indexName, $objectID) /** * Operation getTask * + * Check the current status of a given task. + * * @param string $indexName The index in which to perform the request. (required) * @param int $taskID Unique identifier of an task. Numeric value (up to 64bits) (required) * @@ -1995,11 +2048,14 @@ public function hasPendingMappings($getClusters = null) $headerParams = []; $httpBody = []; // query params - if (is_array($getClusters)) { - $getClusters = ObjectSerializer::serializeCollection($getClusters, '', true); - } if ($getClusters !== null) { - $queryParams['getClusters'] = $getClusters; + if ('form' === 'form' && is_array($getClusters)) { + foreach ($getClusters as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['getClusters'] = $getClusters; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -2114,11 +2170,14 @@ public function listIndices($page = null) $headerParams = []; $httpBody = []; // query params - if (is_array($page)) { - $page = ObjectSerializer::serializeCollection($page, '', true); - } if ($page !== null) { - $queryParams['page'] = $page; + if ('form' === 'form' && is_array($page)) { + foreach ($page as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['page'] = $page; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -2160,18 +2219,24 @@ public function listUserIds($page = null, $hitsPerPage = 100) $headerParams = []; $httpBody = []; // query params - if (is_array($page)) { - $page = ObjectSerializer::serializeCollection($page, '', true); - } if ($page !== null) { - $queryParams['page'] = $page; + if ('form' === 'form' && is_array($page)) { + foreach ($page as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['page'] = $page; + } } // query params - if (is_array($hitsPerPage)) { - $hitsPerPage = ObjectSerializer::serializeCollection($hitsPerPage, '', true); - } if ($hitsPerPage !== null) { - $queryParams['hitsPerPage'] = $hitsPerPage; + if ('form' === 'form' && is_array($hitsPerPage)) { + foreach ($hitsPerPage as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['hitsPerPage'] = $hitsPerPage; + } } $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -2196,19 +2261,21 @@ public function listUserIds($page = null, $hitsPerPage = 100) /** * Operation multipleBatch * - * @param \Algolia\AlgoliaSearch\Model\BatchObject $batchObject batchObject (required) + * Perform multiple write operations. + * + * @param \Algolia\AlgoliaSearch\Model\BatchParams $batchParams batchParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * * @return \Algolia\AlgoliaSearch\Model\MultipleBatchResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ - public function multipleBatch($batchObject) + public function multipleBatch($batchParams) { - // verify the required parameter 'batchObject' is set - if ($batchObject === null || (is_array($batchObject) && count($batchObject) === 0)) { + // verify the required parameter 'batchParams' is set + if ($batchParams === null || (is_array($batchParams) && count($batchParams) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $batchObject when calling multipleBatch' + 'Missing the required parameter $batchParams when calling multipleBatch' ); } @@ -2220,8 +2287,8 @@ public function multipleBatch($batchObject) ['application/json'], ['application/json'] ); - if (isset($batchObject)) { - $httpBody = $batchObject; + if (isset($batchParams)) { + $httpBody = $batchParams; } $defaultHeaders = []; @@ -2242,19 +2309,21 @@ public function multipleBatch($batchObject) /** * Operation multipleQueries * - * @param \Algolia\AlgoliaSearch\Model\MultipleQueriesObject $multipleQueriesObject multipleQueriesObject (required) + * Get search results for the given requests. + * + * @param \Algolia\AlgoliaSearch\Model\MultipleQueriesParams $multipleQueriesParams multipleQueriesParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * * @return \Algolia\AlgoliaSearch\Model\MultipleQueriesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ - public function multipleQueries($multipleQueriesObject) + public function multipleQueries($multipleQueriesParams) { - // verify the required parameter 'multipleQueriesObject' is set - if ($multipleQueriesObject === null || (is_array($multipleQueriesObject) && count($multipleQueriesObject) === 0)) { + // verify the required parameter 'multipleQueriesParams' is set + if ($multipleQueriesParams === null || (is_array($multipleQueriesParams) && count($multipleQueriesParams) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $multipleQueriesObject when calling multipleQueries' + 'Missing the required parameter $multipleQueriesParams when calling multipleQueries' ); } @@ -2266,8 +2335,8 @@ public function multipleQueries($multipleQueriesObject) ['application/json'], ['application/json'] ); - if (isset($multipleQueriesObject)) { - $httpBody = $multipleQueriesObject; + if (isset($multipleQueriesParams)) { + $httpBody = $multipleQueriesParams; } $defaultHeaders = []; @@ -2291,14 +2360,14 @@ public function multipleQueries($multipleQueriesObject) * Copy/move index. * * @param string $indexName The index in which to perform the request. (required) - * @param \Algolia\AlgoliaSearch\Model\OperationIndexObject $operationIndexObject operationIndexObject (required) + * @param \Algolia\AlgoliaSearch\Model\OperationIndexParams $operationIndexParams operationIndexParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ - public function operationIndex($indexName, $operationIndexObject) + public function operationIndex($indexName, $operationIndexParams) { // verify the required parameter 'indexName' is set if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { @@ -2306,10 +2375,10 @@ public function operationIndex($indexName, $operationIndexObject) 'Missing the required parameter $indexName when calling operationIndex' ); } - // verify the required parameter 'operationIndexObject' is set - if ($operationIndexObject === null || (is_array($operationIndexObject) && count($operationIndexObject) === 0)) { + // verify the required parameter 'operationIndexParams' is set + if ($operationIndexParams === null || (is_array($operationIndexParams) && count($operationIndexParams) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $operationIndexObject when calling operationIndex' + 'Missing the required parameter $operationIndexParams when calling operationIndex' ); } @@ -2329,8 +2398,8 @@ public function operationIndex($indexName, $operationIndexObject) ['application/json'], ['application/json'] ); - if (isset($operationIndexObject)) { - $httpBody = $operationIndexObject; + if (isset($operationIndexParams)) { + $httpBody = $operationIndexParams; } $defaultHeaders = []; @@ -2355,7 +2424,7 @@ public function operationIndex($indexName, $operationIndexObject) * * @param string $indexName The index in which to perform the request. (required) * @param string $objectID Unique identifier of an object. (required) - * @param array[] $oneOfStringBuildInOperation List of attributes to update. (required) + * @param array[] $oneOfStringBuiltInOperation List of attributes to update. (required) * @param bool $createIfNotExists Creates the record if it does not exist yet. (optional, default to true) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response @@ -2363,7 +2432,7 @@ public function operationIndex($indexName, $operationIndexObject) * * @return \Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ - public function partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOperation, $createIfNotExists = true) + public function partialUpdateObject($indexName, $objectID, $oneOfStringBuiltInOperation, $createIfNotExists = true) { // verify the required parameter 'indexName' is set if ($indexName === null || (is_array($indexName) && count($indexName) === 0)) { @@ -2377,10 +2446,10 @@ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOp 'Missing the required parameter $objectID when calling partialUpdateObject' ); } - // verify the required parameter 'oneOfStringBuildInOperation' is set - if ($oneOfStringBuildInOperation === null || (is_array($oneOfStringBuildInOperation) && count($oneOfStringBuildInOperation) === 0)) { + // verify the required parameter 'oneOfStringBuiltInOperation' is set + if ($oneOfStringBuiltInOperation === null || (is_array($oneOfStringBuiltInOperation) && count($oneOfStringBuiltInOperation) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $oneOfStringBuildInOperation when calling partialUpdateObject' + 'Missing the required parameter $oneOfStringBuiltInOperation when calling partialUpdateObject' ); } @@ -2389,11 +2458,14 @@ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOp $headerParams = []; $httpBody = []; // query params - if (is_array($createIfNotExists)) { - $createIfNotExists = ObjectSerializer::serializeCollection($createIfNotExists, '', true); - } if ($createIfNotExists !== null) { - $queryParams['createIfNotExists'] = $createIfNotExists; + if ('form' === 'form' && is_array($createIfNotExists)) { + foreach ($createIfNotExists as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['createIfNotExists'] = $createIfNotExists; + } } // path params if ($indexName !== null) { @@ -2415,8 +2487,8 @@ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuildInOp ['application/json'], ['application/json'] ); - if (isset($oneOfStringBuildInOperation)) { - $httpBody = $oneOfStringBuildInOperation; + if (isset($oneOfStringBuiltInOperation)) { + $httpBody = $oneOfStringBuiltInOperation; } $defaultHeaders = []; @@ -2493,12 +2565,14 @@ public function removeUserId($userID) /** * Operation replaceSources * + * Replace all allowed sources. + * * @param \Algolia\AlgoliaSearch\Model\Source[] $source The sources to allow. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\ReplaceSourceResponse + * @return \Algolia\AlgoliaSearch\Model\ReplaceSourceResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ public function replaceSources($source) { @@ -2592,8 +2666,10 @@ public function restoreApiKey($key) /** * Operation saveObject * + * Add an object to the index. + * * @param string $indexName The index in which to perform the request. (required) - * @param object $body The Algolia object. (required) + * @param object $body The Algolia record. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException @@ -2691,11 +2767,14 @@ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null $headerParams = []; $httpBody = []; // query params - if (is_array($forwardToReplicas)) { - $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); - } if ($forwardToReplicas !== null) { - $queryParams['forwardToReplicas'] = $forwardToReplicas; + if ('form' === 'form' && is_array($forwardToReplicas)) { + foreach ($forwardToReplicas as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } } // path params if ($indexName !== null) { @@ -2777,11 +2856,14 @@ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplic $headerParams = []; $httpBody = []; // query params - if (is_array($forwardToReplicas)) { - $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); - } if ($forwardToReplicas !== null) { - $queryParams['forwardToReplicas'] = $forwardToReplicas; + if ('form' === 'form' && is_array($forwardToReplicas)) { + foreach ($forwardToReplicas as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } } // path params if ($indexName !== null) { @@ -2857,18 +2939,24 @@ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, $headerParams = []; $httpBody = []; // query params - if (is_array($forwardToReplicas)) { - $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); - } if ($forwardToReplicas !== null) { - $queryParams['forwardToReplicas'] = $forwardToReplicas; + if ('form' === 'form' && is_array($forwardToReplicas)) { + foreach ($forwardToReplicas as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } } // query params - if (is_array($replaceExistingSynonyms)) { - $replaceExistingSynonyms = ObjectSerializer::serializeCollection($replaceExistingSynonyms, '', true); - } if ($replaceExistingSynonyms !== null) { - $queryParams['replaceExistingSynonyms'] = $replaceExistingSynonyms; + if ('form' === 'form' && is_array($replaceExistingSynonyms)) { + foreach ($replaceExistingSynonyms as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['replaceExistingSynonyms'] = $replaceExistingSynonyms; + } } // path params if ($indexName !== null) { @@ -2904,6 +2992,8 @@ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, /** * Operation search * + * Get search results. + * * @param string $indexName The index in which to perform the request. (required) * @param \Algolia\AlgoliaSearch\Model\SearchParams $searchParams searchParams (required) * @@ -3167,7 +3257,7 @@ public function searchRules($indexName, $searchRulesParams) * * @param string $indexName The index in which to perform the request. (required) * @param string $query Search for specific synonyms matching this string. (optional, default to '') - * @param string $type Only search for specific types of synonyms. (optional) + * @param \Algolia\AlgoliaSearch\Model\SynonymType $type Only search for specific types of synonyms. (optional) * @param int $page Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). (optional, default to 0) * @param int $hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) * @@ -3190,32 +3280,44 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $headerParams = []; $httpBody = []; // query params - if (is_array($query)) { - $query = ObjectSerializer::serializeCollection($query, '', true); - } if ($query !== null) { - $queryParams['query'] = $query; + if ('form' === 'form' && is_array($query)) { + foreach ($query as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['query'] = $query; + } } // query params - if (is_array($type)) { - $type = ObjectSerializer::serializeCollection($type, '', true); - } if ($type !== null) { - $queryParams['type'] = $type; + if ('form' === 'form' && is_array($type)) { + foreach ($type as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['type'] = $type; + } } // query params - if (is_array($page)) { - $page = ObjectSerializer::serializeCollection($page, '', true); - } if ($page !== null) { - $queryParams['page'] = $page; + if ('form' === 'form' && is_array($page)) { + foreach ($page as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['page'] = $page; + } } // query params - if (is_array($hitsPerPage)) { - $hitsPerPage = ObjectSerializer::serializeCollection($hitsPerPage, '', true); - } if ($hitsPerPage !== null) { - $queryParams['hitsPerPage'] = $hitsPerPage; + if ('form' === 'form' && is_array($hitsPerPage)) { + foreach ($hitsPerPage as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['hitsPerPage'] = $hitsPerPage; + } } // path params if ($indexName !== null) { @@ -3250,19 +3352,19 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, * * Search userID * - * @param \Algolia\AlgoliaSearch\Model\SearchUserIdsObject $searchUserIdsObject searchUserIdsObject (required) + * @param \Algolia\AlgoliaSearch\Model\SearchUserIdsParams $searchUserIdsParams searchUserIdsParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * * @return \Algolia\AlgoliaSearch\Model\SearchUserIdsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase */ - public function searchUserIds($searchUserIdsObject) + public function searchUserIds($searchUserIdsParams) { - // verify the required parameter 'searchUserIdsObject' is set - if ($searchUserIdsObject === null || (is_array($searchUserIdsObject) && count($searchUserIdsObject) === 0)) { + // verify the required parameter 'searchUserIdsParams' is set + if ($searchUserIdsParams === null || (is_array($searchUserIdsParams) && count($searchUserIdsParams) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $searchUserIdsObject when calling searchUserIds' + 'Missing the required parameter $searchUserIdsParams when calling searchUserIds' ); } @@ -3274,8 +3376,8 @@ public function searchUserIds($searchUserIdsObject) ['application/json'], ['application/json'] ); - if (isset($searchUserIdsObject)) { - $httpBody = $searchUserIdsObject; + if (isset($searchUserIdsParams)) { + $httpBody = $searchUserIdsParams; } $defaultHeaders = []; @@ -3344,6 +3446,8 @@ public function setDictionarySettings($dictionarySettingsRequest) /** * Operation setSettings * + * Update settings of a given indexName. + * * @param string $indexName The index in which to perform the request. (required) * @param \Algolia\AlgoliaSearch\Model\IndexSettings $indexSettings indexSettings (required) * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) @@ -3373,11 +3477,14 @@ public function setSettings($indexName, $indexSettings, $forwardToReplicas = nul $headerParams = []; $httpBody = []; // query params - if (is_array($forwardToReplicas)) { - $forwardToReplicas = ObjectSerializer::serializeCollection($forwardToReplicas, '', true); - } if ($forwardToReplicas !== null) { - $queryParams['forwardToReplicas'] = $forwardToReplicas; + if ('form' === 'form' && is_array($forwardToReplicas)) { + foreach ($forwardToReplicas as $key => $value) { + $queryParams[$key] = $value; + } + } else { + $queryParams['forwardToReplicas'] = $forwardToReplicas; + } } // path params if ($indexName !== null) { diff --git a/clients/algoliasearch-client-php/lib/Model/AssignUserIdParams.php b/clients/algoliasearch-client-php/lib/Model/AssignUserIdParams.php new file mode 100644 index 0000000000..fe765a8d14 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/AssignUserIdParams.php @@ -0,0 +1,296 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AssignUserIdParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'assignUserIdParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cluster' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cluster' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cluster' => 'cluster', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cluster' => 'setCluster', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cluster' => 'getCluster', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['cluster'] = $data['cluster'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['cluster'] === null) { + $invalidProperties[] = "'cluster' 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 cluster + * + * @return string + */ + public function getCluster() + { + return $this->container['cluster']; + } + + /** + * Sets cluster + * + * @param string $cluster name of the cluster + * + * @return self + */ + public function setCluster($cluster) + { + $this->container['cluster'] = $cluster; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsParams.php b/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsParams.php new file mode 100644 index 0000000000..369baf5c96 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsParams.php @@ -0,0 +1,329 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BatchAssignUserIdsParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'batchAssignUserIdsParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'cluster' => 'string', + 'users' => 'string[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'cluster' => null, + 'users' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'cluster' => 'cluster', + 'users' => 'users', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cluster' => 'setCluster', + 'users' => 'setUsers', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cluster' => 'getCluster', + 'users' => 'getUsers', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['cluster'] = $data['cluster'] ?? null; + $this->container['users'] = $data['users'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['cluster'] === null) { + $invalidProperties[] = "'cluster' can't be null"; + } + if ($this->container['users'] === null) { + $invalidProperties[] = "'users' 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 cluster + * + * @return string + */ + public function getCluster() + { + return $this->container['cluster']; + } + + /** + * Sets cluster + * + * @param string $cluster name of the cluster + * + * @return self + */ + public function setCluster($cluster) + { + $this->container['cluster'] = $cluster; + + return $this; + } + + /** + * Gets users + * + * @return string[] + */ + public function getUsers() + { + return $this->container['users']; + } + + /** + * Sets users + * + * @param string[] $users userIDs to assign. Note you cannot move users with this method. + * + * @return self + */ + public function setUsers($users) + { + $this->container['users'] = $users; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php b/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php index 945c27dea7..79d0b964f7 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php +++ b/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php @@ -31,7 +31,7 @@ class BatchDictionaryEntriesRequest implements ModelInterface, ArrayAccess, \Jso * @var string[] */ protected static $openAPITypes = [ - 'action' => 'string', + 'action' => '\Algolia\AlgoliaSearch\Model\DictionaryAction', 'body' => '\Algolia\AlgoliaSearch\Model\DictionaryEntry', ]; @@ -139,22 +139,6 @@ public function getModelName() return self::$openAPIModelName; } - const ACTION_ADD_ENTRY = 'addEntry'; - const ACTION_DELETE_ENTRY = 'deleteEntry'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getActionAllowableValues() - { - return [ - self::ACTION_ADD_ENTRY, - self::ACTION_DELETE_ENTRY, - ]; - } - /** * Associative array for storing property values * @@ -186,15 +170,6 @@ public function listInvalidProperties() if ($this->container['action'] === null) { $invalidProperties[] = "'action' can't be null"; } - $allowedValues = $this->getActionAllowableValues(); - if (!is_null($this->container['action']) && !in_array($this->container['action'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'action', must be one of '%s'", - $this->container['action'], - implode("', '", $allowedValues) - ); - } - if ($this->container['body'] === null) { $invalidProperties[] = "'body' can't be null"; } @@ -216,7 +191,7 @@ public function valid() /** * Gets action * - * @return string + * @return \Algolia\AlgoliaSearch\Model\DictionaryAction */ public function getAction() { @@ -226,22 +201,12 @@ public function getAction() /** * Sets action * - * @param string $action actions to perform + * @param \Algolia\AlgoliaSearch\Model\DictionaryAction $action action * * @return self */ public function setAction($action) { - $allowedValues = $this->getActionAllowableValues(); - if (!in_array($action, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'action', must be one of '%s'", - $action, - implode("', '", $allowedValues) - ) - ); - } $this->container['action'] = $action; return $this; diff --git a/clients/algoliasearch-client-php/lib/Model/BatchParams.php b/clients/algoliasearch-client-php/lib/Model/BatchParams.php new file mode 100644 index 0000000000..40e2d3bf9f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BatchParams.php @@ -0,0 +1,292 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BatchParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'batchParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'requests' => '\Algolia\AlgoliaSearch\Model\Operation[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'requests' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'requests' => 'requests', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['requests'] = $data['requests'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 requests + * + * @return \Algolia\AlgoliaSearch\Model\Operation[]|null + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\Operation[]|null $requests requests + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/BatchWriteParams.php b/clients/algoliasearch-client-php/lib/Model/BatchWriteParams.php new file mode 100644 index 0000000000..613f1d25fc --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BatchWriteParams.php @@ -0,0 +1,292 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BatchWriteParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'batchWriteParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'requests' => '\Algolia\AlgoliaSearch\Model\Operation[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'requests' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'requests' => 'requests', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['requests'] = $data['requests'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 requests + * + * @return \Algolia\AlgoliaSearch\Model\Operation[]|null + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\Operation[]|null $requests requests + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php b/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php index fd2be587ff..7e49b5f85a 100644 --- a/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/BrowseResponse.php @@ -55,7 +55,7 @@ class BrowseResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'queryAfterRemoval' => 'string', 'serverUsed' => 'string', 'userData' => 'object', - 'hits' => '\Algolia\AlgoliaSearch\Model\Record[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\Hit[]', 'cursor' => 'string', ]; @@ -946,7 +946,7 @@ public function setUserData($userData) /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\Record[] + * @return \Algolia\AlgoliaSearch\Model\Hit[] */ public function getHits() { @@ -956,7 +956,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\Record[] $hits hits + * @param \Algolia\AlgoliaSearch\Model\Hit[] $hits hits * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/BuiltInOperation.php b/clients/algoliasearch-client-php/lib/Model/BuiltInOperation.php new file mode 100644 index 0000000000..ee3de71f05 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/BuiltInOperation.php @@ -0,0 +1,374 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BuiltInOperation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'builtInOperation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => 'string', + 'value' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'value' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => '_operation', + 'value' => 'value', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const OPERATION_INCREMENT = 'Increment'; + const OPERATION_DECREMENT = 'Decrement'; + const OPERATION_ADD = 'Add'; + const OPERATION_REMOVE = 'Remove'; + const OPERATION_ADD_UNIQUE = 'AddUnique'; + const OPERATION_INCREMENT_FROM = 'IncrementFrom'; + const OPERATION_INCREMENT_SET = 'IncrementSet'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getOperationAllowableValues() + { + return [ + self::OPERATION_INCREMENT, + self::OPERATION_DECREMENT, + self::OPERATION_ADD, + self::OPERATION_REMOVE, + self::OPERATION_ADD_UNIQUE, + self::OPERATION_INCREMENT_FROM, + self::OPERATION_INCREMENT_SET, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['operation'] = $data['operation'] ?? null; + $this->container['value'] = $data['value'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' can't be null"; + } + $allowedValues = $this->getOperationAllowableValues(); + if (!is_null($this->container['operation']) && !in_array($this->container['operation'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'operation', must be one of '%s'", + $this->container['operation'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' 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 operation + * + * @return string + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param string $operation the operation to apply on the attribute + * + * @return self + */ + public function setOperation($operation) + { + $allowedValues = $this->getOperationAllowableValues(); + if (!in_array($operation, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'operation', must be one of '%s'", + $operation, + implode("', '", $allowedValues) + ) + ); + } + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/DictionaryAction.php b/clients/algoliasearch-client-php/lib/Model/DictionaryAction.php new file mode 100644 index 0000000000..e268c97f93 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/DictionaryAction.php @@ -0,0 +1,35 @@ + 'string', 'words' => 'string[]', 'decomposition' => 'string[]', - 'state' => 'string', + 'state' => '\Algolia\AlgoliaSearch\Model\DictionaryEntryState', ]; /** @@ -161,22 +161,6 @@ public function getModelName() return self::$openAPIModelName; } - const STATE_ENABLED = 'enabled'; - const STATE_DISABLED = 'disabled'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStateAllowableValues() - { - return [ - self::STATE_ENABLED, - self::STATE_DISABLED, - ]; - } - /** * Associative array for storing property values * @@ -197,7 +181,7 @@ public function __construct(array $data = null) $this->container['word'] = $data['word'] ?? null; $this->container['words'] = $data['words'] ?? null; $this->container['decomposition'] = $data['decomposition'] ?? null; - $this->container['state'] = $data['state'] ?? 'enabled'; + $this->container['state'] = $data['state'] ?? null; } /** @@ -215,14 +199,6 @@ public function listInvalidProperties() if ($this->container['language'] === null) { $invalidProperties[] = "'language' can't be null"; } - $allowedValues = $this->getStateAllowableValues(); - if (!is_null($this->container['state']) && !in_array($this->container['state'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'state', must be one of '%s'", - $this->container['state'], - implode("', '", $allowedValues) - ); - } return $invalidProperties; } @@ -361,7 +337,7 @@ public function setDecomposition($decomposition) /** * Gets state * - * @return string|null + * @return \Algolia\AlgoliaSearch\Model\DictionaryEntryState|null */ public function getState() { @@ -371,22 +347,12 @@ public function getState() /** * Sets state * - * @param string|null $state the state of the dictionary entry + * @param \Algolia\AlgoliaSearch\Model\DictionaryEntryState|null $state state * * @return self */ public function setState($state) { - $allowedValues = $this->getStateAllowableValues(); - if (!is_null($state) && !in_array($state, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'state', must be one of '%s'", - $state, - implode("', '", $allowedValues) - ) - ); - } $this->container['state'] = $state; return $this; diff --git a/clients/algoliasearch-client-php/lib/Model/DictionaryEntryState.php b/clients/algoliasearch-client-php/lib/Model/DictionaryEntryState.php new file mode 100644 index 0000000000..823b81a3c2 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/DictionaryEntryState.php @@ -0,0 +1,35 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetObjectsParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'getObjectsParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'requests' => '\Algolia\AlgoliaSearch\Model\MultipleGetObjectsParams[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'requests' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'requests' => 'requests', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['requests'] = $data['requests'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 requests + * + * @return \Algolia\AlgoliaSearch\Model\MultipleGetObjectsParams[]|null + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\MultipleGetObjectsParams[]|null $requests requests + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Hit.php b/clients/algoliasearch-client-php/lib/Model/Hit.php new file mode 100644 index 0000000000..e3474e7d96 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Hit.php @@ -0,0 +1,416 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Hit implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'hit'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'objectID' => 'string', + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\HighlightResult', + 'snippetResult' => '\Algolia\AlgoliaSearch\Model\SnippetResult', + 'rankingInfo' => '\Algolia\AlgoliaSearch\Model\RankingInfo', + 'distinctSeqID' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'objectID' => null, + 'highlightResult' => null, + 'snippetResult' => null, + 'rankingInfo' => null, + 'distinctSeqID' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'objectID' => 'objectID', + 'highlightResult' => '_highlightResult', + 'snippetResult' => '_snippetResult', + 'rankingInfo' => '_rankingInfo', + 'distinctSeqID' => '_distinctSeqID', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'highlightResult' => 'setHighlightResult', + 'snippetResult' => 'setSnippetResult', + 'rankingInfo' => 'setRankingInfo', + 'distinctSeqID' => 'setDistinctSeqID', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'highlightResult' => 'getHighlightResult', + 'snippetResult' => 'getSnippetResult', + 'rankingInfo' => 'getRankingInfo', + 'distinctSeqID' => 'getDistinctSeqID', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['objectID'] = $data['objectID'] ?? null; + $this->container['highlightResult'] = $data['highlightResult'] ?? null; + $this->container['snippetResult'] = $data['snippetResult'] ?? null; + $this->container['rankingInfo'] = $data['rankingInfo'] ?? null; + $this->container['distinctSeqID'] = $data['distinctSeqID'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' 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 objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets highlightResult + * + * @return \Algolia\AlgoliaSearch\Model\HighlightResult|null + */ + public function getHighlightResult() + { + return $this->container['highlightResult']; + } + + /** + * Sets highlightResult + * + * @param \Algolia\AlgoliaSearch\Model\HighlightResult|null $highlightResult highlightResult + * + * @return self + */ + public function setHighlightResult($highlightResult) + { + $this->container['highlightResult'] = $highlightResult; + + return $this; + } + + /** + * Gets snippetResult + * + * @return \Algolia\AlgoliaSearch\Model\SnippetResult|null + */ + public function getSnippetResult() + { + return $this->container['snippetResult']; + } + + /** + * Sets snippetResult + * + * @param \Algolia\AlgoliaSearch\Model\SnippetResult|null $snippetResult snippetResult + * + * @return self + */ + public function setSnippetResult($snippetResult) + { + $this->container['snippetResult'] = $snippetResult; + + return $this; + } + + /** + * Gets rankingInfo + * + * @return \Algolia\AlgoliaSearch\Model\RankingInfo|null + */ + public function getRankingInfo() + { + return $this->container['rankingInfo']; + } + + /** + * Sets rankingInfo + * + * @param \Algolia\AlgoliaSearch\Model\RankingInfo|null $rankingInfo rankingInfo + * + * @return self + */ + public function setRankingInfo($rankingInfo) + { + $this->container['rankingInfo'] = $rankingInfo; + + return $this; + } + + /** + * Gets distinctSeqID + * + * @return int|null + */ + public function getDistinctSeqID() + { + return $this->container['distinctSeqID']; + } + + /** + * Sets distinctSeqID + * + * @param int|null $distinctSeqID distinctSeqID + * + * @return self + */ + public function setDistinctSeqID($distinctSeqID) + { + $this->container['distinctSeqID'] = $distinctSeqID; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Indice.php b/clients/algoliasearch-client-php/lib/Model/Indice.php new file mode 100644 index 0000000000..d1b4f3d3ee --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Indice.php @@ -0,0 +1,615 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Indice implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'indice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => '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[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '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 openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'createdAt' => 'createdAt', + 'updatedAt' => 'updatedAt', + 'entries' => 'entries', + 'dataSize' => 'dataSize', + 'fileSize' => 'fileSize', + 'lastBuildTimeS' => 'lastBuildTimeS', + 'numberOfPendingTask' => 'numberOfPendingTask', + 'pendingTask' => 'pendingTask', + 'primary' => 'primary', + 'replicas' => 'replicas', + ]; + + /** + * 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 where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['name'] = $data['name'] ?? null; + $this->container['createdAt'] = $data['createdAt'] ?? null; + $this->container['updatedAt'] = $data['updatedAt'] ?? null; + $this->container['entries'] = $data['entries'] ?? null; + $this->container['dataSize'] = $data['dataSize'] ?? null; + $this->container['fileSize'] = $data['fileSize'] ?? null; + $this->container['lastBuildTimeS'] = $data['lastBuildTimeS'] ?? null; + $this->container['numberOfPendingTask'] = $data['numberOfPendingTask'] ?? null; + $this->container['pendingTask'] = $data['pendingTask'] ?? null; + $this->container['primary'] = $data['primary'] ?? null; + $this->container['replicas'] = $data['replicas'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' can't be null"; + } + if ($this->container['entries'] === null) { + $invalidProperties[] = "'entries' can't be null"; + } + if ($this->container['dataSize'] === null) { + $invalidProperties[] = "'dataSize' can't be null"; + } + if ($this->container['fileSize'] === null) { + $invalidProperties[] = "'fileSize' can't be null"; + } + if ($this->container['lastBuildTimeS'] === null) { + $invalidProperties[] = "'lastBuildTimeS' can't be null"; + } + if ($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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Key.php b/clients/algoliasearch-client-php/lib/Model/Key.php new file mode 100644 index 0000000000..041c27c6a8 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Key.php @@ -0,0 +1,586 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class Key implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'key'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'acl' => 'string[]', + 'description' => 'string', + 'indexes' => 'string[]', + 'maxHitsPerQuery' => 'int', + 'maxQueriesPerIPPerHour' => 'int', + 'queryParameters' => 'string', + 'referers' => 'string[]', + 'validity' => 'int', + 'createdAt' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'acl' => null, + 'description' => null, + 'indexes' => null, + 'maxHitsPerQuery' => null, + 'maxQueriesPerIPPerHour' => null, + 'queryParameters' => null, + 'referers' => null, + 'validity' => null, + 'createdAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'acl' => 'acl', + 'description' => 'description', + 'indexes' => 'indexes', + 'maxHitsPerQuery' => 'maxHitsPerQuery', + 'maxQueriesPerIPPerHour' => 'maxQueriesPerIPPerHour', + 'queryParameters' => 'queryParameters', + 'referers' => 'referers', + 'validity' => 'validity', + 'createdAt' => 'createdAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acl' => 'setAcl', + 'description' => 'setDescription', + 'indexes' => 'setIndexes', + 'maxHitsPerQuery' => 'setMaxHitsPerQuery', + 'maxQueriesPerIPPerHour' => 'setMaxQueriesPerIPPerHour', + 'queryParameters' => 'setQueryParameters', + 'referers' => 'setReferers', + 'validity' => 'setValidity', + 'createdAt' => 'setCreatedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acl' => 'getAcl', + 'description' => 'getDescription', + 'indexes' => 'getIndexes', + 'maxHitsPerQuery' => 'getMaxHitsPerQuery', + 'maxQueriesPerIPPerHour' => 'getMaxQueriesPerIPPerHour', + 'queryParameters' => 'getQueryParameters', + 'referers' => 'getReferers', + 'validity' => 'getValidity', + 'createdAt' => 'getCreatedAt', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const ACL_ADD_OBJECT = 'addObject'; + const ACL_ANALYTICS = 'analytics'; + const ACL_BROWSE = 'browse'; + const ACL_DELETE_OBJECT = 'deleteObject'; + const ACL_DELETE_INDEX = 'deleteIndex'; + const ACL_EDIT_SETTINGS = 'editSettings'; + const ACL_LIST_INDEXES = 'listIndexes'; + const ACL_LOGS = 'logs'; + const ACL_PERSONALIZATION = 'personalization'; + const ACL_RECOMMENDATION = 'recommendation'; + const ACL_SEARCH = 'search'; + const ACL_SEE_UNRETRIEVABLE_ATTRIBUTES = 'seeUnretrievableAttributes'; + const ACL_SETTINGS = 'settings'; + const ACL_USAGE = 'usage'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAclAllowableValues() + { + return [ + self::ACL_ADD_OBJECT, + self::ACL_ANALYTICS, + self::ACL_BROWSE, + self::ACL_DELETE_OBJECT, + self::ACL_DELETE_INDEX, + self::ACL_EDIT_SETTINGS, + self::ACL_LIST_INDEXES, + self::ACL_LOGS, + self::ACL_PERSONALIZATION, + self::ACL_RECOMMENDATION, + self::ACL_SEARCH, + self::ACL_SEE_UNRETRIEVABLE_ATTRIBUTES, + self::ACL_SETTINGS, + self::ACL_USAGE, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['acl'] = $data['acl'] ?? null; + $this->container['description'] = $data['description'] ?? ''; + $this->container['indexes'] = $data['indexes'] ?? null; + $this->container['maxHitsPerQuery'] = $data['maxHitsPerQuery'] ?? 0; + $this->container['maxQueriesPerIPPerHour'] = $data['maxQueriesPerIPPerHour'] ?? 0; + $this->container['queryParameters'] = $data['queryParameters'] ?? ''; + $this->container['referers'] = $data['referers'] ?? null; + $this->container['validity'] = $data['validity'] ?? 0; + $this->container['createdAt'] = $data['createdAt'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['acl'] === null) { + $invalidProperties[] = "'acl' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' 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 acl + * + * @return string[] + */ + public function getAcl() + { + return $this->container['acl']; + } + + /** + * Sets acl + * + * @param string[] $acl set of permissions associated with the key + * + * @return self + */ + public function setAcl($acl) + { + $allowedValues = $this->getAclAllowableValues(); + if (array_diff($acl, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'acl', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['acl'] = $acl; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description A comment used to identify a key more easily in the dashboard. It is not interpreted by the API. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets indexes + * + * @return string[]|null + */ + public function getIndexes() + { + return $this->container['indexes']; + } + + /** + * Sets indexes + * + * @param string[]|null $indexes Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed. + * + * @return self + */ + public function setIndexes($indexes) + { + $this->container['indexes'] = $indexes; + + return $this; + } + + /** + * Gets maxHitsPerQuery + * + * @return int|null + */ + public function getMaxHitsPerQuery() + { + return $this->container['maxHitsPerQuery']; + } + + /** + * Sets maxHitsPerQuery + * + * @param int|null $maxHitsPerQuery Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. + * + * @return self + */ + public function setMaxHitsPerQuery($maxHitsPerQuery) + { + $this->container['maxHitsPerQuery'] = $maxHitsPerQuery; + + return $this; + } + + /** + * Gets maxQueriesPerIPPerHour + * + * @return int|null + */ + public function getMaxQueriesPerIPPerHour() + { + return $this->container['maxQueriesPerIPPerHour']; + } + + /** + * Sets maxQueriesPerIPPerHour + * + * @param int|null $maxQueriesPerIPPerHour maximum number of API calls per hour allowed from a given IP address or a user token + * + * @return self + */ + public function setMaxQueriesPerIPPerHour($maxQueriesPerIPPerHour) + { + $this->container['maxQueriesPerIPPerHour'] = $maxQueriesPerIPPerHour; + + return $this; + } + + /** + * Gets queryParameters + * + * @return string|null + */ + public function getQueryParameters() + { + return $this->container['queryParameters']; + } + + /** + * Sets queryParameters + * + * @param string|null $queryParameters URL-encoded query string. Force some query parameters to be applied for each query made with this API key. + * + * @return self + */ + public function setQueryParameters($queryParameters) + { + $this->container['queryParameters'] = $queryParameters; + + return $this; + } + + /** + * Gets referers + * + * @return string[]|null + */ + public function getReferers() + { + return $this->container['referers']; + } + + /** + * Sets referers + * + * @param string[]|null $referers Restrict this new API key to specific referers. If empty or blank, defaults to all referers. + * + * @return self + */ + public function setReferers($referers) + { + $this->container['referers'] = $referers; + + return $this; + } + + /** + * Gets validity + * + * @return int|null + */ + public function getValidity() + { + return $this->container['validity']; + } + + /** + * Sets validity + * + * @param int|null $validity Validity limit for this key in seconds. The key will automatically be removed after this period of time. + * + * @return self + */ + public function setValidity($validity) + { + $this->container['validity'] = $validity; + + return $this; + } + + /** + * Gets createdAt + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param string $createdAt date of creation (ISO-8601 format) + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php b/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php index 3bc9ce390c..12a0ca555a 100644 --- a/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php @@ -31,7 +31,7 @@ class ListApiKeysResponse implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'keys' => '\Algolia\AlgoliaSearch\Model\KeyObject[]', + 'keys' => '\Algolia\AlgoliaSearch\Model\Key[]', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets keys * - * @return \Algolia\AlgoliaSearch\Model\KeyObject[] + * @return \Algolia\AlgoliaSearch\Model\Key[] */ public function getKeys() { @@ -192,7 +192,7 @@ public function getKeys() /** * Sets keys * - * @param \Algolia\AlgoliaSearch\Model\KeyObject[] $keys list of api keys + * @param \Algolia\AlgoliaSearch\Model\Key[] $keys list of api keys * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php b/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php index b6cc55b479..a32a25a88a 100644 --- a/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ListIndicesResponse.php @@ -31,7 +31,7 @@ class ListIndicesResponse implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'items' => '\Algolia\AlgoliaSearch\Model\Index[]', + 'items' => '\Algolia\AlgoliaSearch\Model\Indice[]', 'nbPages' => 'int', ]; @@ -184,7 +184,7 @@ public function valid() /** * Gets items * - * @return \Algolia\AlgoliaSearch\Model\Index[]|null + * @return \Algolia\AlgoliaSearch\Model\Indice[]|null */ public function getItems() { @@ -194,7 +194,7 @@ public function getItems() /** * Sets items * - * @param \Algolia\AlgoliaSearch\Model\Index[]|null $items list of the fetched indices + * @param \Algolia\AlgoliaSearch\Model\Indice[]|null $items list of the fetched indices * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsParams.php b/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsParams.php new file mode 100644 index 0000000000..6eb265aecf --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsParams.php @@ -0,0 +1,359 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MultipleGetObjectsParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'multipleGetObjectsParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'attributesToRetrieve' => 'string[]', + 'objectID' => 'string', + 'indexName' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'attributesToRetrieve' => null, + 'objectID' => null, + 'indexName' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'attributesToRetrieve' => 'attributesToRetrieve', + 'objectID' => 'objectID', + 'indexName' => 'indexName', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'objectID' => 'setObjectID', + 'indexName' => 'setIndexName', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'objectID' => 'getObjectID', + 'indexName' => 'getIndexName', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve'] ?? null; + $this->container['objectID'] = $data['objectID'] ?? null; + $this->container['indexName'] = $data['indexName'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if ($this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' 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 attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve']; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve List of attributes to retrieve. By default, all retrievable attributes are returned. + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string $objectID ID of the object within that index + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName']; + } + + /** + * Sets indexName + * + * @param string $indexName name of the index containing the object + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php b/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php index 65afdbdc7c..cbb93d4a89 100644 --- a/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php +++ b/clients/algoliasearch-client-php/lib/Model/MultipleQueries.php @@ -33,7 +33,7 @@ class MultipleQueries implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'indexName' => 'string', 'query' => 'string', - 'type' => 'string', + 'type' => '\Algolia\AlgoliaSearch\Model\MultipleQueriesType', 'facet' => 'string', 'params' => 'string', ]; @@ -154,22 +154,6 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE__DEFAULT = 'default'; - const TYPE_FACET = 'facet'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE__DEFAULT, - self::TYPE_FACET, - ]; - } - /** * Associative array for storing property values * @@ -187,7 +171,7 @@ public function __construct(array $data = null) { $this->container['indexName'] = $data['indexName'] ?? null; $this->container['query'] = $data['query'] ?? ''; - $this->container['type'] = $data['type'] ?? 'default'; + $this->container['type'] = $data['type'] ?? null; $this->container['facet'] = $data['facet'] ?? null; $this->container['params'] = $data['params'] ?? null; } @@ -204,14 +188,6 @@ public function listInvalidProperties() if ($this->container['indexName'] === null) { $invalidProperties[] = "'indexName' can't be null"; } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); - } return $invalidProperties; } @@ -278,7 +254,7 @@ public function setQuery($query) /** * Gets type * - * @return string|null + * @return \Algolia\AlgoliaSearch\Model\MultipleQueriesType|null */ public function getType() { @@ -288,22 +264,12 @@ public function getType() /** * Sets type * - * @param string|null $type perform a search query with `default`, will search for facet values if `facet` is given + * @param \Algolia\AlgoliaSearch\Model\MultipleQueriesType|null $type type * * @return self */ public function setType($type) { - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($type) && !in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } $this->container['type'] = $type; return $this; diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesParams.php b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesParams.php new file mode 100644 index 0000000000..cfba5b2975 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesParams.php @@ -0,0 +1,324 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class MultipleQueriesParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'multipleQueriesParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'requests' => '\Algolia\AlgoliaSearch\Model\MultipleQueries[]', + 'strategy' => '\Algolia\AlgoliaSearch\Model\MultipleQueriesStrategy', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'requests' => null, + 'strategy' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'requests' => 'requests', + 'strategy' => 'strategy', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests', + 'strategy' => 'setStrategy', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests', + 'strategy' => 'getStrategy', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['requests'] = $data['requests'] ?? null; + $this->container['strategy'] = $data['strategy'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['requests'] === null) { + $invalidProperties[] = "'requests' 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 requests + * + * @return \Algolia\AlgoliaSearch\Model\MultipleQueries[] + */ + public function getRequests() + { + return $this->container['requests']; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\MultipleQueries[] $requests requests + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + + /** + * Gets strategy + * + * @return \Algolia\AlgoliaSearch\Model\MultipleQueriesStrategy|null + */ + public function getStrategy() + { + return $this->container['strategy']; + } + + /** + * Sets strategy + * + * @param \Algolia\AlgoliaSearch\Model\MultipleQueriesStrategy|null $strategy strategy + * + * @return self + */ + public function setStrategy($strategy) + { + $this->container['strategy'] = $strategy; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesStrategy.php b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesStrategy.php new file mode 100644 index 0000000000..3c4e67950d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesStrategy.php @@ -0,0 +1,33 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class OperationIndexParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'operationIndexParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'operation' => '\Algolia\AlgoliaSearch\Model\OperationType', + 'destination' => 'string', + 'scope' => '\Algolia\AlgoliaSearch\Model\ScopeType[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'operation' => null, + 'destination' => null, + 'scope' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'operation' => 'operation', + 'destination' => 'destination', + 'scope' => 'scope', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'destination' => 'setDestination', + 'scope' => 'setScope', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'destination' => 'getDestination', + 'scope' => 'getScope', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['operation'] = $data['operation'] ?? null; + $this->container['destination'] = $data['destination'] ?? null; + $this->container['scope'] = $data['scope'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['operation'] === null) { + $invalidProperties[] = "'operation' can't be null"; + } + if ($this->container['destination'] === null) { + $invalidProperties[] = "'destination' 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 operation + * + * @return \Algolia\AlgoliaSearch\Model\OperationType + */ + public function getOperation() + { + return $this->container['operation']; + } + + /** + * Sets operation + * + * @param \Algolia\AlgoliaSearch\Model\OperationType $operation operation + * + * @return self + */ + public function setOperation($operation) + { + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets destination + * + * @return string + */ + public function getDestination() + { + return $this->container['destination']; + } + + /** + * Sets destination + * + * @param string $destination the Algolia index name + * + * @return self + */ + public function setDestination($destination) + { + $this->container['destination'] = $destination; + + return $this; + } + + /** + * Gets scope + * + * @return \Algolia\AlgoliaSearch\Model\ScopeType[]|null + */ + public function getScope() + { + return $this->container['scope']; + } + + /** + * Sets scope + * + * @param \Algolia\AlgoliaSearch\Model\ScopeType[]|null $scope Scope of the data to copy. When absent, a full copy is performed. When present, only the selected scopes are copied. + * + * @return self + */ + public function setScope($scope) + { + $this->container['scope'] = $scope; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/OperationType.php b/clients/algoliasearch-client-php/lib/Model/OperationType.php new file mode 100644 index 0000000000..e9bfef789a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/OperationType.php @@ -0,0 +1,35 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class PersonalizationStrategyParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'personalizationStrategyParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'eventScoring' => '\Algolia\AlgoliaSearch\Model\EventScoring[]', + 'facetScoring' => '\Algolia\AlgoliaSearch\Model\FacetScoring[]', + 'personalizationImpact' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'eventScoring' => null, + 'facetScoring' => null, + 'personalizationImpact' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'eventScoring' => 'eventScoring', + 'facetScoring' => 'facetScoring', + 'personalizationImpact' => 'personalizationImpact', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'eventScoring' => 'setEventScoring', + 'facetScoring' => 'setFacetScoring', + 'personalizationImpact' => 'setPersonalizationImpact', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'eventScoring' => 'getEventScoring', + 'facetScoring' => 'getFacetScoring', + 'personalizationImpact' => 'getPersonalizationImpact', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['eventScoring'] = $data['eventScoring'] ?? null; + $this->container['facetScoring'] = $data['facetScoring'] ?? null; + $this->container['personalizationImpact'] = $data['personalizationImpact'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['eventScoring'] === null) { + $invalidProperties[] = "'eventScoring' can't be null"; + } + if ($this->container['facetScoring'] === null) { + $invalidProperties[] = "'facetScoring' can't be null"; + } + if ($this->container['personalizationImpact'] === null) { + $invalidProperties[] = "'personalizationImpact' 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 eventScoring + * + * @return \Algolia\AlgoliaSearch\Model\EventScoring[] + */ + public function getEventScoring() + { + return $this->container['eventScoring']; + } + + /** + * Sets eventScoring + * + * @param \Algolia\AlgoliaSearch\Model\EventScoring[] $eventScoring scores associated with the events + * + * @return self + */ + public function setEventScoring($eventScoring) + { + $this->container['eventScoring'] = $eventScoring; + + return $this; + } + + /** + * Gets facetScoring + * + * @return \Algolia\AlgoliaSearch\Model\FacetScoring[] + */ + public function getFacetScoring() + { + return $this->container['facetScoring']; + } + + /** + * Sets facetScoring + * + * @param \Algolia\AlgoliaSearch\Model\FacetScoring[] $facetScoring scores associated with the facets + * + * @return self + */ + public function setFacetScoring($facetScoring) + { + $this->container['facetScoring'] = $facetScoring; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact']; + } + + /** + * Sets personalizationImpact + * + * @param int $personalizationImpact the impact that personalization has on search results: a number between 0 (personalization disabled) and 100 (personalization fully enabled) + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndex.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndex.php index d3d86d5abe..c4e7aaef7f 100644 --- a/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndex.php +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndex.php @@ -32,7 +32,7 @@ class QuerySuggestionsIndex implements ModelInterface, ArrayAccess, \JsonSeriali */ protected static $openAPITypes = [ 'indexName' => 'string', - 'sourceIndices' => '\Algolia\AlgoliaSearch\Model\SourceIndexWithReplicas[]', + 'sourceIndices' => '\Algolia\AlgoliaSearch\Model\SourceIndiceWithReplicas[]', 'languages' => 'string[]', 'exclude' => 'string[]', ]; @@ -233,7 +233,7 @@ public function setIndexName($indexName) /** * Gets sourceIndices * - * @return \Algolia\AlgoliaSearch\Model\SourceIndexWithReplicas[] + * @return \Algolia\AlgoliaSearch\Model\SourceIndiceWithReplicas[] */ public function getSourceIndices() { @@ -243,7 +243,7 @@ public function getSourceIndices() /** * Sets sourceIndices * - * @param \Algolia\AlgoliaSearch\Model\SourceIndexWithReplicas[] $sourceIndices list of source indices used to generate a Query Suggestions index + * @param \Algolia\AlgoliaSearch\Model\SourceIndiceWithReplicas[] $sourceIndices list of source indices used to generate a Query Suggestions index * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/RecommendHit.php b/clients/algoliasearch-client-php/lib/Model/RecommendHit.php new file mode 100644 index 0000000000..9fa2db0e09 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/RecommendHit.php @@ -0,0 +1,463 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RecommendHit implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'recommendHit'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'objectID' => 'string', + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\HighlightResult', + 'snippetResult' => '\Algolia\AlgoliaSearch\Model\SnippetResult', + 'rankingInfo' => '\Algolia\AlgoliaSearch\Model\RankingInfo', + 'distinctSeqID' => 'int', + 'score' => 'double', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'objectID' => null, + 'highlightResult' => null, + 'snippetResult' => null, + 'rankingInfo' => null, + 'distinctSeqID' => null, + 'score' => 'double', + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'objectID' => 'objectID', + 'highlightResult' => '_highlightResult', + 'snippetResult' => '_snippetResult', + 'rankingInfo' => '_rankingInfo', + 'distinctSeqID' => '_distinctSeqID', + 'score' => '_score', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'highlightResult' => 'setHighlightResult', + 'snippetResult' => 'setSnippetResult', + 'rankingInfo' => 'setRankingInfo', + 'distinctSeqID' => 'setDistinctSeqID', + 'score' => 'setScore', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'highlightResult' => 'getHighlightResult', + 'snippetResult' => 'getSnippetResult', + 'rankingInfo' => 'getRankingInfo', + 'distinctSeqID' => 'getDistinctSeqID', + 'score' => 'getScore', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['objectID'] = $data['objectID'] ?? null; + $this->container['highlightResult'] = $data['highlightResult'] ?? null; + $this->container['snippetResult'] = $data['snippetResult'] ?? null; + $this->container['rankingInfo'] = $data['rankingInfo'] ?? null; + $this->container['distinctSeqID'] = $data['distinctSeqID'] ?? null; + $this->container['score'] = $data['score'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if ($this->container['score'] === null) { + $invalidProperties[] = "'score' can't be null"; + } + if (($this->container['score'] > 100)) { + $invalidProperties[] = "invalid value for 'score', must be smaller than or equal to 100."; + } + + if (($this->container['score'] < 0)) { + $invalidProperties[] = "invalid value for 'score', must be bigger than or equal to 0."; + } + + 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 objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID']; + } + + /** + * Sets objectID + * + * @param string $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets highlightResult + * + * @return \Algolia\AlgoliaSearch\Model\HighlightResult|null + */ + public function getHighlightResult() + { + return $this->container['highlightResult']; + } + + /** + * Sets highlightResult + * + * @param \Algolia\AlgoliaSearch\Model\HighlightResult|null $highlightResult highlightResult + * + * @return self + */ + public function setHighlightResult($highlightResult) + { + $this->container['highlightResult'] = $highlightResult; + + return $this; + } + + /** + * Gets snippetResult + * + * @return \Algolia\AlgoliaSearch\Model\SnippetResult|null + */ + public function getSnippetResult() + { + return $this->container['snippetResult']; + } + + /** + * Sets snippetResult + * + * @param \Algolia\AlgoliaSearch\Model\SnippetResult|null $snippetResult snippetResult + * + * @return self + */ + public function setSnippetResult($snippetResult) + { + $this->container['snippetResult'] = $snippetResult; + + return $this; + } + + /** + * Gets rankingInfo + * + * @return \Algolia\AlgoliaSearch\Model\RankingInfo|null + */ + public function getRankingInfo() + { + return $this->container['rankingInfo']; + } + + /** + * Sets rankingInfo + * + * @param \Algolia\AlgoliaSearch\Model\RankingInfo|null $rankingInfo rankingInfo + * + * @return self + */ + public function setRankingInfo($rankingInfo) + { + $this->container['rankingInfo'] = $rankingInfo; + + return $this; + } + + /** + * Gets distinctSeqID + * + * @return int|null + */ + public function getDistinctSeqID() + { + return $this->container['distinctSeqID']; + } + + /** + * Sets distinctSeqID + * + * @param int|null $distinctSeqID distinctSeqID + * + * @return self + */ + public function setDistinctSeqID($distinctSeqID) + { + $this->container['distinctSeqID'] = $distinctSeqID; + + return $this; + } + + /** + * Gets score + * + * @return float + */ + public function getScore() + { + return $this->container['score']; + } + + /** + * Sets score + * + * @param float $score the recommendation score + * + * @return self + */ + public function setScore($score) + { + if (($score > 100)) { + throw new \InvalidArgumentException('invalid value for $score when calling RecommendHit., must be smaller than or equal to 100.'); + } + if (($score < 0)) { + throw new \InvalidArgumentException('invalid value for $score when calling RecommendHit., must be bigger than or equal to 0.'); + } + + $this->container['score'] = $score; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/RecommendHits.php b/clients/algoliasearch-client-php/lib/Model/RecommendHits.php index 79323dd78c..3b25352c10 100644 --- a/clients/algoliasearch-client-php/lib/Model/RecommendHits.php +++ b/clients/algoliasearch-client-php/lib/Model/RecommendHits.php @@ -31,7 +31,7 @@ class RecommendHits implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'hits' => '\Algolia\AlgoliaSearch\Model\RecommendRecord[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\RecommendHit[]', ]; /** @@ -178,7 +178,7 @@ public function valid() /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\RecommendRecord[]|null + * @return \Algolia\AlgoliaSearch\Model\RecommendHit[]|null */ public function getHits() { @@ -188,7 +188,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\RecommendRecord[]|null $hits hits + * @param \Algolia\AlgoliaSearch\Model\RecommendHit[]|null $hits hits * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/RecommendationsResponse.php b/clients/algoliasearch-client-php/lib/Model/RecommendationsResponse.php index 3bdf0b5864..54ffb28f63 100644 --- a/clients/algoliasearch-client-php/lib/Model/RecommendationsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/RecommendationsResponse.php @@ -55,7 +55,7 @@ class RecommendationsResponse implements ModelInterface, ArrayAccess, \JsonSeria 'queryAfterRemoval' => 'string', 'serverUsed' => 'string', 'userData' => 'object', - 'hits' => '\Algolia\AlgoliaSearch\Model\RecommendRecord[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\RecommendHit[]', ]; /** @@ -937,7 +937,7 @@ public function setUserData($userData) /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\RecommendRecord[] + * @return \Algolia\AlgoliaSearch\Model\RecommendHit[] */ public function getHits() { @@ -947,7 +947,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\RecommendRecord[] $hits hits + * @param \Algolia\AlgoliaSearch\Model\RecommendHit[] $hits hits * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/ScopeType.php b/clients/algoliasearch-client-php/lib/Model/ScopeType.php new file mode 100644 index 0000000000..a01e519ab6 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/ScopeType.php @@ -0,0 +1,36 @@ + '\Algolia\AlgoliaSearch\Model\Record[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\Hit[]', ]; /** @@ -178,7 +178,7 @@ public function valid() /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\Record[]|null + * @return \Algolia\AlgoliaSearch\Model\Hit[]|null */ public function getHits() { @@ -188,7 +188,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\Record[]|null $hits hits + * @param \Algolia\AlgoliaSearch\Model\Hit[]|null $hits hits * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SearchResponse.php b/clients/algoliasearch-client-php/lib/Model/SearchResponse.php index cc9398e50d..e260bc2f79 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchResponse.php @@ -55,7 +55,7 @@ class SearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'queryAfterRemoval' => 'string', 'serverUsed' => 'string', 'userData' => 'object', - 'hits' => '\Algolia\AlgoliaSearch\Model\Record[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\Hit[]', ]; /** @@ -937,7 +937,7 @@ public function setUserData($userData) /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\Record[] + * @return \Algolia\AlgoliaSearch\Model\Hit[] */ public function getHits() { @@ -947,7 +947,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\Record[] $hits hits + * @param \Algolia\AlgoliaSearch\Model\Hit[] $hits hits * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsParams.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsParams.php new file mode 100644 index 0000000000..fbf1d74e12 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsParams.php @@ -0,0 +1,386 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchUserIdsParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchUserIdsParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'query' => 'string', + 'clusterName' => 'string', + 'page' => 'int', + 'hitsPerPage' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'query' => null, + 'clusterName' => null, + 'page' => null, + 'hitsPerPage' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'query' => 'query', + 'clusterName' => 'clusterName', + 'page' => 'page', + 'hitsPerPage' => 'hitsPerPage', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'clusterName' => 'setClusterName', + 'page' => 'setPage', + 'hitsPerPage' => 'setHitsPerPage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'clusterName' => 'getClusterName', + 'page' => 'getPage', + 'hitsPerPage' => 'getHitsPerPage', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['query'] = $data['query'] ?? null; + $this->container['clusterName'] = $data['clusterName'] ?? null; + $this->container['page'] = $data['page'] ?? 0; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' 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 query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query Query to search. The search is a prefix search with typoTolerance. Use empty query to retrieve all users. + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets clusterName + * + * @return string|null + */ + public function getClusterName() + { + return $this->container['clusterName']; + } + + /** + * Sets clusterName + * + * @param string|null $clusterName name of the cluster + * + * @return self + */ + public function setClusterName($clusterName) + { + $this->container['clusterName'] = $clusterName; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php index a0c622479c..764d93a24f 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php @@ -31,7 +31,7 @@ class SearchUserIdsResponseHits implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'userID' => '\Algolia\AlgoliaSearch\Model\UserId', + 'userID' => 'string', 'clusterName' => 'string', 'nbRecords' => 'int', 'dataSize' => 'int', @@ -194,6 +194,10 @@ public function listInvalidProperties() if ($this->container['userID'] === null) { $invalidProperties[] = "'userID' can't be null"; } + if (!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $this->container['userID'])) { + $invalidProperties[] = "invalid value for 'userID', must be conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."; + } + if ($this->container['clusterName'] === null) { $invalidProperties[] = "'clusterName' can't be null"; } @@ -227,7 +231,7 @@ public function valid() /** * Gets userID * - * @return \Algolia\AlgoliaSearch\Model\UserId + * @return string */ public function getUserID() { @@ -237,12 +241,16 @@ public function getUserID() /** * Sets userID * - * @param \Algolia\AlgoliaSearch\Model\UserId $userID userID + * @param string $userID userID of the user * * @return self */ public function setUserID($userID) { + if ((!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $userID))) { + throw new \InvalidArgumentException("invalid value for $userID when calling SearchUserIdsResponseHits., must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."); + } + $this->container['userID'] = $userID; return $this; diff --git a/clients/algoliasearch-client-php/lib/Model/SourceIndiceWithReplicas.php b/clients/algoliasearch-client-php/lib/Model/SourceIndiceWithReplicas.php new file mode 100644 index 0000000000..77ffaf0118 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SourceIndiceWithReplicas.php @@ -0,0 +1,527 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SourceIndiceWithReplicas implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SourceIndiceWithReplicas'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'replicas' => 'bool', + 'indexName' => 'string', + 'analyticsTags' => 'string[]', + 'facets' => 'object[]', + 'minHits' => 'int', + 'minLetters' => 'int', + 'generate' => 'string[][]', + 'external' => '\Algolia\AlgoliaSearch\Model\SourceIndexExternal[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + '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 openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'replicas' => 'replicas', + 'indexName' => 'indexName', + 'analyticsTags' => 'analyticsTags', + 'facets' => 'facets', + 'minHits' => 'minHits', + 'minLetters' => 'minLetters', + 'generate' => 'generate', + 'external' => 'external', + ]; + + /** + * 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 where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['replicas'] = $data['replicas'] ?? null; + $this->container['indexName'] = $data['indexName'] ?? null; + $this->container['analyticsTags'] = $data['analyticsTags'] ?? null; + $this->container['facets'] = $data['facets'] ?? null; + $this->container['minHits'] = $data['minHits'] ?? null; + $this->container['minLetters'] = $data['minLetters'] ?? null; + $this->container['generate'] = $data['generate'] ?? null; + $this->container['external'] = $data['external'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['replicas'] === null) { + $invalidProperties[] = "'replicas' can't be null"; + } + if ($this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + if ($this->container['analyticsTags'] === null) { + $invalidProperties[] = "'analyticsTags' can't be null"; + } + if ($this->container['facets'] === null) { + $invalidProperties[] = "'facets' can't be null"; + } + if ($this->container['minHits'] === null) { + $invalidProperties[] = "'minHits' can't be null"; + } + if ($this->container['minLetters'] === null) { + $invalidProperties[] = "'minLetters' can't be null"; + } + if ($this->container['generate'] === null) { + $invalidProperties[] = "'generate' can't be null"; + } + if ($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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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']; + } + + /** + * 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\SourceIndexExternal[] + */ + public function getExternal() + { + return $this->container['external']; + } + + /** + * Sets external + * + * @param \Algolia\AlgoliaSearch\Model\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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/SynonymHit.php b/clients/algoliasearch-client-php/lib/Model/SynonymHit.php index 1b049ea917..f969b6f765 100644 --- a/clients/algoliasearch-client-php/lib/Model/SynonymHit.php +++ b/clients/algoliasearch-client-php/lib/Model/SynonymHit.php @@ -34,7 +34,7 @@ class SynonymHit implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'objectID' => 'string', - 'type' => 'string', + 'type' => '\Algolia\AlgoliaSearch\Model\SynonymType', 'synonyms' => 'string[]', 'input' => 'string', 'word' => 'string', @@ -176,28 +176,6 @@ public function getModelName() return self::$openAPIModelName; } - const TYPE_SYNONYM = 'synonym'; - const TYPE_ONEWAYSYNONYM = 'onewaysynonym'; - const TYPE_ALTCORRECTION1 = 'altcorrection1'; - const TYPE_ALTCORRECTION2 = 'altcorrection2'; - const TYPE_PLACEHOLDER = 'placeholder'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_SYNONYM, - self::TYPE_ONEWAYSYNONYM, - self::TYPE_ALTCORRECTION1, - self::TYPE_ALTCORRECTION2, - self::TYPE_PLACEHOLDER, - ]; - } - /** * Associative array for storing property values * @@ -239,14 +217,6 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'type', must be one of '%s'", - $this->container['type'], - implode("', '", $allowedValues) - ); - } return $invalidProperties; } @@ -289,7 +259,7 @@ public function setObjectID($objectID) /** * Gets type * - * @return string + * @return \Algolia\AlgoliaSearch\Model\SynonymType */ public function getType() { @@ -299,22 +269,12 @@ public function getType() /** * Sets type * - * @param string $type type of the synonym object + * @param \Algolia\AlgoliaSearch\Model\SynonymType $type type * * @return self */ public function setType($type) { - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); - } $this->container['type'] = $type; return $this; diff --git a/clients/algoliasearch-client-php/lib/Model/SynonymType.php b/clients/algoliasearch-client-php/lib/Model/SynonymType.php new file mode 100644 index 0000000000..15deac79dc --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/SynonymType.php @@ -0,0 +1,44 @@ +container['userID'] === null) { $invalidProperties[] = "'userID' can't be null"; } + if (!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $this->container['userID'])) { + $invalidProperties[] = "invalid value for 'userID', must be conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."; + } + if ($this->container['clusterName'] === null) { $invalidProperties[] = "'clusterName' can't be null"; } @@ -227,6 +231,10 @@ public function getUserID() */ public function setUserID($userID) { + if ((!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $userID))) { + throw new \InvalidArgumentException("invalid value for $userID when calling UserId., must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."); + } + $this->container['userID'] = $userID; return $this; diff --git a/scripts/formatter.sh b/scripts/formatter.sh index aba65c1b96..c1bdc22b63 100755 --- a/scripts/formatter.sh +++ b/scripts/formatter.sh @@ -20,7 +20,7 @@ elif [[ $LANGUAGE == 'php' ]]; then else PHP="php8" fi - CMD= "cd $FOLDER && composer update && composer dump-autoload && PHP_CS_FIXER_IGNORE_ENV=1 $PHP vendor/bin/php-cs-fixer fix lib/ --using-cache=no --allow-risky=yes" + CMD="cd $FOLDER && composer update && composer dump-autoload && PHP_CS_FIXER_IGNORE_ENV=1 $PHP vendor/bin/php-cs-fixer fix lib/ --using-cache=no --allow-risky=yes" elif [[ $LANGUAGE == 'java' ]]; then CMD="find $FOLDER -type f -name \"*.java\" | xargs java --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \ --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ From 098ebb3e6cd46625934daa2799ecc4af3921f1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= Date: Wed, 2 Feb 2022 08:59:36 +0100 Subject: [PATCH 18/26] regen? --- .../lib/Model/AssignUserIdObject.php | 296 --------- .../lib/Model/BatchAssignUserIdsObject.php | 329 ---------- .../lib/Model/BatchObject.php | 292 --------- .../lib/Model/BatchWriteObject.php | 292 --------- .../lib/Model/BuildInOperation.php | 374 ----------- .../lib/Model/GetObjectsObject.php | 292 --------- .../lib/Model/Index.php | 615 ------------------ .../lib/Model/KeyObject.php | 586 ----------------- .../lib/Model/MultipleGetObjectsObject.php | 359 ---------- .../lib/Model/MultipleQueriesObject.php | 358 ---------- .../lib/Model/OperationIndexObject.php | 418 ------------ .../Model/PersonalizationStrategyObject.php | 360 ---------- .../lib/Model/RecommendRecord.php | 463 ------------- .../lib/Model/Record.php | 416 ------------ .../lib/Model/SearchParams.php | 30 + .../lib/Model/SearchUserIdsObject.php | 386 ----------- .../lib/Model/SourceIndexWithReplicas.php | 525 --------------- 17 files changed, 30 insertions(+), 6361 deletions(-) delete mode 100644 clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/BatchObject.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/BuildInOperation.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/Index.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/KeyObject.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/PersonalizationStrategyObject.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/RecommendRecord.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/Record.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php delete mode 100644 clients/algoliasearch-client-php/lib/Model/SourceIndexWithReplicas.php diff --git a/clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php b/clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php deleted file mode 100644 index 258696246c..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/AssignUserIdObject.php +++ /dev/null @@ -1,296 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class AssignUserIdObject implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'assignUserIdObject'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'cluster' => 'string', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'cluster' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'cluster' => 'cluster', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'cluster' => 'setCluster', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'cluster' => 'getCluster', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['cluster'] = $data['cluster'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['cluster'] === null) { - $invalidProperties[] = "'cluster' 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 cluster - * - * @return string - */ - public function getCluster() - { - return $this->container['cluster']; - } - - /** - * Sets cluster - * - * @param string $cluster name of the cluster - * - * @return self - */ - public function setCluster($cluster) - { - $this->container['cluster'] = $cluster; - - 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php b/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php deleted file mode 100644 index d556abcaf8..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/BatchAssignUserIdsObject.php +++ /dev/null @@ -1,329 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class BatchAssignUserIdsObject implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'batchAssignUserIdsObject'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'cluster' => 'string', - 'users' => 'string[]', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'cluster' => null, - 'users' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'cluster' => 'cluster', - 'users' => 'users', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'cluster' => 'setCluster', - 'users' => 'setUsers', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'cluster' => 'getCluster', - 'users' => 'getUsers', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['cluster'] = $data['cluster'] ?? null; - $this->container['users'] = $data['users'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['cluster'] === null) { - $invalidProperties[] = "'cluster' can't be null"; - } - if ($this->container['users'] === null) { - $invalidProperties[] = "'users' 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 cluster - * - * @return string - */ - public function getCluster() - { - return $this->container['cluster']; - } - - /** - * Sets cluster - * - * @param string $cluster name of the cluster - * - * @return self - */ - public function setCluster($cluster) - { - $this->container['cluster'] = $cluster; - - return $this; - } - - /** - * Gets users - * - * @return string[] - */ - public function getUsers() - { - return $this->container['users']; - } - - /** - * Sets users - * - * @param string[] $users userIDs to assign. Note you cannot move users with this method. - * - * @return self - */ - public function setUsers($users) - { - $this->container['users'] = $users; - - 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/BatchObject.php b/clients/algoliasearch-client-php/lib/Model/BatchObject.php deleted file mode 100644 index 69068c27fe..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/BatchObject.php +++ /dev/null @@ -1,292 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class BatchObject implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'batchObject'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'requests' => '\Algolia\AlgoliaSearch\Model\Operation[]', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'requests' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'requests' => 'requests', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'requests' => 'setRequests', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'requests' => 'getRequests', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['requests'] = $data['requests'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - 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 requests - * - * @return \Algolia\AlgoliaSearch\Model\Operation[]|null - */ - public function getRequests() - { - return $this->container['requests']; - } - - /** - * Sets requests - * - * @param \Algolia\AlgoliaSearch\Model\Operation[]|null $requests requests - * - * @return self - */ - public function setRequests($requests) - { - $this->container['requests'] = $requests; - - 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php b/clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php deleted file mode 100644 index a0cbdc98fd..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/BatchWriteObject.php +++ /dev/null @@ -1,292 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class BatchWriteObject implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'batchWriteObject'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'requests' => '\Algolia\AlgoliaSearch\Model\Operation[]', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'requests' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'requests' => 'requests', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'requests' => 'setRequests', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'requests' => 'getRequests', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['requests'] = $data['requests'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - 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 requests - * - * @return \Algolia\AlgoliaSearch\Model\Operation[]|null - */ - public function getRequests() - { - return $this->container['requests']; - } - - /** - * Sets requests - * - * @param \Algolia\AlgoliaSearch\Model\Operation[]|null $requests requests - * - * @return self - */ - public function setRequests($requests) - { - $this->container['requests'] = $requests; - - 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/BuildInOperation.php b/clients/algoliasearch-client-php/lib/Model/BuildInOperation.php deleted file mode 100644 index 70680634bc..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/BuildInOperation.php +++ /dev/null @@ -1,374 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class BuildInOperation implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'buildInOperation'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'operation' => 'string', - 'value' => 'string', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'operation' => null, - 'value' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'operation' => '_operation', - 'value' => 'value', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'operation' => 'setOperation', - 'value' => 'setValue', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'operation' => 'getOperation', - 'value' => 'getValue', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - const OPERATION_INCREMENT = 'Increment'; - const OPERATION_DECREMENT = 'Decrement'; - const OPERATION_ADD = 'Add'; - const OPERATION_REMOVE = 'Remove'; - const OPERATION_ADD_UNIQUE = 'AddUnique'; - const OPERATION_INCREMENT_FROM = 'IncrementFrom'; - const OPERATION_INCREMENT_SET = 'IncrementSet'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getOperationAllowableValues() - { - return [ - self::OPERATION_INCREMENT, - self::OPERATION_DECREMENT, - self::OPERATION_ADD, - self::OPERATION_REMOVE, - self::OPERATION_ADD_UNIQUE, - self::OPERATION_INCREMENT_FROM, - self::OPERATION_INCREMENT_SET, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['operation'] = $data['operation'] ?? null; - $this->container['value'] = $data['value'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['operation'] === null) { - $invalidProperties[] = "'operation' can't be null"; - } - $allowedValues = $this->getOperationAllowableValues(); - if (!is_null($this->container['operation']) && !in_array($this->container['operation'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'operation', must be one of '%s'", - $this->container['operation'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['value'] === null) { - $invalidProperties[] = "'value' 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 operation - * - * @return string - */ - public function getOperation() - { - return $this->container['operation']; - } - - /** - * Sets operation - * - * @param string $operation the operation to apply on the attribute - * - * @return self - */ - public function setOperation($operation) - { - $allowedValues = $this->getOperationAllowableValues(); - if (!in_array($operation, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'operation', must be one of '%s'", - $operation, - implode("', '", $allowedValues) - ) - ); - } - $this->container['operation'] = $operation; - - return $this; - } - - /** - * Gets value - * - * @return string - */ - public function getValue() - { - return $this->container['value']; - } - - /** - * Sets value - * - * @param string $value the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove - * - * @return self - */ - public function setValue($value) - { - $this->container['value'] = $value; - - 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php b/clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php deleted file mode 100644 index 4db95782ef..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/GetObjectsObject.php +++ /dev/null @@ -1,292 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class GetObjectsObject implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'getObjectsObject'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'requests' => '\Algolia\AlgoliaSearch\Model\MultipleGetObjectsObject[]', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'requests' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'requests' => 'requests', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'requests' => 'setRequests', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'requests' => 'getRequests', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['requests'] = $data['requests'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - 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 requests - * - * @return \Algolia\AlgoliaSearch\Model\MultipleGetObjectsObject[]|null - */ - public function getRequests() - { - return $this->container['requests']; - } - - /** - * Sets requests - * - * @param \Algolia\AlgoliaSearch\Model\MultipleGetObjectsObject[]|null $requests requests - * - * @return self - */ - public function setRequests($requests) - { - $this->container['requests'] = $requests; - - 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/Index.php b/clients/algoliasearch-client-php/lib/Model/Index.php deleted file mode 100644 index 55eed70a0e..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/Index.php +++ /dev/null @@ -1,615 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class Index implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'index'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'name' => '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[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - '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 openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'name' => 'name', - 'createdAt' => 'createdAt', - 'updatedAt' => 'updatedAt', - 'entries' => 'entries', - 'dataSize' => 'dataSize', - 'fileSize' => 'fileSize', - 'lastBuildTimeS' => 'lastBuildTimeS', - 'numberOfPendingTask' => 'numberOfPendingTask', - 'pendingTask' => 'pendingTask', - 'primary' => 'primary', - 'replicas' => 'replicas', - ]; - - /** - * 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 where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['name'] = $data['name'] ?? null; - $this->container['createdAt'] = $data['createdAt'] ?? null; - $this->container['updatedAt'] = $data['updatedAt'] ?? null; - $this->container['entries'] = $data['entries'] ?? null; - $this->container['dataSize'] = $data['dataSize'] ?? null; - $this->container['fileSize'] = $data['fileSize'] ?? null; - $this->container['lastBuildTimeS'] = $data['lastBuildTimeS'] ?? null; - $this->container['numberOfPendingTask'] = $data['numberOfPendingTask'] ?? null; - $this->container['pendingTask'] = $data['pendingTask'] ?? null; - $this->container['primary'] = $data['primary'] ?? null; - $this->container['replicas'] = $data['replicas'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['createdAt'] === null) { - $invalidProperties[] = "'createdAt' can't be null"; - } - if ($this->container['updatedAt'] === null) { - $invalidProperties[] = "'updatedAt' can't be null"; - } - if ($this->container['entries'] === null) { - $invalidProperties[] = "'entries' can't be null"; - } - if ($this->container['dataSize'] === null) { - $invalidProperties[] = "'dataSize' can't be null"; - } - if ($this->container['fileSize'] === null) { - $invalidProperties[] = "'fileSize' can't be null"; - } - if ($this->container['lastBuildTimeS'] === null) { - $invalidProperties[] = "'lastBuildTimeS' can't be null"; - } - if ($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']; - } - - /** - * 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']; - } - - /** - * 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']; - } - - /** - * 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']; - } - - /** - * 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']; - } - - /** - * 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']; - } - - /** - * 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']; - } - - /** - * 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']; - } - - /** - * 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']; - } - - /** - * 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']; - } - - /** - * 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']; - } - - /** - * 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/KeyObject.php b/clients/algoliasearch-client-php/lib/Model/KeyObject.php deleted file mode 100644 index d34b9e2227..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/KeyObject.php +++ /dev/null @@ -1,586 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class KeyObject implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'keyObject'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'acl' => 'string[]', - 'description' => 'string', - 'indexes' => 'string[]', - 'maxHitsPerQuery' => 'int', - 'maxQueriesPerIPPerHour' => 'int', - 'queryParameters' => 'string', - 'referers' => 'string[]', - 'validity' => 'int', - 'createdAt' => 'string', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'acl' => null, - 'description' => null, - 'indexes' => null, - 'maxHitsPerQuery' => null, - 'maxQueriesPerIPPerHour' => null, - 'queryParameters' => null, - 'referers' => null, - 'validity' => null, - 'createdAt' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'acl' => 'acl', - 'description' => 'description', - 'indexes' => 'indexes', - 'maxHitsPerQuery' => 'maxHitsPerQuery', - 'maxQueriesPerIPPerHour' => 'maxQueriesPerIPPerHour', - 'queryParameters' => 'queryParameters', - 'referers' => 'referers', - 'validity' => 'validity', - 'createdAt' => 'createdAt', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'acl' => 'setAcl', - 'description' => 'setDescription', - 'indexes' => 'setIndexes', - 'maxHitsPerQuery' => 'setMaxHitsPerQuery', - 'maxQueriesPerIPPerHour' => 'setMaxQueriesPerIPPerHour', - 'queryParameters' => 'setQueryParameters', - 'referers' => 'setReferers', - 'validity' => 'setValidity', - 'createdAt' => 'setCreatedAt', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'acl' => 'getAcl', - 'description' => 'getDescription', - 'indexes' => 'getIndexes', - 'maxHitsPerQuery' => 'getMaxHitsPerQuery', - 'maxQueriesPerIPPerHour' => 'getMaxQueriesPerIPPerHour', - 'queryParameters' => 'getQueryParameters', - 'referers' => 'getReferers', - 'validity' => 'getValidity', - 'createdAt' => 'getCreatedAt', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - const ACL_ADD_OBJECT = 'addObject'; - const ACL_ANALYTICS = 'analytics'; - const ACL_BROWSE = 'browse'; - const ACL_DELETE_OBJECT = 'deleteObject'; - const ACL_DELETE_INDEX = 'deleteIndex'; - const ACL_EDIT_SETTINGS = 'editSettings'; - const ACL_LIST_INDEXES = 'listIndexes'; - const ACL_LOGS = 'logs'; - const ACL_PERSONALIZATION = 'personalization'; - const ACL_RECOMMENDATION = 'recommendation'; - const ACL_SEARCH = 'search'; - const ACL_SEE_UNRETRIEVABLE_ATTRIBUTES = 'seeUnretrievableAttributes'; - const ACL_SETTINGS = 'settings'; - const ACL_USAGE = 'usage'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getAclAllowableValues() - { - return [ - self::ACL_ADD_OBJECT, - self::ACL_ANALYTICS, - self::ACL_BROWSE, - self::ACL_DELETE_OBJECT, - self::ACL_DELETE_INDEX, - self::ACL_EDIT_SETTINGS, - self::ACL_LIST_INDEXES, - self::ACL_LOGS, - self::ACL_PERSONALIZATION, - self::ACL_RECOMMENDATION, - self::ACL_SEARCH, - self::ACL_SEE_UNRETRIEVABLE_ATTRIBUTES, - self::ACL_SETTINGS, - self::ACL_USAGE, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['acl'] = $data['acl'] ?? null; - $this->container['description'] = $data['description'] ?? ''; - $this->container['indexes'] = $data['indexes'] ?? null; - $this->container['maxHitsPerQuery'] = $data['maxHitsPerQuery'] ?? 0; - $this->container['maxQueriesPerIPPerHour'] = $data['maxQueriesPerIPPerHour'] ?? 0; - $this->container['queryParameters'] = $data['queryParameters'] ?? ''; - $this->container['referers'] = $data['referers'] ?? null; - $this->container['validity'] = $data['validity'] ?? 0; - $this->container['createdAt'] = $data['createdAt'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['acl'] === null) { - $invalidProperties[] = "'acl' can't be null"; - } - if ($this->container['createdAt'] === null) { - $invalidProperties[] = "'createdAt' 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 acl - * - * @return string[] - */ - public function getAcl() - { - return $this->container['acl']; - } - - /** - * Sets acl - * - * @param string[] $acl set of permissions associated with the key - * - * @return self - */ - public function setAcl($acl) - { - $allowedValues = $this->getAclAllowableValues(); - if (array_diff($acl, $allowedValues)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'acl', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['acl'] = $acl; - - return $this; - } - - /** - * Gets description - * - * @return string|null - */ - public function getDescription() - { - return $this->container['description']; - } - - /** - * Sets description - * - * @param string|null $description A comment used to identify a key more easily in the dashboard. It is not interpreted by the API. - * - * @return self - */ - public function setDescription($description) - { - $this->container['description'] = $description; - - return $this; - } - - /** - * Gets indexes - * - * @return string[]|null - */ - public function getIndexes() - { - return $this->container['indexes']; - } - - /** - * Sets indexes - * - * @param string[]|null $indexes Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed. - * - * @return self - */ - public function setIndexes($indexes) - { - $this->container['indexes'] = $indexes; - - return $this; - } - - /** - * Gets maxHitsPerQuery - * - * @return int|null - */ - public function getMaxHitsPerQuery() - { - return $this->container['maxHitsPerQuery']; - } - - /** - * Sets maxHitsPerQuery - * - * @param int|null $maxHitsPerQuery Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. - * - * @return self - */ - public function setMaxHitsPerQuery($maxHitsPerQuery) - { - $this->container['maxHitsPerQuery'] = $maxHitsPerQuery; - - return $this; - } - - /** - * Gets maxQueriesPerIPPerHour - * - * @return int|null - */ - public function getMaxQueriesPerIPPerHour() - { - return $this->container['maxQueriesPerIPPerHour']; - } - - /** - * Sets maxQueriesPerIPPerHour - * - * @param int|null $maxQueriesPerIPPerHour maximum number of API calls per hour allowed from a given IP address or a user token - * - * @return self - */ - public function setMaxQueriesPerIPPerHour($maxQueriesPerIPPerHour) - { - $this->container['maxQueriesPerIPPerHour'] = $maxQueriesPerIPPerHour; - - return $this; - } - - /** - * Gets queryParameters - * - * @return string|null - */ - public function getQueryParameters() - { - return $this->container['queryParameters']; - } - - /** - * Sets queryParameters - * - * @param string|null $queryParameters URL-encoded query string. Force some query parameters to be applied for each query made with this API key. - * - * @return self - */ - public function setQueryParameters($queryParameters) - { - $this->container['queryParameters'] = $queryParameters; - - return $this; - } - - /** - * Gets referers - * - * @return string[]|null - */ - public function getReferers() - { - return $this->container['referers']; - } - - /** - * Sets referers - * - * @param string[]|null $referers Restrict this new API key to specific referers. If empty or blank, defaults to all referers. - * - * @return self - */ - public function setReferers($referers) - { - $this->container['referers'] = $referers; - - return $this; - } - - /** - * Gets validity - * - * @return int|null - */ - public function getValidity() - { - return $this->container['validity']; - } - - /** - * Sets validity - * - * @param int|null $validity Validity limit for this key in seconds. The key will automatically be removed after this period of time. - * - * @return self - */ - public function setValidity($validity) - { - $this->container['validity'] = $validity; - - return $this; - } - - /** - * Gets createdAt - * - * @return string - */ - public function getCreatedAt() - { - return $this->container['createdAt']; - } - - /** - * Sets createdAt - * - * @param string $createdAt date of creation (ISO-8601 format) - * - * @return self - */ - public function setCreatedAt($createdAt) - { - $this->container['createdAt'] = $createdAt; - - 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php b/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php deleted file mode 100644 index c7aa0dff1b..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/MultipleGetObjectsObject.php +++ /dev/null @@ -1,359 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class MultipleGetObjectsObject implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'multipleGetObjectsObject'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'attributesToRetrieve' => 'string[]', - 'objectID' => 'string', - 'indexName' => 'string', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'attributesToRetrieve' => null, - 'objectID' => null, - 'indexName' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'attributesToRetrieve' => 'attributesToRetrieve', - 'objectID' => 'objectID', - 'indexName' => 'indexName', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'attributesToRetrieve' => 'setAttributesToRetrieve', - 'objectID' => 'setObjectID', - 'indexName' => 'setIndexName', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'attributesToRetrieve' => 'getAttributesToRetrieve', - 'objectID' => 'getObjectID', - 'indexName' => 'getIndexName', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['attributesToRetrieve'] = $data['attributesToRetrieve'] ?? null; - $this->container['objectID'] = $data['objectID'] ?? null; - $this->container['indexName'] = $data['indexName'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['objectID'] === null) { - $invalidProperties[] = "'objectID' can't be null"; - } - if ($this->container['indexName'] === null) { - $invalidProperties[] = "'indexName' 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 attributesToRetrieve - * - * @return string[]|null - */ - public function getAttributesToRetrieve() - { - return $this->container['attributesToRetrieve']; - } - - /** - * Sets attributesToRetrieve - * - * @param string[]|null $attributesToRetrieve List of attributes to retrieve. By default, all retrievable attributes are returned. - * - * @return self - */ - public function setAttributesToRetrieve($attributesToRetrieve) - { - $this->container['attributesToRetrieve'] = $attributesToRetrieve; - - return $this; - } - - /** - * Gets objectID - * - * @return string - */ - public function getObjectID() - { - return $this->container['objectID']; - } - - /** - * Sets objectID - * - * @param string $objectID ID of the object within that index - * - * @return self - */ - public function setObjectID($objectID) - { - $this->container['objectID'] = $objectID; - - return $this; - } - - /** - * Gets indexName - * - * @return string - */ - public function getIndexName() - { - return $this->container['indexName']; - } - - /** - * Sets indexName - * - * @param string $indexName name of the index containing the object - * - * @return self - */ - public function setIndexName($indexName) - { - $this->container['indexName'] = $indexName; - - 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php b/clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php deleted file mode 100644 index 221f62ee03..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesObject.php +++ /dev/null @@ -1,358 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class MultipleQueriesObject implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'multipleQueriesObject'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'requests' => '\Algolia\AlgoliaSearch\Model\MultipleQueries[]', - 'strategy' => 'string', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'requests' => null, - 'strategy' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'requests' => 'requests', - 'strategy' => 'strategy', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'requests' => 'setRequests', - 'strategy' => 'setStrategy', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'requests' => 'getRequests', - 'strategy' => 'getStrategy', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - const STRATEGY_NONE = 'none'; - const STRATEGY_STOP_IF_ENOUGH_MATCHES = 'stopIfEnoughMatches'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStrategyAllowableValues() - { - return [ - self::STRATEGY_NONE, - self::STRATEGY_STOP_IF_ENOUGH_MATCHES, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['requests'] = $data['requests'] ?? null; - $this->container['strategy'] = $data['strategy'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['requests'] === null) { - $invalidProperties[] = "'requests' can't be null"; - } - $allowedValues = $this->getStrategyAllowableValues(); - if (!is_null($this->container['strategy']) && !in_array($this->container['strategy'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'strategy', must be one of '%s'", - $this->container['strategy'], - implode("', '", $allowedValues) - ); - } - - 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 requests - * - * @return \Algolia\AlgoliaSearch\Model\MultipleQueries[] - */ - public function getRequests() - { - return $this->container['requests']; - } - - /** - * Sets requests - * - * @param \Algolia\AlgoliaSearch\Model\MultipleQueries[] $requests requests - * - * @return self - */ - public function setRequests($requests) - { - $this->container['requests'] = $requests; - - return $this; - } - - /** - * Gets strategy - * - * @return string|null - */ - public function getStrategy() - { - return $this->container['strategy']; - } - - /** - * Sets strategy - * - * @param string|null $strategy strategy - * - * @return self - */ - public function setStrategy($strategy) - { - $allowedValues = $this->getStrategyAllowableValues(); - if (!is_null($strategy) && !in_array($strategy, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'strategy', must be one of '%s'", - $strategy, - implode("', '", $allowedValues) - ) - ); - } - $this->container['strategy'] = $strategy; - - 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php b/clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php deleted file mode 100644 index 4b9696fb5e..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/OperationIndexObject.php +++ /dev/null @@ -1,418 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class OperationIndexObject implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'operationIndexObject'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'operation' => 'string', - 'destination' => 'string', - 'scope' => 'string[]', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'operation' => null, - 'destination' => null, - 'scope' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'operation' => 'operation', - 'destination' => 'destination', - 'scope' => 'scope', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'operation' => 'setOperation', - 'destination' => 'setDestination', - 'scope' => 'setScope', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'operation' => 'getOperation', - 'destination' => 'getDestination', - 'scope' => 'getScope', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - const OPERATION_MOVE = 'move'; - const OPERATION_COPY = 'copy'; - const SCOPE_SETTINGS = 'settings'; - const SCOPE_SYNONYMS = 'synonyms'; - const SCOPE_RULES = 'rules'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getOperationAllowableValues() - { - return [ - self::OPERATION_MOVE, - self::OPERATION_COPY, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getScopeAllowableValues() - { - return [ - self::SCOPE_SETTINGS, - self::SCOPE_SYNONYMS, - self::SCOPE_RULES, - ]; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['operation'] = $data['operation'] ?? null; - $this->container['destination'] = $data['destination'] ?? null; - $this->container['scope'] = $data['scope'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['operation'] === null) { - $invalidProperties[] = "'operation' can't be null"; - } - $allowedValues = $this->getOperationAllowableValues(); - if (!is_null($this->container['operation']) && !in_array($this->container['operation'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'operation', must be one of '%s'", - $this->container['operation'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['destination'] === null) { - $invalidProperties[] = "'destination' 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 operation - * - * @return string - */ - public function getOperation() - { - return $this->container['operation']; - } - - /** - * Sets operation - * - * @param string $operation type of operation to perform (move or copy) - * - * @return self - */ - public function setOperation($operation) - { - $allowedValues = $this->getOperationAllowableValues(); - if (!in_array($operation, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'operation', must be one of '%s'", - $operation, - implode("', '", $allowedValues) - ) - ); - } - $this->container['operation'] = $operation; - - return $this; - } - - /** - * Gets destination - * - * @return string - */ - public function getDestination() - { - return $this->container['destination']; - } - - /** - * Sets destination - * - * @param string $destination the Algolia index name - * - * @return self - */ - public function setDestination($destination) - { - $this->container['destination'] = $destination; - - return $this; - } - - /** - * Gets scope - * - * @return string[]|null - */ - public function getScope() - { - return $this->container['scope']; - } - - /** - * Sets scope - * - * @param string[]|null $scope Scope of the data to copy. When absent, a full copy is performed. When present, only the selected scopes are copied. - * - * @return self - */ - public function setScope($scope) - { - $allowedValues = $this->getScopeAllowableValues(); - if (!is_null($scope) && array_diff($scope, $allowedValues)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'scope', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['scope'] = $scope; - - 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/PersonalizationStrategyObject.php b/clients/algoliasearch-client-php/lib/Model/PersonalizationStrategyObject.php deleted file mode 100644 index 746d941183..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/PersonalizationStrategyObject.php +++ /dev/null @@ -1,360 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class PersonalizationStrategyObject implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'personalizationStrategyObject'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'eventScoring' => '\Algolia\AlgoliaSearch\Model\EventScoring[]', - 'facetScoring' => '\Algolia\AlgoliaSearch\Model\FacetScoring[]', - 'personalizationImpact' => 'int', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'eventScoring' => null, - 'facetScoring' => null, - 'personalizationImpact' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'eventScoring' => 'eventScoring', - 'facetScoring' => 'facetScoring', - 'personalizationImpact' => 'personalizationImpact', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'eventScoring' => 'setEventScoring', - 'facetScoring' => 'setFacetScoring', - 'personalizationImpact' => 'setPersonalizationImpact', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'eventScoring' => 'getEventScoring', - 'facetScoring' => 'getFacetScoring', - 'personalizationImpact' => 'getPersonalizationImpact', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['eventScoring'] = $data['eventScoring'] ?? null; - $this->container['facetScoring'] = $data['facetScoring'] ?? null; - $this->container['personalizationImpact'] = $data['personalizationImpact'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['eventScoring'] === null) { - $invalidProperties[] = "'eventScoring' can't be null"; - } - if ($this->container['facetScoring'] === null) { - $invalidProperties[] = "'facetScoring' can't be null"; - } - if ($this->container['personalizationImpact'] === null) { - $invalidProperties[] = "'personalizationImpact' 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 eventScoring - * - * @return \Algolia\AlgoliaSearch\Model\EventScoring[] - */ - public function getEventScoring() - { - return $this->container['eventScoring']; - } - - /** - * Sets eventScoring - * - * @param \Algolia\AlgoliaSearch\Model\EventScoring[] $eventScoring scores associated with the events - * - * @return self - */ - public function setEventScoring($eventScoring) - { - $this->container['eventScoring'] = $eventScoring; - - return $this; - } - - /** - * Gets facetScoring - * - * @return \Algolia\AlgoliaSearch\Model\FacetScoring[] - */ - public function getFacetScoring() - { - return $this->container['facetScoring']; - } - - /** - * Sets facetScoring - * - * @param \Algolia\AlgoliaSearch\Model\FacetScoring[] $facetScoring scores associated with the facets - * - * @return self - */ - public function setFacetScoring($facetScoring) - { - $this->container['facetScoring'] = $facetScoring; - - return $this; - } - - /** - * Gets personalizationImpact - * - * @return int - */ - public function getPersonalizationImpact() - { - return $this->container['personalizationImpact']; - } - - /** - * Sets personalizationImpact - * - * @param int $personalizationImpact the impact that personalization has on search results: a number between 0 (personalization disabled) and 100 (personalization fully enabled) - * - * @return self - */ - public function setPersonalizationImpact($personalizationImpact) - { - $this->container['personalizationImpact'] = $personalizationImpact; - - 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/RecommendRecord.php b/clients/algoliasearch-client-php/lib/Model/RecommendRecord.php deleted file mode 100644 index d3c5b65cde..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/RecommendRecord.php +++ /dev/null @@ -1,463 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class RecommendRecord implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'recommendRecord'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'objectID' => 'string', - 'highlightResult' => '\Algolia\AlgoliaSearch\Model\HighlightResult', - 'snippetResult' => '\Algolia\AlgoliaSearch\Model\SnippetResult', - 'rankingInfo' => '\Algolia\AlgoliaSearch\Model\RankingInfo', - 'distinctSeqID' => 'int', - 'score' => 'double', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'objectID' => null, - 'highlightResult' => null, - 'snippetResult' => null, - 'rankingInfo' => null, - 'distinctSeqID' => null, - 'score' => 'double', - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'objectID' => 'objectID', - 'highlightResult' => '_highlightResult', - 'snippetResult' => '_snippetResult', - 'rankingInfo' => '_rankingInfo', - 'distinctSeqID' => '_distinctSeqID', - 'score' => '_score', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'objectID' => 'setObjectID', - 'highlightResult' => 'setHighlightResult', - 'snippetResult' => 'setSnippetResult', - 'rankingInfo' => 'setRankingInfo', - 'distinctSeqID' => 'setDistinctSeqID', - 'score' => 'setScore', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'objectID' => 'getObjectID', - 'highlightResult' => 'getHighlightResult', - 'snippetResult' => 'getSnippetResult', - 'rankingInfo' => 'getRankingInfo', - 'distinctSeqID' => 'getDistinctSeqID', - 'score' => 'getScore', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['objectID'] = $data['objectID'] ?? null; - $this->container['highlightResult'] = $data['highlightResult'] ?? null; - $this->container['snippetResult'] = $data['snippetResult'] ?? null; - $this->container['rankingInfo'] = $data['rankingInfo'] ?? null; - $this->container['distinctSeqID'] = $data['distinctSeqID'] ?? null; - $this->container['score'] = $data['score'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['objectID'] === null) { - $invalidProperties[] = "'objectID' can't be null"; - } - if ($this->container['score'] === null) { - $invalidProperties[] = "'score' can't be null"; - } - if (($this->container['score'] > 100)) { - $invalidProperties[] = "invalid value for 'score', must be smaller than or equal to 100."; - } - - if (($this->container['score'] < 0)) { - $invalidProperties[] = "invalid value for 'score', must be bigger than or equal to 0."; - } - - 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 objectID - * - * @return string - */ - public function getObjectID() - { - return $this->container['objectID']; - } - - /** - * Sets objectID - * - * @param string $objectID unique identifier of the object - * - * @return self - */ - public function setObjectID($objectID) - { - $this->container['objectID'] = $objectID; - - return $this; - } - - /** - * Gets highlightResult - * - * @return \Algolia\AlgoliaSearch\Model\HighlightResult|null - */ - public function getHighlightResult() - { - return $this->container['highlightResult']; - } - - /** - * Sets highlightResult - * - * @param \Algolia\AlgoliaSearch\Model\HighlightResult|null $highlightResult highlightResult - * - * @return self - */ - public function setHighlightResult($highlightResult) - { - $this->container['highlightResult'] = $highlightResult; - - return $this; - } - - /** - * Gets snippetResult - * - * @return \Algolia\AlgoliaSearch\Model\SnippetResult|null - */ - public function getSnippetResult() - { - return $this->container['snippetResult']; - } - - /** - * Sets snippetResult - * - * @param \Algolia\AlgoliaSearch\Model\SnippetResult|null $snippetResult snippetResult - * - * @return self - */ - public function setSnippetResult($snippetResult) - { - $this->container['snippetResult'] = $snippetResult; - - return $this; - } - - /** - * Gets rankingInfo - * - * @return \Algolia\AlgoliaSearch\Model\RankingInfo|null - */ - public function getRankingInfo() - { - return $this->container['rankingInfo']; - } - - /** - * Sets rankingInfo - * - * @param \Algolia\AlgoliaSearch\Model\RankingInfo|null $rankingInfo rankingInfo - * - * @return self - */ - public function setRankingInfo($rankingInfo) - { - $this->container['rankingInfo'] = $rankingInfo; - - return $this; - } - - /** - * Gets distinctSeqID - * - * @return int|null - */ - public function getDistinctSeqID() - { - return $this->container['distinctSeqID']; - } - - /** - * Sets distinctSeqID - * - * @param int|null $distinctSeqID distinctSeqID - * - * @return self - */ - public function setDistinctSeqID($distinctSeqID) - { - $this->container['distinctSeqID'] = $distinctSeqID; - - return $this; - } - - /** - * Gets score - * - * @return float - */ - public function getScore() - { - return $this->container['score']; - } - - /** - * Sets score - * - * @param float $score the recommendation score - * - * @return self - */ - public function setScore($score) - { - if (($score > 100)) { - throw new \InvalidArgumentException('invalid value for $score when calling RecommendRecord., must be smaller than or equal to 100.'); - } - if (($score < 0)) { - throw new \InvalidArgumentException('invalid value for $score when calling RecommendRecord., must be bigger than or equal to 0.'); - } - - $this->container['score'] = $score; - - 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/Record.php b/clients/algoliasearch-client-php/lib/Model/Record.php deleted file mode 100644 index 8865c7c54c..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/Record.php +++ /dev/null @@ -1,416 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class Record implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'record'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'objectID' => 'string', - 'highlightResult' => '\Algolia\AlgoliaSearch\Model\HighlightResult', - 'snippetResult' => '\Algolia\AlgoliaSearch\Model\SnippetResult', - 'rankingInfo' => '\Algolia\AlgoliaSearch\Model\RankingInfo', - 'distinctSeqID' => 'int', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'objectID' => null, - 'highlightResult' => null, - 'snippetResult' => null, - 'rankingInfo' => null, - 'distinctSeqID' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'objectID' => 'objectID', - 'highlightResult' => '_highlightResult', - 'snippetResult' => '_snippetResult', - 'rankingInfo' => '_rankingInfo', - 'distinctSeqID' => '_distinctSeqID', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'objectID' => 'setObjectID', - 'highlightResult' => 'setHighlightResult', - 'snippetResult' => 'setSnippetResult', - 'rankingInfo' => 'setRankingInfo', - 'distinctSeqID' => 'setDistinctSeqID', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'objectID' => 'getObjectID', - 'highlightResult' => 'getHighlightResult', - 'snippetResult' => 'getSnippetResult', - 'rankingInfo' => 'getRankingInfo', - 'distinctSeqID' => 'getDistinctSeqID', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['objectID'] = $data['objectID'] ?? null; - $this->container['highlightResult'] = $data['highlightResult'] ?? null; - $this->container['snippetResult'] = $data['snippetResult'] ?? null; - $this->container['rankingInfo'] = $data['rankingInfo'] ?? null; - $this->container['distinctSeqID'] = $data['distinctSeqID'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['objectID'] === null) { - $invalidProperties[] = "'objectID' 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 objectID - * - * @return string - */ - public function getObjectID() - { - return $this->container['objectID']; - } - - /** - * Sets objectID - * - * @param string $objectID unique identifier of the object - * - * @return self - */ - public function setObjectID($objectID) - { - $this->container['objectID'] = $objectID; - - return $this; - } - - /** - * Gets highlightResult - * - * @return \Algolia\AlgoliaSearch\Model\HighlightResult|null - */ - public function getHighlightResult() - { - return $this->container['highlightResult']; - } - - /** - * Sets highlightResult - * - * @param \Algolia\AlgoliaSearch\Model\HighlightResult|null $highlightResult highlightResult - * - * @return self - */ - public function setHighlightResult($highlightResult) - { - $this->container['highlightResult'] = $highlightResult; - - return $this; - } - - /** - * Gets snippetResult - * - * @return \Algolia\AlgoliaSearch\Model\SnippetResult|null - */ - public function getSnippetResult() - { - return $this->container['snippetResult']; - } - - /** - * Sets snippetResult - * - * @param \Algolia\AlgoliaSearch\Model\SnippetResult|null $snippetResult snippetResult - * - * @return self - */ - public function setSnippetResult($snippetResult) - { - $this->container['snippetResult'] = $snippetResult; - - return $this; - } - - /** - * Gets rankingInfo - * - * @return \Algolia\AlgoliaSearch\Model\RankingInfo|null - */ - public function getRankingInfo() - { - return $this->container['rankingInfo']; - } - - /** - * Sets rankingInfo - * - * @param \Algolia\AlgoliaSearch\Model\RankingInfo|null $rankingInfo rankingInfo - * - * @return self - */ - public function setRankingInfo($rankingInfo) - { - $this->container['rankingInfo'] = $rankingInfo; - - return $this; - } - - /** - * Gets distinctSeqID - * - * @return int|null - */ - public function getDistinctSeqID() - { - return $this->container['distinctSeqID']; - } - - /** - * Sets distinctSeqID - * - * @param int|null $distinctSeqID distinctSeqID - * - * @return self - */ - public function setDistinctSeqID($distinctSeqID) - { - $this->container['distinctSeqID'] = $distinctSeqID; - - 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/SearchParams.php b/clients/algoliasearch-client-php/lib/Model/SearchParams.php index 8753205295..ec002c5001 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/SearchParams.php @@ -31,6 +31,7 @@ class SearchParams implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'params' => 'string', 'similarQuery' => 'string', 'filters' => 'string', 'facetFilters' => 'string[]', @@ -118,6 +119,7 @@ class SearchParams implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'params' => null, 'similarQuery' => null, 'filters' => null, 'facetFilters' => null, @@ -224,6 +226,7 @@ public static function openAPIFormats() * @var string[] */ protected static $attributeMap = [ + 'params' => 'params', 'similarQuery' => 'similarQuery', 'filters' => 'filters', 'facetFilters' => 'facetFilters', @@ -309,6 +312,7 @@ public static function openAPIFormats() * @var string[] */ protected static $setters = [ + 'params' => 'setParams', 'similarQuery' => 'setSimilarQuery', 'filters' => 'setFilters', 'facetFilters' => 'setFacetFilters', @@ -394,6 +398,7 @@ public static function openAPIFormats() * @var string[] */ protected static $getters = [ + 'params' => 'getParams', 'similarQuery' => 'getSimilarQuery', 'filters' => 'getFilters', 'facetFilters' => 'getFacetFilters', @@ -634,6 +639,7 @@ public function getAdvancedSyntaxFeaturesAllowableValues() */ public function __construct(array $data = null) { + $this->container['params'] = $data['params'] ?? ''; $this->container['similarQuery'] = $data['similarQuery'] ?? ''; $this->container['filters'] = $data['filters'] ?? ''; $this->container['facetFilters'] = $data['facetFilters'] ?? null; @@ -807,6 +813,30 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** + * Gets params + * + * @return string|null + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param string|null $params search parameters as URL-encoded query string + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + /** * Gets similarQuery * diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php b/clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php deleted file mode 100644 index b7e8b73076..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsObject.php +++ /dev/null @@ -1,386 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class SearchUserIdsObject implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'searchUserIdsObject'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'query' => 'string', - 'clusterName' => 'string', - 'page' => 'int', - 'hitsPerPage' => 'int', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'query' => null, - 'clusterName' => null, - 'page' => null, - 'hitsPerPage' => null, - ]; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'query' => 'query', - 'clusterName' => 'clusterName', - 'page' => 'page', - 'hitsPerPage' => 'hitsPerPage', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'query' => 'setQuery', - 'clusterName' => 'setClusterName', - 'page' => 'setPage', - 'hitsPerPage' => 'setHitsPerPage', - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'query' => 'getQuery', - 'clusterName' => 'getClusterName', - 'page' => 'getPage', - 'hitsPerPage' => 'getHitsPerPage', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['query'] = $data['query'] ?? null; - $this->container['clusterName'] = $data['clusterName'] ?? null; - $this->container['page'] = $data['page'] ?? 0; - $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['query'] === null) { - $invalidProperties[] = "'query' 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 query - * - * @return string - */ - public function getQuery() - { - return $this->container['query']; - } - - /** - * Sets query - * - * @param string $query Query to search. The search is a prefix search with typoTolerance. Use empty query to retrieve all users. - * - * @return self - */ - public function setQuery($query) - { - $this->container['query'] = $query; - - return $this; - } - - /** - * Gets clusterName - * - * @return string|null - */ - public function getClusterName() - { - return $this->container['clusterName']; - } - - /** - * Sets clusterName - * - * @param string|null $clusterName name of the cluster - * - * @return self - */ - public function setClusterName($clusterName) - { - $this->container['clusterName'] = $clusterName; - - return $this; - } - - /** - * Gets page - * - * @return int|null - */ - public function getPage() - { - return $this->container['page']; - } - - /** - * Sets page - * - * @param int|null $page specify the page to retrieve - * - * @return self - */ - public function setPage($page) - { - $this->container['page'] = $page; - - return $this; - } - - /** - * Gets hitsPerPage - * - * @return int|null - */ - public function getHitsPerPage() - { - return $this->container['hitsPerPage']; - } - - /** - * Sets hitsPerPage - * - * @param int|null $hitsPerPage set the number of hits per page - * - * @return self - */ - public function setHitsPerPage($hitsPerPage) - { - $this->container['hitsPerPage'] = $hitsPerPage; - - 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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - diff --git a/clients/algoliasearch-client-php/lib/Model/SourceIndexWithReplicas.php b/clients/algoliasearch-client-php/lib/Model/SourceIndexWithReplicas.php deleted file mode 100644 index 0a3789713f..0000000000 --- a/clients/algoliasearch-client-php/lib/Model/SourceIndexWithReplicas.php +++ /dev/null @@ -1,525 +0,0 @@ - - * @template TKey int|null - * @template TValue mixed|null - */ -class SourceIndexWithReplicas implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'SourceIndexWithReplicas'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'indexName' => 'string', - 'replicas' => 'bool', - 'analyticsTags' => 'string[]', - 'facets' => 'object[]', - 'minHits' => 'int', - 'minLetters' => 'int', - 'generate' => 'string[][]', - 'external' => '\Algolia\AlgoliaSearch\Model\SourceIndexExternal[]', - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'indexName' => null, - 'replicas' => 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 openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'indexName' => 'indexName', - 'replicas' => 'replicas', - 'analyticsTags' => 'analyticsTags', - 'facets' => 'facets', - 'minHits' => 'minHits', - 'minLetters' => 'minLetters', - 'generate' => 'generate', - 'external' => 'external', - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'indexName' => 'setIndexName', - 'replicas' => 'setReplicas', - '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 = [ - 'indexName' => 'getIndexName', - 'replicas' => 'getReplicas', - 'analyticsTags' => 'getAnalyticsTags', - 'facets' => 'getFacets', - 'minHits' => 'getMinHits', - 'minLetters' => 'getMinLetters', - 'generate' => 'getGenerate', - 'external' => 'getExternal', - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * 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; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->container['indexName'] = $data['indexName'] ?? null; - $this->container['replicas'] = $data['replicas'] ?? null; - $this->container['analyticsTags'] = $data['analyticsTags'] ?? null; - $this->container['facets'] = $data['facets'] ?? null; - $this->container['minHits'] = $data['minHits'] ?? null; - $this->container['minLetters'] = $data['minLetters'] ?? null; - $this->container['generate'] = $data['generate'] ?? null; - $this->container['external'] = $data['external'] ?? null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['indexName'] === null) { - $invalidProperties[] = "'indexName' can't be null"; - } - if ($this->container['replicas'] === null) { - $invalidProperties[] = "'replicas' can't be null"; - } - if ($this->container['analyticsTags'] === null) { - $invalidProperties[] = "'analyticsTags' can't be null"; - } - if ($this->container['facets'] === null) { - $invalidProperties[] = "'facets' can't be null"; - } - if ($this->container['minHits'] === null) { - $invalidProperties[] = "'minHits' can't be null"; - } - if ($this->container['minLetters'] === null) { - $invalidProperties[] = "'minLetters' can't be null"; - } - if ($this->container['generate'] === null) { - $invalidProperties[] = "'generate' can't be null"; - } - if ($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 indexName - * - * @return string - */ - public function getIndexName() - { - return $this->container['indexName']; - } - - /** - * Sets indexName - * - * @param string $indexName source index name - * - * @return self - */ - public function setIndexName($indexName) - { - $this->container['indexName'] = $indexName; - - return $this; - } - - /** - * Gets replicas - * - * @return bool - */ - public function getReplicas() - { - return $this->container['replicas']; - } - - /** - * 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 analyticsTags - * - * @return string[] - */ - public function getAnalyticsTags() - { - return $this->container['analyticsTags']; - } - - /** - * 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']; - } - - /** - * 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']; - } - - /** - * 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']; - } - - /** - * 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']; - } - - /** - * 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\SourceIndexExternal[] - */ - public function getExternal() - { - return $this->container['external']; - } - - /** - * Sets external - * - * @param \Algolia\AlgoliaSearch\Model\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]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource - */ - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - From dbc8d81803bb917ca3647133563c32bcb7d2b1fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vannicatte?= Date: Wed, 2 Feb 2022 14:26:28 +0100 Subject: [PATCH 19/26] split models per client --- .../lib/Api/AbtestingApi.php | 12 +- .../lib/Api/AnalyticsApi.php | 34 +- .../lib/Api/InsightsApi.php | 4 +- .../lib/Api/PersonalizationApi.php | 10 +- .../lib/Api/QuerySuggestionsApi.php | 18 +- .../lib/Api/RecommendApi.php | 4 +- .../lib/Api/SearchApi.php | 166 +- .../lib/Model/{ => ABTesting}/ABTest.php | 8 +- .../Model/{ => ABTesting}/ABTestResponse.php | 2 +- .../Model/{ => ABTesting}/AbTestsVariant.php | 2 +- .../AbTestsVariantSearchParams.php | 2 +- .../{ => ABTesting}/AddABTestsRequest.php | 8 +- .../{ => ABTesting}/AddABTestsVariant.php | 2 +- .../{ => ABTesting}/CustomSearchParams.php | 2 +- .../lib/Model/ABTesting/ErrorBase.php | 292 ++ .../{ => ABTesting}/ListABTestsResponse.php | 8 +- .../lib/Model/ABTesting/ModelInterface.php | 68 + .../lib/Model/{ => ABTesting}/Variant.php | 2 +- .../lib/Model/Analytics/ErrorBase.php | 292 ++ .../GetAverageClickPositionResponse.php | 8 +- .../GetAverageClickPositionResponseDates.php | 2 +- .../GetClickPositionsResponse.php | 8 +- .../GetClickPositionsResponsePositions.php | 2 +- .../GetClickThroughRateResponse.php | 8 +- .../GetClickThroughRateResponseDates.php | 2 +- .../GetConversationRateResponse.php | 8 +- .../GetConversationRateResponseDates.php | 2 +- .../GetNoClickRateResponse.php | 8 +- .../GetNoClickRateResponseDates.php | 2 +- .../GetNoResultsRateResponse.php | 8 +- .../GetNoResultsRateResponseDates.php | 2 +- .../GetSearchesCountResponse.php | 8 +- .../GetSearchesCountResponseDates.php | 2 +- .../GetSearchesNoClicksResponse.php | 8 +- .../GetSearchesNoClicksResponseSearches.php | 2 +- .../GetSearchesNoResultsResponse.php | 8 +- .../GetSearchesNoResultsResponseSearches.php | 2 +- .../{ => Analytics}/GetStatusResponse.php | 2 +- .../GetTopCountriesResponse.php | 8 +- .../GetTopCountriesResponseCountries.php | 2 +- .../{ => Analytics}/GetTopFilterAttribute.php | 2 +- .../GetTopFilterAttributesResponse.php | 8 +- .../GetTopFilterForAttribute.php | 2 +- .../GetTopFilterForAttributeResponse.php | 8 +- .../GetTopFiltersNoResultsResponse.php | 8 +- .../GetTopFiltersNoResultsValue.php | 2 +- .../GetTopFiltersNoResultsValues.php | 8 +- .../{ => Analytics}/GetTopHitsResponse.php | 8 +- .../GetTopHitsResponseHits.php | 2 +- .../GetTopHitsResponseWithAnalytics.php | 8 +- .../GetTopHitsResponseWithAnalyticsHits.php | 2 +- .../GetTopSearchesResponse.php | 8 +- .../GetTopSearchesResponseWithAnalytics.php | 8 +- ...pSearchesResponseWithAnalyticsSearches.php | 2 +- .../{ => Analytics}/GetUsersCountResponse.php | 8 +- .../lib/Model/Analytics/ModelInterface.php | 68 + .../lib/Model/Insights/ErrorBase.php | 292 ++ .../lib/Model/{ => Insights}/InsightEvent.php | 2 +- .../Model/{ => Insights}/InsightEvents.php | 8 +- .../lib/Model/Insights/ModelInterface.php | 68 + .../{ => Insights}/PushEventsResponse.php | 2 +- .../DeleteUserProfileResponse.php | 2 +- .../lib/Model/Personalization/ErrorBase.php | 292 ++ .../{ => Personalization}/EventScoring.php | 2 +- .../{ => Personalization}/FacetScoring.php | 2 +- .../GetUserTokenResponse.php | 2 +- .../Model/Personalization/ModelInterface.php | 68 + .../PersonalizationStrategyParams.php | 14 +- .../SetPersonalizationStrategyResponse.php | 2 +- .../lib/Model/QuerySuggestions/ErrorBase.php | 292 ++ .../{ => QuerySuggestions}/IndexName.php | 2 +- .../Model/{ => QuerySuggestions}/LogFile.php | 2 +- .../Model/QuerySuggestions/ModelInterface.php | 68 + .../QuerySuggestionsIndex.php | 8 +- .../QuerySuggestionsIndexParam.php | 8 +- .../QuerySuggestionsIndexWithIndexParam.php | 8 +- .../{ => QuerySuggestions}/SourceIndex.php | 8 +- .../SourceIndexExternal.php | 2 +- .../SourceIndiceWithReplicas.php | 8 +- .../Model/{ => QuerySuggestions}/Status.php | 2 +- .../{ => QuerySuggestions}/SucessResponse.php | 2 +- .../lib/Model/Recommend/BaseSearchParams.php | 1243 ++++++++ .../Model/Recommend/BaseSearchResponse.php | 1016 ++++++ .../BaseSearchResponseFacetsStats.php | 380 +++ .../lib/Model/Recommend/ErrorBase.php | 292 ++ .../{ => Recommend}/GetRecommendations.php | 8 +- .../GetRecommendationsResponse.php | 8 +- .../lib/Model/Recommend/HighlightResult.php | 419 +++ .../Recommend/IndexSettingsAsSearchParams.php | 1817 +++++++++++ .../lib/Model/Recommend/ModelInterface.php | 68 + .../lib/Model/Recommend/RankingInfo.php | 590 ++++ .../RankingInfoMatchedGeoLocation.php | 350 ++ .../Model/{ => Recommend}/RecommendHit.php | 20 +- .../Model/{ => Recommend}/RecommendHits.php | 8 +- .../{ => Recommend}/RecommendationRequest.php | 14 +- .../RecommendationsResponse.php | 14 +- .../Model/Recommend/RequiredSearchParams.php | 294 ++ .../lib/Model/Recommend/SearchParams.php | 2833 +++++++++++++++++ .../lib/Model/Recommend/SnippetResult.php | 357 +++ .../lib/Model/{ => Search}/Action.php | 2 +- .../Model/{ => Search}/AddApiKeyResponse.php | 2 +- .../lib/Model/{ => Search}/Anchoring.php | 2 +- .../lib/Model/{ => Search}/ApiKey.php | 2 +- .../Model/{ => Search}/AssignUserIdParams.php | 2 +- .../{ => Search}/AutomaticFacetFilter.php | 2 +- .../Model/{ => Search}/BaseBrowseResponse.php | 2 +- .../Model/{ => Search}/BaseIndexSettings.php | 2 +- .../Model/{ => Search}/BaseSearchParams.php | 2 +- .../Model/{ => Search}/BaseSearchResponse.php | 8 +- .../BaseSearchResponseFacetsStats.php | 2 +- .../{ => Search}/BatchAssignUserIdsParams.php | 2 +- .../{ => Search}/BatchDictionaryEntries.php | 8 +- .../BatchDictionaryEntriesRequest.php | 14 +- .../lib/Model/{ => Search}/BatchParams.php | 8 +- .../lib/Model/{ => Search}/BatchResponse.php | 2 +- .../Model/{ => Search}/BatchWriteParams.php | 8 +- .../lib/Model/{ => Search}/BrowseRequest.php | 2 +- .../lib/Model/{ => Search}/BrowseResponse.php | 14 +- .../Model/{ => Search}/BuiltInOperation.php | 2 +- .../lib/Model/{ => Search}/Condition.php | 8 +- .../lib/Model/{ => Search}/Consequence.php | 20 +- .../Model/{ => Search}/ConsequenceHide.php | 2 +- .../Model/{ => Search}/ConsequenceParams.php | 14 +- .../Model/{ => Search}/CreatedAtObject.php | 2 +- .../Model/{ => Search}/CreatedAtResponse.php | 2 +- .../{ => Search}/DeleteApiKeyResponse.php | 2 +- .../{ => Search}/DeleteSourceResponse.php | 2 +- .../Model/{ => Search}/DeletedAtResponse.php | 2 +- .../Model/{ => Search}/DictionaryAction.php | 2 +- .../Model/{ => Search}/DictionaryEntry.php | 8 +- .../{ => Search}/DictionaryEntryState.php | 2 +- .../Model/{ => Search}/DictionaryLanguage.php | 2 +- .../DictionarySettingsRequest.php | 8 +- .../lib/Model/{ => Search}/ErrorBase.php | 2 +- .../GetDictionarySettingsResponse.php | 8 +- .../Model/{ => Search}/GetLogsResponse.php | 8 +- .../GetLogsResponseInnerQueries.php | 2 +- .../{ => Search}/GetLogsResponseLogs.php | 8 +- .../Model/{ => Search}/GetObjectsParams.php | 8 +- .../Model/{ => Search}/GetObjectsResponse.php | 2 +- .../Model/{ => Search}/GetTaskResponse.php | 2 +- .../{ => Search}/GetTopUserIdsResponse.php | 8 +- .../Model/{ => Search}/HighlightResult.php | 2 +- .../lib/Model/{ => Search}/Hit.php | 20 +- .../lib/Model/{ => Search}/IndexSettings.php | 2 +- .../IndexSettingsAsSearchParams.php | 2 +- .../lib/Model/{ => Search}/Indice.php | 2 +- .../lib/Model/{ => Search}/Key.php | 2 +- .../lib/Model/{ => Search}/Languages.php | 20 +- .../{ => Search}/ListApiKeysResponse.php | 8 +- .../{ => Search}/ListClustersResponse.php | 2 +- .../{ => Search}/ListIndicesResponse.php | 8 +- .../{ => Search}/ListUserIdsResponse.php | 8 +- .../lib/Model/{ => Search}/ModelInterface.php | 4 +- .../{ => Search}/MultipleBatchResponse.php | 2 +- .../{ => Search}/MultipleGetObjectsParams.php | 2 +- .../Model/{ => Search}/MultipleQueries.php | 8 +- .../{ => Search}/MultipleQueriesParams.php | 14 +- .../{ => Search}/MultipleQueriesResponse.php | 8 +- .../{ => Search}/MultipleQueriesStrategy.php | 2 +- .../{ => Search}/MultipleQueriesType.php | 2 +- .../lib/Model/{ => Search}/Operation.php | 8 +- .../{ => Search}/OperationIndexParams.php | 14 +- .../lib/Model/{ => Search}/OperationType.php | 2 +- .../lib/Model/{ => Search}/Params.php | 14 +- .../lib/Model/{ => Search}/Promote.php | 2 +- .../lib/Model/{ => Search}/RankingInfo.php | 8 +- .../RankingInfoMatchedGeoLocation.php | 2 +- .../{ => Search}/RemoveUserIdResponse.php | 2 +- .../{ => Search}/ReplaceSourceResponse.php | 2 +- .../{ => Search}/RequiredSearchParams.php | 2 +- .../lib/Model/{ => Search}/Rule.php | 20 +- .../Model/{ => Search}/SaveObjectResponse.php | 2 +- .../{ => Search}/SaveSynonymResponse.php | 2 +- .../lib/Model/{ => Search}/ScopeType.php | 2 +- .../{ => Search}/SearchDictionaryEntries.php | 2 +- .../SearchForFacetValuesRequest.php | 2 +- .../SearchForFacetValuesResponse.php | 8 +- .../SearchForFacetValuesResponseFacetHits.php | 2 +- .../lib/Model/{ => Search}/SearchHits.php | 8 +- .../lib/Model/{ => Search}/SearchParams.php | 2 +- .../Model/{ => Search}/SearchParamsObject.php | 2 +- .../Model/{ => Search}/SearchParamsString.php | 2 +- .../lib/Model/{ => Search}/SearchResponse.php | 14 +- .../Model/{ => Search}/SearchRulesParams.php | 8 +- .../{ => Search}/SearchRulesResponse.php | 8 +- .../{ => Search}/SearchSynonymsResponse.php | 8 +- .../{ => Search}/SearchUserIdsParams.php | 2 +- .../{ => Search}/SearchUserIdsResponse.php | 8 +- .../SearchUserIdsResponseHighlightResult.php | 14 +- .../SearchUserIdsResponseHits.php | 8 +- .../lib/Model/{ => Search}/SnippetResult.php | 2 +- .../lib/Model/{ => Search}/Source.php | 2 +- .../Model/{ => Search}/StandardEntries.php | 2 +- .../lib/Model/{ => Search}/SynonymHit.php | 14 +- .../SynonymHitHighlightResult.php | 14 +- .../lib/Model/{ => Search}/SynonymType.php | 2 +- .../lib/Model/{ => Search}/TimeRange.php | 2 +- .../{ => Search}/UpdateApiKeyResponse.php | 2 +- .../Model/{ => Search}/UpdatedAtResponse.php | 2 +- .../UpdatedAtWithObjectIdResponse.php | 2 +- .../{ => Search}/UpdatedRuleResponse.php | 2 +- .../lib/Model/{ => Search}/UserId.php | 2 +- .../lib/ObjectSerializer.php | 2 +- openapitools.json | 21 +- 205 files changed, 12067 insertions(+), 601 deletions(-) rename clients/algoliasearch-client-php/lib/Model/{ => ABTesting}/ABTest.php (97%) rename clients/algoliasearch-client-php/lib/Model/{ => ABTesting}/ABTestResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => ABTesting}/AbTestsVariant.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => ABTesting}/AbTestsVariantSearchParams.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => ABTesting}/AddABTestsRequest.php (96%) rename clients/algoliasearch-client-php/lib/Model/{ => ABTesting}/AddABTestsVariant.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => ABTesting}/CustomSearchParams.php (99%) create mode 100644 clients/algoliasearch-client-php/lib/Model/ABTesting/ErrorBase.php rename clients/algoliasearch-client-php/lib/Model/{ => ABTesting}/ListABTestsResponse.php (96%) create mode 100644 clients/algoliasearch-client-php/lib/Model/ABTesting/ModelInterface.php rename clients/algoliasearch-client-php/lib/Model/{ => ABTesting}/Variant.php (99%) create mode 100644 clients/algoliasearch-client-php/lib/Model/Analytics/ErrorBase.php rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetAverageClickPositionResponse.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetAverageClickPositionResponseDates.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetClickPositionsResponse.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetClickPositionsResponsePositions.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetClickThroughRateResponse.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetClickThroughRateResponseDates.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetConversationRateResponse.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetConversationRateResponseDates.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetNoClickRateResponse.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetNoClickRateResponseDates.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetNoResultsRateResponse.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetNoResultsRateResponseDates.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetSearchesCountResponse.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetSearchesCountResponseDates.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetSearchesNoClicksResponse.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetSearchesNoClicksResponseSearches.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetSearchesNoResultsResponse.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetSearchesNoResultsResponseSearches.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetStatusResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopCountriesResponse.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopCountriesResponseCountries.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopFilterAttribute.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopFilterAttributesResponse.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopFilterForAttribute.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopFilterForAttributeResponse.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopFiltersNoResultsResponse.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopFiltersNoResultsValue.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopFiltersNoResultsValues.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopHitsResponse.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopHitsResponseHits.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopHitsResponseWithAnalytics.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopHitsResponseWithAnalyticsHits.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopSearchesResponse.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopSearchesResponseWithAnalytics.php (93%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetTopSearchesResponseWithAnalyticsSearches.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Analytics}/GetUsersCountResponse.php (95%) create mode 100644 clients/algoliasearch-client-php/lib/Model/Analytics/ModelInterface.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Insights/ErrorBase.php rename clients/algoliasearch-client-php/lib/Model/{ => Insights}/InsightEvent.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Insights}/InsightEvents.php (95%) create mode 100644 clients/algoliasearch-client-php/lib/Model/Insights/ModelInterface.php rename clients/algoliasearch-client-php/lib/Model/{ => Insights}/PushEventsResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Personalization}/DeleteUserProfileResponse.php (99%) create mode 100644 clients/algoliasearch-client-php/lib/Model/Personalization/ErrorBase.php rename clients/algoliasearch-client-php/lib/Model/{ => Personalization}/EventScoring.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Personalization}/FacetScoring.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Personalization}/GetUserTokenResponse.php (99%) create mode 100644 clients/algoliasearch-client-php/lib/Model/Personalization/ModelInterface.php rename clients/algoliasearch-client-php/lib/Model/{ => Personalization}/PersonalizationStrategyParams.php (92%) rename clients/algoliasearch-client-php/lib/Model/{ => Personalization}/SetPersonalizationStrategyResponse.php (99%) create mode 100644 clients/algoliasearch-client-php/lib/Model/QuerySuggestions/ErrorBase.php rename clients/algoliasearch-client-php/lib/Model/{ => QuerySuggestions}/IndexName.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => QuerySuggestions}/LogFile.php (99%) create mode 100644 clients/algoliasearch-client-php/lib/Model/QuerySuggestions/ModelInterface.php rename clients/algoliasearch-client-php/lib/Model/{ => QuerySuggestions}/QuerySuggestionsIndex.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => QuerySuggestions}/QuerySuggestionsIndexParam.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => QuerySuggestions}/QuerySuggestionsIndexWithIndexParam.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => QuerySuggestions}/SourceIndex.php (96%) rename clients/algoliasearch-client-php/lib/Model/{ => QuerySuggestions}/SourceIndexExternal.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => QuerySuggestions}/SourceIndiceWithReplicas.php (96%) rename clients/algoliasearch-client-php/lib/Model/{ => QuerySuggestions}/Status.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => QuerySuggestions}/SucessResponse.php (99%) create mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponse.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponseFacetsStats.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/ErrorBase.php rename clients/algoliasearch-client-php/lib/Model/{ => Recommend}/GetRecommendations.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Recommend}/GetRecommendationsResponse.php (94%) create mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/HighlightResult.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/IndexSettingsAsSearchParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/ModelInterface.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/RankingInfo.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/RankingInfoMatchedGeoLocation.php rename clients/algoliasearch-client-php/lib/Model/{ => Recommend}/RecommendHit.php (92%) rename clients/algoliasearch-client-php/lib/Model/{ => Recommend}/RecommendHits.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Recommend}/RecommendationRequest.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Recommend}/RecommendationsResponse.php (97%) create mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/RequiredSearchParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/SearchParams.php create mode 100644 clients/algoliasearch-client-php/lib/Model/Recommend/SnippetResult.php rename clients/algoliasearch-client-php/lib/Model/{ => Search}/Action.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/AddApiKeyResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/Anchoring.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/ApiKey.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/AssignUserIdParams.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/AutomaticFacetFilter.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/BaseBrowseResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/BaseIndexSettings.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/BaseSearchParams.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/BaseSearchResponse.php (98%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/BaseSearchResponseFacetsStats.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/BatchAssignUserIdsParams.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/BatchDictionaryEntries.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/BatchDictionaryEntriesRequest.php (93%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/BatchParams.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/BatchResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/BatchWriteParams.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/BrowseRequest.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/BrowseResponse.php (98%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/BuiltInOperation.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/Condition.php (96%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/Consequence.php (91%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/ConsequenceHide.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/ConsequenceParams.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/CreatedAtObject.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/CreatedAtResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/DeleteApiKeyResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/DeleteSourceResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/DeletedAtResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/DictionaryAction.php (92%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/DictionaryEntry.php (97%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/DictionaryEntryState.php (92%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/DictionaryLanguage.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/DictionarySettingsRequest.php (96%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/ErrorBase.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/GetDictionarySettingsResponse.php (96%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/GetLogsResponse.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/GetLogsResponseInnerQueries.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/GetLogsResponseLogs.php (97%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/GetObjectsParams.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/GetObjectsResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/GetTaskResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/GetTopUserIdsResponse.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/HighlightResult.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/Hit.php (91%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/IndexSettings.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/IndexSettingsAsSearchParams.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/Indice.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/Key.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/Languages.php (90%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/ListApiKeysResponse.php (96%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/ListClustersResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/ListIndicesResponse.php (96%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/ListUserIdsResponse.php (96%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/ModelInterface.php (93%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/MultipleBatchResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/MultipleGetObjectsParams.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/MultipleQueries.php (96%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/MultipleQueriesParams.php (92%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/MultipleQueriesResponse.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/MultipleQueriesStrategy.php (92%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/MultipleQueriesType.php (93%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/Operation.php (96%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/OperationIndexParams.php (92%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/OperationType.php (92%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/Params.php (91%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/Promote.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/RankingInfo.php (97%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/RankingInfoMatchedGeoLocation.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/RemoveUserIdResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/ReplaceSourceResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/RequiredSearchParams.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/Rule.php (90%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SaveObjectResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SaveSynonymResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/ScopeType.php (92%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchDictionaryEntries.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchForFacetValuesRequest.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchForFacetValuesResponse.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchForFacetValuesResponseFacetHits.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchHits.php (96%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchParams.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchParamsObject.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchParamsString.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchResponse.php (98%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchRulesParams.php (97%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchRulesResponse.php (97%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchSynonymsResponse.php (96%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchUserIdsParams.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchUserIdsResponse.php (96%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchUserIdsResponseHighlightResult.php (93%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SearchUserIdsResponseHits.php (97%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SnippetResult.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/Source.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/StandardEntries.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SynonymHit.php (95%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SynonymHitHighlightResult.php (92%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/SynonymType.php (94%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/TimeRange.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/UpdateApiKeyResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/UpdatedAtResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/UpdatedAtWithObjectIdResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/UpdatedRuleResponse.php (99%) rename clients/algoliasearch-client-php/lib/Model/{ => Search}/UserId.php (99%) diff --git a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php index cb9898adee..6ff4763cc2 100644 --- a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php +++ b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php @@ -98,12 +98,12 @@ public function getClientConfig() * * Creates a new A/B test with provided configuration. * - * @param \Algolia\AlgoliaSearch\Model\AddABTestsRequest $addABTestsRequest addABTestsRequest (required) + * @param \Algolia\AlgoliaSearch\Model\ABTesting\AddABTestsRequest $addABTestsRequest addABTestsRequest (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\ABTestResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\ABTesting\ABTestResponse|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase */ public function addABTests($addABTestsRequest) { @@ -151,7 +151,7 @@ public function addABTests($addABTestsRequest) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\ABTestResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\ABTesting\ABTestResponse|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase */ public function deleteABTest($id) { @@ -204,7 +204,7 @@ public function deleteABTest($id) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\ABTest|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\ABTesting\ABTest|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase */ public function getABTest($id) { @@ -258,7 +258,7 @@ public function getABTest($id) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\ListABTestsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\ABTesting\ListABTestsResponse|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase */ public function listABTests($offset = 0, $limit = 10) { @@ -316,7 +316,7 @@ public function listABTests($offset = 0, $limit = 10) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\ABTestResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\ABTesting\ABTestResponse|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase|\Algolia\AlgoliaSearch\Model\ABTesting\ErrorBase */ public function stopABTest($id) { diff --git a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php index 8df52cd75b..cb5a55318b 100644 --- a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php @@ -106,7 +106,7 @@ public function getClientConfig() * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetAverageClickPositionResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetAverageClickPositionResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getAverageClickPosition($index, $startDate = null, $endDate = null, $tags = null) { @@ -201,7 +201,7 @@ public function getAverageClickPosition($index, $startDate = null, $endDate = nu * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetClickPositionsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetClickPositionsResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getClickPositions($index, $startDate = null, $endDate = null, $tags = null) { @@ -296,7 +296,7 @@ public function getClickPositions($index, $startDate = null, $endDate = null, $t * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetClickThroughRateResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetClickThroughRateResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getClickThroughRate($index, $startDate = null, $endDate = null, $tags = null) { @@ -391,7 +391,7 @@ public function getClickThroughRate($index, $startDate = null, $endDate = null, * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetConversationRateResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetConversationRateResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getConversationRate($index, $startDate = null, $endDate = null, $tags = null) { @@ -486,7 +486,7 @@ public function getConversationRate($index, $startDate = null, $endDate = null, * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetNoClickRateResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetNoClickRateResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getNoClickRate($index, $startDate = null, $endDate = null, $tags = null) { @@ -581,7 +581,7 @@ public function getNoClickRate($index, $startDate = null, $endDate = null, $tags * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetNoResultsRateResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetNoResultsRateResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getNoResultsRate($index, $startDate = null, $endDate = null, $tags = null) { @@ -676,7 +676,7 @@ public function getNoResultsRate($index, $startDate = null, $endDate = null, $ta * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetSearchesCountResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesCountResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getSearchesCount($index, $startDate = null, $endDate = null, $tags = null) { @@ -773,7 +773,7 @@ public function getSearchesCount($index, $startDate = null, $endDate = null, $ta * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetSearchesNoClicksResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoClicksResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getSearchesNoClicks($index, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) { @@ -890,7 +890,7 @@ public function getSearchesNoClicks($index, $startDate = null, $endDate = null, * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetSearchesNoResultsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoResultsResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getSearchesNoResults($index, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) { @@ -1002,7 +1002,7 @@ public function getSearchesNoResults($index, $startDate = null, $endDate = null, * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetStatusResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetStatusResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getStatus($index) { @@ -1062,7 +1062,7 @@ public function getStatus($index) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetTopCountriesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopCountriesResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getTopCountries($index, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) { @@ -1180,7 +1180,7 @@ public function getTopCountries($index, $startDate = null, $endDate = null, $lim * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetTopFilterAttributesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterAttributesResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getTopFilterAttributes($index, $search = null, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) { @@ -1309,7 +1309,7 @@ public function getTopFilterAttributes($index, $search = null, $startDate = null * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetTopFilterForAttributeResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterForAttributeResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getTopFilterForAttribute($attribute, $index, $search = null, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) { @@ -1451,7 +1451,7 @@ public function getTopFilterForAttribute($attribute, $index, $search = null, $st * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetTopFiltersNoResultsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopFiltersNoResultsResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getTopFiltersNoResults($index, $search = null, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) { @@ -1580,7 +1580,7 @@ public function getTopFiltersNoResults($index, $search = null, $startDate = null * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return OneOfGetTopHitsResponseGetTopHitsResponseWithAnalytics|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return OneOfGetTopHitsResponseGetTopHitsResponseWithAnalytics|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getTopHits($index, $search = null, $clickAnalytics = false, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) { @@ -1720,7 +1720,7 @@ public function getTopHits($index, $search = null, $clickAnalytics = false, $sta * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return OneOfGetTopSearchesResponseGetTopSearchesResponseWithAnalytics|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return OneOfGetTopSearchesResponseGetTopSearchesResponseWithAnalytics|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getTopSearches($index, $clickAnalytics = false, $startDate = null, $endDate = null, $orderBy = 'searchCount', $direction = 'asc', $limit = 10, $offset = 0, $tags = null) { @@ -1865,7 +1865,7 @@ public function getTopSearches($index, $clickAnalytics = false, $startDate = nul * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetUsersCountResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetUsersCountResponse|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase|\Algolia\AlgoliaSearch\Model\Analytics\ErrorBase */ public function getUsersCount($index, $startDate = null, $endDate = null, $tags = null) { diff --git a/clients/algoliasearch-client-php/lib/Api/InsightsApi.php b/clients/algoliasearch-client-php/lib/Api/InsightsApi.php index 56986c96fa..7e6ac367f7 100644 --- a/clients/algoliasearch-client-php/lib/Api/InsightsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/InsightsApi.php @@ -97,12 +97,12 @@ public function getClientConfig() * * Pushes an array of events. * - * @param \Algolia\AlgoliaSearch\Model\InsightEvents $insightEvents insightEvents (required) + * @param \Algolia\AlgoliaSearch\Model\Insights\InsightEvents $insightEvents insightEvents (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\PushEventsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Insights\PushEventsResponse|\Algolia\AlgoliaSearch\Model\Insights\ErrorBase|\Algolia\AlgoliaSearch\Model\Insights\ErrorBase|\Algolia\AlgoliaSearch\Model\Insights\ErrorBase|\Algolia\AlgoliaSearch\Model\Insights\ErrorBase */ public function pushEvents($insightEvents) { diff --git a/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php b/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php index f20762cd3a..327dd3d651 100644 --- a/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php +++ b/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php @@ -103,7 +103,7 @@ public function getClientConfig() * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\DeleteUserProfileResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Personalization\DeleteUserProfileResponse|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase */ public function deleteUserProfile($userToken) { @@ -155,7 +155,7 @@ public function deleteUserProfile($userToken) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\PersonalizationStrategyParams|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Personalization\PersonalizationStrategyParams|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase */ public function getPersonalizationStrategy() { @@ -193,7 +193,7 @@ public function getPersonalizationStrategy() * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetUserTokenResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Personalization\GetUserTokenResponse|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase */ public function getUserTokenProfile($userToken) { @@ -241,12 +241,12 @@ public function getUserTokenProfile($userToken) * * Set a new personalization strategy. * - * @param \Algolia\AlgoliaSearch\Model\PersonalizationStrategyParams $personalizationStrategyParams personalizationStrategyParams (required) + * @param \Algolia\AlgoliaSearch\Model\Personalization\PersonalizationStrategyParams $personalizationStrategyParams personalizationStrategyParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\SetPersonalizationStrategyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Personalization\SetPersonalizationStrategyResponse|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase|\Algolia\AlgoliaSearch\Model\Personalization\ErrorBase */ public function setPersonalizationStrategy($personalizationStrategyParams) { diff --git a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php index edf2293756..d19923e301 100644 --- a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php @@ -98,12 +98,12 @@ public function getClientConfig() * * Create a configuration of a Query Suggestions index. * - * @param \Algolia\AlgoliaSearch\Model\QuerySuggestionsIndexWithIndexParam $querySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam (required) + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\QuerySuggestionsIndexWithIndexParam $querySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\SucessResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SucessResponse|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase */ public function createConfig($querySuggestionsIndexWithIndexParam) { @@ -151,7 +151,7 @@ public function createConfig($querySuggestionsIndexWithIndexParam) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\SucessResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SucessResponse|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase */ public function deleteConfig($indexName) { @@ -203,7 +203,7 @@ public function deleteConfig($indexName) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\QuerySuggestionsIndex[]|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\QuerySuggestionsIndex[]|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase */ public function getAllConfigs() { @@ -241,7 +241,7 @@ public function getAllConfigs() * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\QuerySuggestionsIndex|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\QuerySuggestionsIndex|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase */ public function getConfig($indexName) { @@ -294,7 +294,7 @@ public function getConfig($indexName) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\Status|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\Status|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase */ public function getConfigStatus($indexName) { @@ -347,7 +347,7 @@ public function getConfigStatus($indexName) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\LogFile[]|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\LogFile[]|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase */ public function getLogFile($indexName) { @@ -396,12 +396,12 @@ public function getLogFile($indexName) * Update the configuration of a Query Suggestions index. * * @param string $indexName The index in which to perform the request. (required) - * @param \Algolia\AlgoliaSearch\Model\QuerySuggestionsIndexParam $querySuggestionsIndexParam querySuggestionsIndexParam (required) + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\QuerySuggestionsIndexParam $querySuggestionsIndexParam querySuggestionsIndexParam (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\SucessResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SucessResponse|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase|\Algolia\AlgoliaSearch\Model\QuerySuggestions\ErrorBase */ public function updateConfig($indexName, $querySuggestionsIndexParam) { diff --git a/clients/algoliasearch-client-php/lib/Api/RecommendApi.php b/clients/algoliasearch-client-php/lib/Api/RecommendApi.php index 0e8a133d42..57d2f64716 100644 --- a/clients/algoliasearch-client-php/lib/Api/RecommendApi.php +++ b/clients/algoliasearch-client-php/lib/Api/RecommendApi.php @@ -97,12 +97,12 @@ public function getClientConfig() * * Returns recommendations for a specific model and objectID. * - * @param \Algolia\AlgoliaSearch\Model\GetRecommendations $getRecommendations getRecommendations (required) + * @param \Algolia\AlgoliaSearch\Model\Recommend\GetRecommendations $getRecommendations getRecommendations (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetRecommendationsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Recommend\GetRecommendationsResponse|\Algolia\AlgoliaSearch\Model\Recommend\ErrorBase|\Algolia\AlgoliaSearch\Model\Recommend\ErrorBase|\Algolia\AlgoliaSearch\Model\Recommend\ErrorBase|\Algolia\AlgoliaSearch\Model\Recommend\ErrorBase */ public function getRecommendations($getRecommendations) { diff --git a/clients/algoliasearch-client-php/lib/Api/SearchApi.php b/clients/algoliasearch-client-php/lib/Api/SearchApi.php index 8ef3109bde..7813c157cc 100644 --- a/clients/algoliasearch-client-php/lib/Api/SearchApi.php +++ b/clients/algoliasearch-client-php/lib/Api/SearchApi.php @@ -99,12 +99,12 @@ public function getClientConfig() * * Create a new API key. * - * @param \Algolia\AlgoliaSearch\Model\ApiKey $apiKey apiKey (required) + * @param \Algolia\AlgoliaSearch\Model\Search\ApiKey $apiKey apiKey (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\AddApiKeyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\AddApiKeyResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function addApiKey($apiKey) { @@ -154,7 +154,7 @@ public function addApiKey($apiKey) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdatedAtWithObjectIdResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function addOrUpdateObject($indexName, $objectID, $body) { @@ -225,12 +225,12 @@ public function addOrUpdateObject($indexName, $objectID, $body) * * Add a single source. * - * @param \Algolia\AlgoliaSearch\Model\Source $source The source to add. (required) + * @param \Algolia\AlgoliaSearch\Model\Search\Source $source The source to add. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function appendSource($source) { @@ -274,12 +274,12 @@ public function appendSource($source) * Assign or Move userID * * @param string $xAlgoliaUserID userID to assign. (required) - * @param \Algolia\AlgoliaSearch\Model\AssignUserIdParams $assignUserIdParams assignUserIdParams (required) + * @param \Algolia\AlgoliaSearch\Model\Search\AssignUserIdParams $assignUserIdParams assignUserIdParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function assignUserId($xAlgoliaUserID, $assignUserIdParams) { @@ -343,12 +343,12 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdParams) * Performs multiple write operations in a single API call. * * @param string $indexName The index in which to perform the request. (required) - * @param \Algolia\AlgoliaSearch\Model\BatchWriteParams $batchWriteParams batchWriteParams (required) + * @param \Algolia\AlgoliaSearch\Model\Search\BatchWriteParams $batchWriteParams batchWriteParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\BatchResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\BatchResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function batch($indexName, $batchWriteParams) { @@ -406,12 +406,12 @@ public function batch($indexName, $batchWriteParams) * Batch assign userIDs * * @param string $xAlgoliaUserID userID to assign. (required) - * @param \Algolia\AlgoliaSearch\Model\BatchAssignUserIdsParams $batchAssignUserIdsParams batchAssignUserIdsParams (required) + * @param \Algolia\AlgoliaSearch\Model\Search\BatchAssignUserIdsParams $batchAssignUserIdsParams batchAssignUserIdsParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsParams) { @@ -475,12 +475,12 @@ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsParams) * Send a batch of dictionary entries. * * @param string $dictionaryName The dictionary to search in. (required) - * @param \Algolia\AlgoliaSearch\Model\BatchDictionaryEntries $batchDictionaryEntries batchDictionaryEntries (required) + * @param \Algolia\AlgoliaSearch\Model\Search\BatchDictionaryEntries $batchDictionaryEntries batchDictionaryEntries (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntries) { @@ -538,14 +538,14 @@ public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntries) * Batch Rules. * * @param string $indexName The index in which to perform the request. (required) - * @param \Algolia\AlgoliaSearch\Model\Rule[] $rule rule (required) + * @param \Algolia\AlgoliaSearch\Model\Search\Rule[] $rule rule (required) * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) * @param bool $clearExistingRules When true, existing Rules are cleared before adding this batch. When false, existing Rules are kept. (optional) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearExistingRules = null) { @@ -623,12 +623,12 @@ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearE * Retrieve all index content. * * @param string $indexName The index in which to perform the request. (required) - * @param \Algolia\AlgoliaSearch\Model\BrowseRequest $browseRequest browseRequest (optional) + * @param \Algolia\AlgoliaSearch\Model\Search\BrowseRequest $browseRequest browseRequest (optional) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\BrowseResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\BrowseResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function browse($indexName, $browseRequest = null) { @@ -685,7 +685,7 @@ public function browse($indexName, $browseRequest = null) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function clearAllSynonyms($indexName, $forwardToReplicas = null) { @@ -748,7 +748,7 @@ public function clearAllSynonyms($indexName, $forwardToReplicas = null) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function clearObjects($indexName) { @@ -802,7 +802,7 @@ public function clearObjects($indexName) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function clearRules($indexName, $forwardToReplicas = null) { @@ -865,7 +865,7 @@ public function clearRules($indexName, $forwardToReplicas = null) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\DeleteApiKeyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\DeleteApiKeyResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function deleteApiKey($key) { @@ -914,12 +914,12 @@ public function deleteApiKey($key) * Delete all records matching the query. * * @param string $indexName The index in which to perform the request. (required) - * @param \Algolia\AlgoliaSearch\Model\SearchParams $searchParams searchParams (required) + * @param \Algolia\AlgoliaSearch\Model\Search\SearchParams $searchParams searchParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function deleteBy($indexName, $searchParams) { @@ -981,7 +981,7 @@ public function deleteBy($indexName, $searchParams) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function deleteIndex($indexName) { @@ -1035,7 +1035,7 @@ public function deleteIndex($indexName) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function deleteObject($indexName, $objectID) { @@ -1104,7 +1104,7 @@ public function deleteObject($indexName, $objectID) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) { @@ -1181,7 +1181,7 @@ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\DeleteSourceResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\DeleteSourceResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function deleteSource($source) { @@ -1236,7 +1236,7 @@ public function deleteSource($source) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\DeletedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) { @@ -1313,7 +1313,7 @@ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\Key|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\Key|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function getApiKey($key) { @@ -1365,7 +1365,7 @@ public function getApiKey($key) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return array|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return array|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function getDictionaryLanguages() { @@ -1402,7 +1402,7 @@ public function getDictionaryLanguages() * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetDictionarySettingsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\GetDictionarySettingsResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function getDictionarySettings() { @@ -1443,7 +1443,7 @@ public function getDictionarySettings() * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetLogsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\GetLogsResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function getLogs($offset = 0, $length = 10, $indexName = 'null', $type = 'all') { @@ -1527,7 +1527,7 @@ public function getLogs($offset = 0, $length = 10, $indexName = 'null', $type = * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return array|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return array|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function getObject($indexName, $objectID, $attributesToRetrieve = null) { @@ -1599,12 +1599,12 @@ public function getObject($indexName, $objectID, $attributesToRetrieve = null) * * Retrieve one or more objects. * - * @param \Algolia\AlgoliaSearch\Model\GetObjectsParams $getObjectsParams getObjectsParams (required) + * @param \Algolia\AlgoliaSearch\Model\Search\GetObjectsParams $getObjectsParams getObjectsParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetObjectsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\GetObjectsResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function getObjects($getObjectsParams) { @@ -1653,7 +1653,7 @@ public function getObjects($getObjectsParams) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\Rule|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\Rule|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function getRule($indexName, $objectID) { @@ -1720,7 +1720,7 @@ public function getRule($indexName, $objectID) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\IndexSettings|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\IndexSettings|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function getSettings($indexName) { @@ -1772,7 +1772,7 @@ public function getSettings($indexName) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\Source[]|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\Source[]|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function getSources() { @@ -1811,7 +1811,7 @@ public function getSources() * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\SynonymHit|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\SynonymHit|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function getSynonym($indexName, $objectID) { @@ -1879,7 +1879,7 @@ public function getSynonym($indexName, $objectID) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetTaskResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\GetTaskResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function getTask($indexName, $taskID) { @@ -1945,7 +1945,7 @@ public function getTask($indexName, $taskID) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\GetTopUserIdsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\GetTopUserIdsResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function getTopUserIds() { @@ -1983,7 +1983,7 @@ public function getTopUserIds() * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UserId|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UserId|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function getUserId($userID) { @@ -2039,7 +2039,7 @@ public function getUserId($userID) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\CreatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function hasPendingMappings($getClusters = null) { @@ -2086,7 +2086,7 @@ public function hasPendingMappings($getClusters = null) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\ListApiKeysResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\ListApiKeysResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function listApiKeys() { @@ -2123,7 +2123,7 @@ public function listApiKeys() * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\ListClustersResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\ListClustersResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function listClusters() { @@ -2161,7 +2161,7 @@ public function listClusters() * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\ListIndicesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\ListIndicesResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function listIndices($page = null) { @@ -2210,7 +2210,7 @@ public function listIndices($page = null) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\ListUserIdsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\ListUserIdsResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function listUserIds($page = null, $hitsPerPage = 100) { @@ -2263,12 +2263,12 @@ public function listUserIds($page = null, $hitsPerPage = 100) * * Perform multiple write operations. * - * @param \Algolia\AlgoliaSearch\Model\BatchParams $batchParams batchParams (required) + * @param \Algolia\AlgoliaSearch\Model\Search\BatchParams $batchParams batchParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\MultipleBatchResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\MultipleBatchResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function multipleBatch($batchParams) { @@ -2311,12 +2311,12 @@ public function multipleBatch($batchParams) * * Get search results for the given requests. * - * @param \Algolia\AlgoliaSearch\Model\MultipleQueriesParams $multipleQueriesParams multipleQueriesParams (required) + * @param \Algolia\AlgoliaSearch\Model\Search\MultipleQueriesParams $multipleQueriesParams multipleQueriesParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\MultipleQueriesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\MultipleQueriesResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function multipleQueries($multipleQueriesParams) { @@ -2360,12 +2360,12 @@ public function multipleQueries($multipleQueriesParams) * Copy/move index. * * @param string $indexName The index in which to perform the request. (required) - * @param \Algolia\AlgoliaSearch\Model\OperationIndexParams $operationIndexParams operationIndexParams (required) + * @param \Algolia\AlgoliaSearch\Model\Search\OperationIndexParams $operationIndexParams operationIndexParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function operationIndex($indexName, $operationIndexParams) { @@ -2430,7 +2430,7 @@ public function operationIndex($indexName, $operationIndexParams) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdatedAtWithObjectIdResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdatedAtWithObjectIdResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuiltInOperation, $createIfNotExists = true) { @@ -2516,7 +2516,7 @@ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuiltInOp * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\RemoveUserIdResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\RemoveUserIdResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function removeUserId($userID) { @@ -2567,12 +2567,12 @@ public function removeUserId($userID) * * Replace all allowed sources. * - * @param \Algolia\AlgoliaSearch\Model\Source[] $source The sources to allow. (required) + * @param \Algolia\AlgoliaSearch\Model\Search\Source[] $source The sources to allow. (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\ReplaceSourceResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\ReplaceSourceResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function replaceSources($source) { @@ -2620,7 +2620,7 @@ public function replaceSources($source) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\AddApiKeyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\AddApiKeyResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function restoreApiKey($key) { @@ -2674,7 +2674,7 @@ public function restoreApiKey($key) * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\SaveObjectResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\SaveObjectResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function saveObject($indexName, $body) { @@ -2733,13 +2733,13 @@ public function saveObject($indexName, $body) * * @param string $indexName The index in which to perform the request. (required) * @param string $objectID Unique identifier of an object. (required) - * @param \Algolia\AlgoliaSearch\Model\Rule $rule rule (required) + * @param \Algolia\AlgoliaSearch\Model\Search\Rule $rule rule (required) * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdatedRuleResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdatedRuleResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null) { @@ -2822,13 +2822,13 @@ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null * * @param string $indexName The index in which to perform the request. (required) * @param string $objectID Unique identifier of an object. (required) - * @param \Algolia\AlgoliaSearch\Model\SynonymHit $synonymHit synonymHit (required) + * @param \Algolia\AlgoliaSearch\Model\Search\SynonymHit $synonymHit synonymHit (required) * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\SaveSynonymResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\SaveSynonymResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplicas = null) { @@ -2910,14 +2910,14 @@ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplic * Save a batch of synonyms. * * @param string $indexName The index in which to perform the request. (required) - * @param \Algolia\AlgoliaSearch\Model\SynonymHit[] $synonymHit synonymHit (required) + * @param \Algolia\AlgoliaSearch\Model\Search\SynonymHit[] $synonymHit synonymHit (required) * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) * @param bool $replaceExistingSynonyms Replace all synonyms of the index with the ones sent with this request. (optional) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, $replaceExistingSynonyms = null) { @@ -2995,12 +2995,12 @@ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, * Get search results. * * @param string $indexName The index in which to perform the request. (required) - * @param \Algolia\AlgoliaSearch\Model\SearchParams $searchParams searchParams (required) + * @param \Algolia\AlgoliaSearch\Model\Search\SearchParams $searchParams searchParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\SearchResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\SearchResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function search($indexName, $searchParams) { @@ -3058,12 +3058,12 @@ public function search($indexName, $searchParams) * Search the dictionary entries. * * @param string $dictionaryName The dictionary to search in. (required) - * @param \Algolia\AlgoliaSearch\Model\SearchDictionaryEntries $searchDictionaryEntries searchDictionaryEntries (required) + * @param \Algolia\AlgoliaSearch\Model\Search\SearchDictionaryEntries $searchDictionaryEntries searchDictionaryEntries (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntries) { @@ -3122,12 +3122,12 @@ public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntrie * * @param string $indexName The index in which to perform the request. (required) * @param string $facetName The facet name. (required) - * @param \Algolia\AlgoliaSearch\Model\SearchForFacetValuesRequest $searchForFacetValuesRequest searchForFacetValuesRequest (optional) + * @param \Algolia\AlgoliaSearch\Model\Search\SearchForFacetValuesRequest $searchForFacetValuesRequest searchForFacetValuesRequest (optional) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\SearchForFacetValuesResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function searchForFacetValues($indexName, $facetName, $searchForFacetValuesRequest = null) { @@ -3193,12 +3193,12 @@ public function searchForFacetValues($indexName, $facetName, $searchForFacetValu * Search for rules. * * @param string $indexName The index in which to perform the request. (required) - * @param \Algolia\AlgoliaSearch\Model\SearchRulesParams $searchRulesParams searchRulesParams (required) + * @param \Algolia\AlgoliaSearch\Model\Search\SearchRulesParams $searchRulesParams searchRulesParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\SearchRulesResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\SearchRulesResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function searchRules($indexName, $searchRulesParams) { @@ -3257,14 +3257,14 @@ public function searchRules($indexName, $searchRulesParams) * * @param string $indexName The index in which to perform the request. (required) * @param string $query Search for specific synonyms matching this string. (optional, default to '') - * @param \Algolia\AlgoliaSearch\Model\SynonymType $type Only search for specific types of synonyms. (optional) + * @param \Algolia\AlgoliaSearch\Model\Search\SynonymType $type Only search for specific types of synonyms. (optional) * @param int $page Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). (optional, default to 0) * @param int $hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\SearchSynonymsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\SearchSynonymsResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $hitsPerPage = 100) { @@ -3352,12 +3352,12 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, * * Search userID * - * @param \Algolia\AlgoliaSearch\Model\SearchUserIdsParams $searchUserIdsParams searchUserIdsParams (required) + * @param \Algolia\AlgoliaSearch\Model\Search\SearchUserIdsParams $searchUserIdsParams searchUserIdsParams (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\SearchUserIdsResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\SearchUserIdsResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function searchUserIds($searchUserIdsParams) { @@ -3400,12 +3400,12 @@ public function searchUserIds($searchUserIdsParams) * * Set dictionary settings. * - * @param \Algolia\AlgoliaSearch\Model\DictionarySettingsRequest $dictionarySettingsRequest dictionarySettingsRequest (required) + * @param \Algolia\AlgoliaSearch\Model\Search\DictionarySettingsRequest $dictionarySettingsRequest dictionarySettingsRequest (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function setDictionarySettings($dictionarySettingsRequest) { @@ -3449,13 +3449,13 @@ public function setDictionarySettings($dictionarySettingsRequest) * Update settings of a given indexName. * * @param string $indexName The index in which to perform the request. (required) - * @param \Algolia\AlgoliaSearch\Model\IndexSettings $indexSettings indexSettings (required) + * @param \Algolia\AlgoliaSearch\Model\Search\IndexSettings $indexSettings indexSettings (required) * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function setSettings($indexName, $indexSettings, $forwardToReplicas = null) { @@ -3523,12 +3523,12 @@ public function setSettings($indexName, $indexSettings, $forwardToReplicas = nul * Update an API key. * * @param string $key API Key string. (required) - * @param \Algolia\AlgoliaSearch\Model\ApiKey $apiKey apiKey (required) + * @param \Algolia\AlgoliaSearch\Model\Search\ApiKey $apiKey apiKey (required) * * @throws \Algolia\AlgoliaSearch\ApiException on non-2xx response * @throws \InvalidArgumentException * - * @return \Algolia\AlgoliaSearch\Model\UpdateApiKeyResponse|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase|\Algolia\AlgoliaSearch\Model\ErrorBase + * @return \Algolia\AlgoliaSearch\Model\Search\UpdateApiKeyResponse|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase|\Algolia\AlgoliaSearch\Model\Search\ErrorBase */ public function updateApiKey($key, $apiKey) { diff --git a/clients/algoliasearch-client-php/lib/Model/ABTest.php b/clients/algoliasearch-client-php/lib/Model/ABTesting/ABTest.php similarity index 97% rename from clients/algoliasearch-client-php/lib/Model/ABTest.php rename to clients/algoliasearch-client-php/lib/Model/ABTesting/ABTest.php index 367d549f80..1c04101ecd 100644 --- a/clients/algoliasearch-client-php/lib/Model/ABTest.php +++ b/clients/algoliasearch-client-php/lib/Model/ABTesting/ABTest.php @@ -1,6 +1,6 @@ 'string', 'name' => 'string', 'status' => 'string', - 'variants' => '\Algolia\AlgoliaSearch\Model\Variant[]', + 'variants' => '\Algolia\AlgoliaSearch\Model\ABTesting\Variant[]', ]; /** @@ -413,7 +413,7 @@ public function setStatus($status) /** * Gets variants * - * @return \Algolia\AlgoliaSearch\Model\Variant[] + * @return \Algolia\AlgoliaSearch\Model\ABTesting\Variant[] */ public function getVariants() { @@ -423,7 +423,7 @@ public function getVariants() /** * Sets variants * - * @param \Algolia\AlgoliaSearch\Model\Variant[] $variants list of A/B test variant + * @param \Algolia\AlgoliaSearch\Model\ABTesting\Variant[] $variants list of A/B test variant * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/ABTestResponse.php b/clients/algoliasearch-client-php/lib/Model/ABTesting/ABTestResponse.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/ABTestResponse.php rename to clients/algoliasearch-client-php/lib/Model/ABTesting/ABTestResponse.php index 9ed0975346..9f06fb35b6 100644 --- a/clients/algoliasearch-client-php/lib/Model/ABTestResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ABTesting/ABTestResponse.php @@ -1,6 +1,6 @@ 'string', - 'variant' => '\Algolia\AlgoliaSearch\Model\AddABTestsVariant[]', + 'variant' => '\Algolia\AlgoliaSearch\Model\ABTesting\AddABTestsVariant[]', 'endAt' => 'string', ]; @@ -232,7 +232,7 @@ public function setName($name) /** * Gets variant * - * @return \Algolia\AlgoliaSearch\Model\AddABTestsVariant[] + * @return \Algolia\AlgoliaSearch\Model\ABTesting\AddABTestsVariant[] */ public function getVariant() { @@ -242,7 +242,7 @@ public function getVariant() /** * Sets variant * - * @param \Algolia\AlgoliaSearch\Model\AddABTestsVariant[] $variant list of 2 variants for the A/B test + * @param \Algolia\AlgoliaSearch\Model\ABTesting\AddABTestsVariant[] $variant list of 2 variants for the A/B test * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/AddABTestsVariant.php b/clients/algoliasearch-client-php/lib/Model/ABTesting/AddABTestsVariant.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/AddABTestsVariant.php rename to clients/algoliasearch-client-php/lib/Model/ABTesting/AddABTestsVariant.php index 5a91671eb2..cab9c1032a 100644 --- a/clients/algoliasearch-client-php/lib/Model/AddABTestsVariant.php +++ b/clients/algoliasearch-client-php/lib/Model/ABTesting/AddABTestsVariant.php @@ -1,6 +1,6 @@ + * @template TKey int|null + * @template TValue mixed|null + */ +class ErrorBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ErrorBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/ListABTestsResponse.php b/clients/algoliasearch-client-php/lib/Model/ABTesting/ListABTestsResponse.php similarity index 96% rename from clients/algoliasearch-client-php/lib/Model/ListABTestsResponse.php rename to clients/algoliasearch-client-php/lib/Model/ABTesting/ListABTestsResponse.php index 7cd41af6e9..a1db3cb096 100644 --- a/clients/algoliasearch-client-php/lib/Model/ListABTestsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/ABTesting/ListABTestsResponse.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\ABTest[]', + 'abtests' => '\Algolia\AlgoliaSearch\Model\ABTesting\ABTest[]', 'count' => 'int', 'total' => 'int', ]; @@ -200,7 +200,7 @@ public function valid() /** * Gets abtests * - * @return \Algolia\AlgoliaSearch\Model\ABTest[] + * @return \Algolia\AlgoliaSearch\Model\ABTesting\ABTest[] */ public function getAbtests() { @@ -210,7 +210,7 @@ public function getAbtests() /** * Sets abtests * - * @param \Algolia\AlgoliaSearch\Model\ABTest[] $abtests list of A/B tests + * @param \Algolia\AlgoliaSearch\Model\ABTesting\ABTest[] $abtests list of A/B tests * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/ABTesting/ModelInterface.php b/clients/algoliasearch-client-php/lib/Model/ABTesting/ModelInterface.php new file mode 100644 index 0000000000..64735ed387 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/ABTesting/ModelInterface.php @@ -0,0 +1,68 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ErrorBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ErrorBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetAverageClickPositionResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetAverageClickPositionResponse.php similarity index 95% rename from clients/algoliasearch-client-php/lib/Model/GetAverageClickPositionResponse.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetAverageClickPositionResponse.php index ec407539db..7086b8db65 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetAverageClickPositionResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetAverageClickPositionResponse.php @@ -1,6 +1,6 @@ 'double', 'clickCount' => 'int', - 'dates' => '\Algolia\AlgoliaSearch\Model\GetAverageClickPositionResponseDates[]', + 'dates' => '\Algolia\AlgoliaSearch\Model\Analytics\GetAverageClickPositionResponseDates[]', ]; /** @@ -248,7 +248,7 @@ public function setClickCount($clickCount) /** * Gets dates * - * @return \Algolia\AlgoliaSearch\Model\GetAverageClickPositionResponseDates[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetAverageClickPositionResponseDates[] */ public function getDates() { @@ -258,7 +258,7 @@ public function getDates() /** * Sets dates * - * @param \Algolia\AlgoliaSearch\Model\GetAverageClickPositionResponseDates[] $dates a list of average click position with their date + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetAverageClickPositionResponseDates[] $dates a list of average click position with their date * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetAverageClickPositionResponseDates.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetAverageClickPositionResponseDates.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetAverageClickPositionResponseDates.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetAverageClickPositionResponseDates.php index c55f093ff3..0d1fffe98f 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetAverageClickPositionResponseDates.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetAverageClickPositionResponseDates.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\GetClickPositionsResponsePositions[]', + 'positions' => '\Algolia\AlgoliaSearch\Model\Analytics\GetClickPositionsResponsePositions[]', ]; /** @@ -189,7 +189,7 @@ public function valid() /** * Gets positions * - * @return \Algolia\AlgoliaSearch\Model\GetClickPositionsResponsePositions[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetClickPositionsResponsePositions[] */ public function getPositions() { @@ -199,7 +199,7 @@ public function getPositions() /** * Sets positions * - * @param \Algolia\AlgoliaSearch\Model\GetClickPositionsResponsePositions[] $positions a list of the click positions with their click count + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetClickPositionsResponsePositions[] $positions a list of the click positions with their click count * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetClickPositionsResponsePositions.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickPositionsResponsePositions.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetClickPositionsResponsePositions.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetClickPositionsResponsePositions.php index be74a06fb1..f288f8c02b 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetClickPositionsResponsePositions.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickPositionsResponsePositions.php @@ -1,6 +1,6 @@ 'double', 'clickCount' => 'int', 'trackedSearchCount' => 'int', - 'dates' => '\Algolia\AlgoliaSearch\Model\GetClickThroughRateResponseDates[]', + 'dates' => '\Algolia\AlgoliaSearch\Model\Analytics\GetClickThroughRateResponseDates[]', ]; /** @@ -281,7 +281,7 @@ public function setTrackedSearchCount($trackedSearchCount) /** * Gets dates * - * @return \Algolia\AlgoliaSearch\Model\GetClickThroughRateResponseDates[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetClickThroughRateResponseDates[] */ public function getDates() { @@ -291,7 +291,7 @@ public function getDates() /** * Sets dates * - * @param \Algolia\AlgoliaSearch\Model\GetClickThroughRateResponseDates[] $dates a list of click-through rate events with their date + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetClickThroughRateResponseDates[] $dates a list of click-through rate events with their date * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetClickThroughRateResponseDates.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickThroughRateResponseDates.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetClickThroughRateResponseDates.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetClickThroughRateResponseDates.php index af5e0f50ee..9f326e26fb 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetClickThroughRateResponseDates.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickThroughRateResponseDates.php @@ -1,6 +1,6 @@ 'double', 'trackedSearchCount' => 'int', 'conversionCount' => 'int', - 'dates' => '\Algolia\AlgoliaSearch\Model\GetConversationRateResponseDates[]', + 'dates' => '\Algolia\AlgoliaSearch\Model\Analytics\GetConversationRateResponseDates[]', ]; /** @@ -281,7 +281,7 @@ public function setConversionCount($conversionCount) /** * Gets dates * - * @return \Algolia\AlgoliaSearch\Model\GetConversationRateResponseDates[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetConversationRateResponseDates[] */ public function getDates() { @@ -291,7 +291,7 @@ public function getDates() /** * Sets dates * - * @param \Algolia\AlgoliaSearch\Model\GetConversationRateResponseDates[] $dates a list of conversion events with their date + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetConversationRateResponseDates[] $dates a list of conversion events with their date * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetConversationRateResponseDates.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetConversationRateResponseDates.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetConversationRateResponseDates.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetConversationRateResponseDates.php index cc25e80af8..4f534db2cb 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetConversationRateResponseDates.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetConversationRateResponseDates.php @@ -1,6 +1,6 @@ 'double', 'count' => 'int', 'noClickCount' => 'int', - 'dates' => '\Algolia\AlgoliaSearch\Model\GetNoClickRateResponseDates[]', + 'dates' => '\Algolia\AlgoliaSearch\Model\Analytics\GetNoClickRateResponseDates[]', ]; /** @@ -281,7 +281,7 @@ public function setNoClickCount($noClickCount) /** * Gets dates * - * @return \Algolia\AlgoliaSearch\Model\GetNoClickRateResponseDates[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetNoClickRateResponseDates[] */ public function getDates() { @@ -291,7 +291,7 @@ public function getDates() /** * Sets dates * - * @param \Algolia\AlgoliaSearch\Model\GetNoClickRateResponseDates[] $dates a list of searches without clicks with their date, rate and counts + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetNoClickRateResponseDates[] $dates a list of searches without clicks with their date, rate and counts * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetNoClickRateResponseDates.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoClickRateResponseDates.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetNoClickRateResponseDates.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetNoClickRateResponseDates.php index 67ff2b7012..edaab024c0 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetNoClickRateResponseDates.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoClickRateResponseDates.php @@ -1,6 +1,6 @@ 'double', 'count' => 'int', 'noResultCount' => 'int', - 'dates' => '\Algolia\AlgoliaSearch\Model\GetNoResultsRateResponseDates[]', + 'dates' => '\Algolia\AlgoliaSearch\Model\Analytics\GetNoResultsRateResponseDates[]', ]; /** @@ -281,7 +281,7 @@ public function setNoResultCount($noResultCount) /** * Gets dates * - * @return \Algolia\AlgoliaSearch\Model\GetNoResultsRateResponseDates[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetNoResultsRateResponseDates[] */ public function getDates() { @@ -291,7 +291,7 @@ public function getDates() /** * Sets dates * - * @param \Algolia\AlgoliaSearch\Model\GetNoResultsRateResponseDates[] $dates a list of searches without results with their date, rate and counts + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetNoResultsRateResponseDates[] $dates a list of searches without results with their date, rate and counts * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetNoResultsRateResponseDates.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoResultsRateResponseDates.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetNoResultsRateResponseDates.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetNoResultsRateResponseDates.php index cc440c6f5a..6102718321 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetNoResultsRateResponseDates.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoResultsRateResponseDates.php @@ -1,6 +1,6 @@ 'int', - 'dates' => '\Algolia\AlgoliaSearch\Model\GetSearchesCountResponseDates[]', + 'dates' => '\Algolia\AlgoliaSearch\Model\Analytics\GetSearchesCountResponseDates[]', ]; /** @@ -215,7 +215,7 @@ public function setCount($count) /** * Gets dates * - * @return \Algolia\AlgoliaSearch\Model\GetSearchesCountResponseDates[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesCountResponseDates[] */ public function getDates() { @@ -225,7 +225,7 @@ public function getDates() /** * Sets dates * - * @param \Algolia\AlgoliaSearch\Model\GetSearchesCountResponseDates[] $dates a list of search events with their date and count + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesCountResponseDates[] $dates a list of search events with their date and count * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetSearchesCountResponseDates.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesCountResponseDates.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetSearchesCountResponseDates.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesCountResponseDates.php index 50b609d54b..1844e0be6c 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetSearchesCountResponseDates.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesCountResponseDates.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\GetSearchesNoClicksResponseSearches[]', + 'searches' => '\Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoClicksResponseSearches[]', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets searches * - * @return \Algolia\AlgoliaSearch\Model\GetSearchesNoClicksResponseSearches[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoClicksResponseSearches[] */ public function getSearches() { @@ -192,7 +192,7 @@ public function getSearches() /** * Sets searches * - * @param \Algolia\AlgoliaSearch\Model\GetSearchesNoClicksResponseSearches[] $searches a list of searches with no clicks and their count + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoClicksResponseSearches[] $searches a list of searches with no clicks and their count * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetSearchesNoClicksResponseSearches.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoClicksResponseSearches.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetSearchesNoClicksResponseSearches.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoClicksResponseSearches.php index 2dc01d8049..6e86fe5922 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetSearchesNoClicksResponseSearches.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoClicksResponseSearches.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\GetSearchesNoResultsResponseSearches[]', + 'searches' => '\Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoResultsResponseSearches[]', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets searches * - * @return \Algolia\AlgoliaSearch\Model\GetSearchesNoResultsResponseSearches[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoResultsResponseSearches[] */ public function getSearches() { @@ -192,7 +192,7 @@ public function getSearches() /** * Sets searches * - * @param \Algolia\AlgoliaSearch\Model\GetSearchesNoResultsResponseSearches[] $searches a list of searches with no results and their count + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoResultsResponseSearches[] $searches a list of searches with no results and their count * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetSearchesNoResultsResponseSearches.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoResultsResponseSearches.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetSearchesNoResultsResponseSearches.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoResultsResponseSearches.php index e62d855602..5004bede36 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetSearchesNoResultsResponseSearches.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoResultsResponseSearches.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\GetTopCountriesResponseCountries[]', + 'countries' => '\Algolia\AlgoliaSearch\Model\Analytics\GetTopCountriesResponseCountries[]', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets countries * - * @return \Algolia\AlgoliaSearch\Model\GetTopCountriesResponseCountries[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopCountriesResponseCountries[] */ public function getCountries() { @@ -192,7 +192,7 @@ public function getCountries() /** * Sets countries * - * @param \Algolia\AlgoliaSearch\Model\GetTopCountriesResponseCountries[] $countries a list of countries with their count + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetTopCountriesResponseCountries[] $countries a list of countries with their count * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopCountriesResponseCountries.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopCountriesResponseCountries.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetTopCountriesResponseCountries.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetTopCountriesResponseCountries.php index 9fb9efc54e..00a7c2edbe 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetTopCountriesResponseCountries.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopCountriesResponseCountries.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\GetTopFilterAttribute[]', + 'attributes' => '\Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterAttribute[]', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets attributes * - * @return \Algolia\AlgoliaSearch\Model\GetTopFilterAttribute[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterAttribute[] */ public function getAttributes() { @@ -192,7 +192,7 @@ public function getAttributes() /** * Sets attributes * - * @param \Algolia\AlgoliaSearch\Model\GetTopFilterAttribute[] $attributes a list of attributes with their count + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterAttribute[] $attributes a list of attributes with their count * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopFilterForAttribute.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterForAttribute.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetTopFilterForAttribute.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterForAttribute.php index 2bbecff5be..4283697f8c 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetTopFilterForAttribute.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterForAttribute.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\GetTopFilterForAttribute[]', + 'values' => '\Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterForAttribute[]', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets values * - * @return \Algolia\AlgoliaSearch\Model\GetTopFilterForAttribute[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterForAttribute[] */ public function getValues() { @@ -192,7 +192,7 @@ public function getValues() /** * Sets values * - * @param \Algolia\AlgoliaSearch\Model\GetTopFilterForAttribute[] $values a list of filters for the given attributes + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterForAttribute[] $values a list of filters for the given attributes * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsResponse.php similarity index 94% rename from clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsResponse.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsResponse.php index c0d0433c4b..3e00ac1872 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsResponse.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\GetTopFiltersNoResultsValues[]', + 'values' => '\Algolia\AlgoliaSearch\Model\Analytics\GetTopFiltersNoResultsValues[]', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets values * - * @return \Algolia\AlgoliaSearch\Model\GetTopFiltersNoResultsValues[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopFiltersNoResultsValues[] */ public function getValues() { @@ -192,7 +192,7 @@ public function getValues() /** * Sets values * - * @param \Algolia\AlgoliaSearch\Model\GetTopFiltersNoResultsValues[] $values a list of filters without results + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetTopFiltersNoResultsValues[] $values a list of filters without results * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsValue.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsValue.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsValue.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsValue.php index 1c70c19d13..0913305c66 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetTopFiltersNoResultsValue.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsValue.php @@ -1,6 +1,6 @@ 'int', - 'values' => '\Algolia\AlgoliaSearch\Model\GetTopFiltersNoResultsValue[]', + 'values' => '\Algolia\AlgoliaSearch\Model\Analytics\GetTopFiltersNoResultsValue[]', ]; /** @@ -215,7 +215,7 @@ public function setCount($count) /** * Gets values * - * @return \Algolia\AlgoliaSearch\Model\GetTopFiltersNoResultsValue[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopFiltersNoResultsValue[] */ public function getValues() { @@ -225,7 +225,7 @@ public function getValues() /** * Sets values * - * @param \Algolia\AlgoliaSearch\Model\GetTopFiltersNoResultsValue[] $values a list of filters without results + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetTopFiltersNoResultsValue[] $values a list of filters without results * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopHitsResponse.php similarity index 94% rename from clients/algoliasearch-client-php/lib/Model/GetTopHitsResponse.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetTopHitsResponse.php index 8a035b1f6c..9b5bb6a7c8 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopHitsResponse.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\GetTopHitsResponseHits[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\Analytics\GetTopHitsResponseHits[]', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\GetTopHitsResponseHits[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopHitsResponseHits[] */ public function getHits() { @@ -192,7 +192,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\GetTopHitsResponseHits[] $hits a list of top hits with their count + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetTopHitsResponseHits[] $hits a list of top hits with their count * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseHits.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopHitsResponseHits.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseHits.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetTopHitsResponseHits.php index 28ef3cb704..c6e34f692a 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseHits.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopHitsResponseHits.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\GetTopHitsResponseWithAnalyticsHits[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\Analytics\GetTopHitsResponseWithAnalyticsHits[]', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\GetTopHitsResponseWithAnalyticsHits[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopHitsResponseWithAnalyticsHits[] */ public function getHits() { @@ -192,7 +192,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\GetTopHitsResponseWithAnalyticsHits[] $hits a list of top hits with their count and analytics + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetTopHitsResponseWithAnalyticsHits[] $hits a list of top hits with their count and analytics * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseWithAnalyticsHits.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopHitsResponseWithAnalyticsHits.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseWithAnalyticsHits.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetTopHitsResponseWithAnalyticsHits.php index 79c0f96e23..e1b91a4845 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetTopHitsResponseWithAnalyticsHits.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopHitsResponseWithAnalyticsHits.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\GetSearchesNoResultsResponseSearches[]', + 'searches' => '\Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoResultsResponseSearches[]', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets searches * - * @return \Algolia\AlgoliaSearch\Model\GetSearchesNoResultsResponseSearches[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoResultsResponseSearches[] */ public function getSearches() { @@ -192,7 +192,7 @@ public function getSearches() /** * Sets searches * - * @param \Algolia\AlgoliaSearch\Model\GetSearchesNoResultsResponseSearches[] $searches a list of top searches with their count + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoResultsResponseSearches[] $searches a list of top searches with their count * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponseWithAnalytics.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopSearchesResponseWithAnalytics.php similarity index 93% rename from clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponseWithAnalytics.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetTopSearchesResponseWithAnalytics.php index 0d0db16e04..8921e44f87 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponseWithAnalytics.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopSearchesResponseWithAnalytics.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\GetTopSearchesResponseWithAnalyticsSearches[]', + 'searches' => '\Algolia\AlgoliaSearch\Model\Analytics\GetTopSearchesResponseWithAnalyticsSearches[]', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets searches * - * @return \Algolia\AlgoliaSearch\Model\GetTopSearchesResponseWithAnalyticsSearches[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopSearchesResponseWithAnalyticsSearches[] */ public function getSearches() { @@ -192,7 +192,7 @@ public function getSearches() /** * Sets searches * - * @param \Algolia\AlgoliaSearch\Model\GetTopSearchesResponseWithAnalyticsSearches[] $searches a list of top searches with their count and analytics + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetTopSearchesResponseWithAnalyticsSearches[] $searches a list of top searches with their count and analytics * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponseWithAnalyticsSearches.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopSearchesResponseWithAnalyticsSearches.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponseWithAnalyticsSearches.php rename to clients/algoliasearch-client-php/lib/Model/Analytics/GetTopSearchesResponseWithAnalyticsSearches.php index 78f499d88c..7946edc82a 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetTopSearchesResponseWithAnalyticsSearches.php +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopSearchesResponseWithAnalyticsSearches.php @@ -1,6 +1,6 @@ 'int', - 'dates' => '\Algolia\AlgoliaSearch\Model\GetSearchesCountResponseDates[]', + 'dates' => '\Algolia\AlgoliaSearch\Model\Analytics\GetSearchesCountResponseDates[]', ]; /** @@ -215,7 +215,7 @@ public function setCount($count) /** * Gets dates * - * @return \Algolia\AlgoliaSearch\Model\GetSearchesCountResponseDates[] + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesCountResponseDates[] */ public function getDates() { @@ -225,7 +225,7 @@ public function getDates() /** * Sets dates * - * @param \Algolia\AlgoliaSearch\Model\GetSearchesCountResponseDates[] $dates a list of users count with their date + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesCountResponseDates[] $dates a list of users count with their date * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/ModelInterface.php b/clients/algoliasearch-client-php/lib/Model/Analytics/ModelInterface.php new file mode 100644 index 0000000000..bdaf7d79cb --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/ModelInterface.php @@ -0,0 +1,68 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ErrorBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ErrorBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/InsightEvent.php b/clients/algoliasearch-client-php/lib/Model/Insights/InsightEvent.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/InsightEvent.php rename to clients/algoliasearch-client-php/lib/Model/Insights/InsightEvent.php index a3e9fd6e04..f8382746c5 100644 --- a/clients/algoliasearch-client-php/lib/Model/InsightEvent.php +++ b/clients/algoliasearch-client-php/lib/Model/Insights/InsightEvent.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\InsightEvent[]', + 'events' => '\Algolia\AlgoliaSearch\Model\Insights\InsightEvent[]', ]; /** @@ -184,7 +184,7 @@ public function valid() /** * Gets events * - * @return \Algolia\AlgoliaSearch\Model\InsightEvent[] + * @return \Algolia\AlgoliaSearch\Model\Insights\InsightEvent[] */ public function getEvents() { @@ -194,7 +194,7 @@ public function getEvents() /** * Sets events * - * @param \Algolia\AlgoliaSearch\Model\InsightEvent[] $events array of events sent + * @param \Algolia\AlgoliaSearch\Model\Insights\InsightEvent[] $events array of events sent * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Insights/ModelInterface.php b/clients/algoliasearch-client-php/lib/Model/Insights/ModelInterface.php new file mode 100644 index 0000000000..e5b904db40 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Insights/ModelInterface.php @@ -0,0 +1,68 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ErrorBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ErrorBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/EventScoring.php b/clients/algoliasearch-client-php/lib/Model/Personalization/EventScoring.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/EventScoring.php rename to clients/algoliasearch-client-php/lib/Model/Personalization/EventScoring.php index f0d107ab89..9b0bb392aa 100644 --- a/clients/algoliasearch-client-php/lib/Model/EventScoring.php +++ b/clients/algoliasearch-client-php/lib/Model/Personalization/EventScoring.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\EventScoring[]', - 'facetScoring' => '\Algolia\AlgoliaSearch\Model\FacetScoring[]', + 'eventScoring' => '\Algolia\AlgoliaSearch\Model\Personalization\EventScoring[]', + 'facetScoring' => '\Algolia\AlgoliaSearch\Model\Personalization\FacetScoring[]', 'personalizationImpact' => 'int', ]; @@ -200,7 +200,7 @@ public function valid() /** * Gets eventScoring * - * @return \Algolia\AlgoliaSearch\Model\EventScoring[] + * @return \Algolia\AlgoliaSearch\Model\Personalization\EventScoring[] */ public function getEventScoring() { @@ -210,7 +210,7 @@ public function getEventScoring() /** * Sets eventScoring * - * @param \Algolia\AlgoliaSearch\Model\EventScoring[] $eventScoring scores associated with the events + * @param \Algolia\AlgoliaSearch\Model\Personalization\EventScoring[] $eventScoring scores associated with the events * * @return self */ @@ -224,7 +224,7 @@ public function setEventScoring($eventScoring) /** * Gets facetScoring * - * @return \Algolia\AlgoliaSearch\Model\FacetScoring[] + * @return \Algolia\AlgoliaSearch\Model\Personalization\FacetScoring[] */ public function getFacetScoring() { @@ -234,7 +234,7 @@ public function getFacetScoring() /** * Sets facetScoring * - * @param \Algolia\AlgoliaSearch\Model\FacetScoring[] $facetScoring scores associated with the facets + * @param \Algolia\AlgoliaSearch\Model\Personalization\FacetScoring[] $facetScoring scores associated with the facets * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SetPersonalizationStrategyResponse.php b/clients/algoliasearch-client-php/lib/Model/Personalization/SetPersonalizationStrategyResponse.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/SetPersonalizationStrategyResponse.php rename to clients/algoliasearch-client-php/lib/Model/Personalization/SetPersonalizationStrategyResponse.php index e7c8487322..81fa40477a 100644 --- a/clients/algoliasearch-client-php/lib/Model/SetPersonalizationStrategyResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Personalization/SetPersonalizationStrategyResponse.php @@ -1,6 +1,6 @@ + * @template TKey int|null + * @template TValue mixed|null + */ +class ErrorBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ErrorBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/IndexName.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/IndexName.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/IndexName.php rename to clients/algoliasearch-client-php/lib/Model/QuerySuggestions/IndexName.php index 53adbac337..dee3f5a0fc 100644 --- a/clients/algoliasearch-client-php/lib/Model/IndexName.php +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/IndexName.php @@ -1,6 +1,6 @@ 'string', - 'sourceIndices' => '\Algolia\AlgoliaSearch\Model\SourceIndiceWithReplicas[]', + 'sourceIndices' => '\Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndiceWithReplicas[]', 'languages' => 'string[]', 'exclude' => 'string[]', ]; @@ -233,7 +233,7 @@ public function setIndexName($indexName) /** * Gets sourceIndices * - * @return \Algolia\AlgoliaSearch\Model\SourceIndiceWithReplicas[] + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndiceWithReplicas[] */ public function getSourceIndices() { @@ -243,7 +243,7 @@ public function getSourceIndices() /** * Sets sourceIndices * - * @param \Algolia\AlgoliaSearch\Model\SourceIndiceWithReplicas[] $sourceIndices list of source indices used to generate a Query Suggestions index + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndiceWithReplicas[] $sourceIndices list of source indices used to generate a Query Suggestions index * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndexParam.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndexParam.php similarity index 95% rename from clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndexParam.php rename to clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndexParam.php index a657792718..f96eee4ece 100644 --- a/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndexParam.php +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndexParam.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\SourceIndex[]', + 'sourceIndices' => '\Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndex[]', 'languages' => 'string[]', 'exclude' => 'string[]', ]; @@ -194,7 +194,7 @@ public function valid() /** * Gets sourceIndices * - * @return \Algolia\AlgoliaSearch\Model\SourceIndex[] + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndex[] */ public function getSourceIndices() { @@ -204,7 +204,7 @@ public function getSourceIndices() /** * Sets sourceIndices * - * @param \Algolia\AlgoliaSearch\Model\SourceIndex[] $sourceIndices list of source indices used to generate a Query Suggestions index + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndex[] $sourceIndices list of source indices used to generate a Query Suggestions index * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndexWithIndexParam.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndexWithIndexParam.php similarity index 95% rename from clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndexWithIndexParam.php rename to clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndexWithIndexParam.php index 6ddaf4b39f..5e24cee355 100644 --- a/clients/algoliasearch-client-php/lib/Model/QuerySuggestionsIndexWithIndexParam.php +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndexWithIndexParam.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\SourceIndex[]', + 'sourceIndices' => '\Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndex[]', 'languages' => 'string[]', 'exclude' => 'string[]', 'indexName' => 'string', @@ -203,7 +203,7 @@ public function valid() /** * Gets sourceIndices * - * @return \Algolia\AlgoliaSearch\Model\SourceIndex[] + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndex[] */ public function getSourceIndices() { @@ -213,7 +213,7 @@ public function getSourceIndices() /** * Sets sourceIndices * - * @param \Algolia\AlgoliaSearch\Model\SourceIndex[] $sourceIndices list of source indices used to generate a Query Suggestions index + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndex[] $sourceIndices list of source indices used to generate a Query Suggestions index * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SourceIndex.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndex.php similarity index 96% rename from clients/algoliasearch-client-php/lib/Model/SourceIndex.php rename to clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndex.php index 694af304e5..1e42b978d6 100644 --- a/clients/algoliasearch-client-php/lib/Model/SourceIndex.php +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndex.php @@ -1,6 +1,6 @@ 'int', 'minLetters' => 'int', 'generate' => 'string[][]', - 'external' => '\Algolia\AlgoliaSearch\Model\SourceIndexExternal[]', + 'external' => '\Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[]', ]; /** @@ -362,7 +362,7 @@ public function setGenerate($generate) /** * Gets external * - * @return \Algolia\AlgoliaSearch\Model\SourceIndexExternal[]|null + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[]|null */ public function getExternal() { @@ -372,7 +372,7 @@ public function getExternal() /** * Sets external * - * @param \Algolia\AlgoliaSearch\Model\SourceIndexExternal[]|null $external list of external indices to use to generate custom Query Suggestions + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[]|null $external list of external indices to use to generate custom Query Suggestions * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SourceIndexExternal.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndexExternal.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/SourceIndexExternal.php rename to clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndexExternal.php index 77019cf1ef..0fd072d082 100644 --- a/clients/algoliasearch-client-php/lib/Model/SourceIndexExternal.php +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndexExternal.php @@ -1,6 +1,6 @@ 'int', 'minLetters' => 'int', 'generate' => 'string[][]', - 'external' => '\Algolia\AlgoliaSearch\Model\SourceIndexExternal[]', + 'external' => '\Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[]', ]; /** @@ -415,7 +415,7 @@ public function setGenerate($generate) /** * Gets external * - * @return \Algolia\AlgoliaSearch\Model\SourceIndexExternal[] + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[] */ public function getExternal() { @@ -425,7 +425,7 @@ public function getExternal() /** * Sets external * - * @param \Algolia\AlgoliaSearch\Model\SourceIndexExternal[] $external list of external indices to use to generate custom Query Suggestions + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[] $external list of external indices to use to generate custom Query Suggestions * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Status.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/Status.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/Status.php rename to clients/algoliasearch-client-php/lib/Model/QuerySuggestions/Status.php index a5deb8d041..cfaa020367 100644 --- a/clients/algoliasearch-client-php/lib/Model/Status.php +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/Status.php @@ -1,6 +1,6 @@ + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseSearchParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'baseSearchParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'similarQuery' => 'string', + 'filters' => 'string', + 'facetFilters' => 'string[]', + 'optionalFilters' => 'string[]', + 'numericFilters' => 'string[]', + 'tagFilters' => 'string[]', + 'sumOrFiltersScores' => 'bool', + 'facets' => 'string[]', + 'maxValuesPerFacet' => 'int', + 'facetingAfterDistinct' => 'bool', + 'sortFacetValuesBy' => 'string', + 'page' => 'int', + 'offset' => 'int', + 'length' => 'int', + 'aroundLatLng' => 'string', + 'aroundLatLngViaIP' => 'bool', + 'aroundRadius' => 'OneOfIntegerString', + 'aroundPrecision' => 'int', + 'minimumAroundRadius' => 'int', + 'insideBoundingBox' => 'float[]', + 'insidePolygon' => 'float[]', + 'naturalLanguages' => 'string[]', + 'ruleContexts' => 'string[]', + 'personalizationImpact' => 'int', + 'userToken' => 'string', + 'getRankingInfo' => 'bool', + 'clickAnalytics' => 'bool', + 'analytics' => 'bool', + 'analyticsTags' => 'string[]', + 'percentileComputation' => 'bool', + 'enableABTest' => 'bool', + 'enableReRanking' => 'bool', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'similarQuery' => null, + 'filters' => null, + 'facetFilters' => null, + 'optionalFilters' => null, + 'numericFilters' => null, + 'tagFilters' => null, + 'sumOrFiltersScores' => null, + 'facets' => null, + 'maxValuesPerFacet' => null, + 'facetingAfterDistinct' => null, + 'sortFacetValuesBy' => null, + 'page' => null, + 'offset' => null, + 'length' => null, + 'aroundLatLng' => null, + 'aroundLatLngViaIP' => null, + 'aroundRadius' => null, + 'aroundPrecision' => null, + 'minimumAroundRadius' => null, + 'insideBoundingBox' => null, + 'insidePolygon' => null, + 'naturalLanguages' => null, + 'ruleContexts' => null, + 'personalizationImpact' => null, + 'userToken' => null, + 'getRankingInfo' => null, + 'clickAnalytics' => null, + 'analytics' => null, + 'analyticsTags' => null, + 'percentileComputation' => null, + 'enableABTest' => null, + 'enableReRanking' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'similarQuery' => 'similarQuery', + 'filters' => 'filters', + 'facetFilters' => 'facetFilters', + 'optionalFilters' => 'optionalFilters', + 'numericFilters' => 'numericFilters', + 'tagFilters' => 'tagFilters', + 'sumOrFiltersScores' => 'sumOrFiltersScores', + 'facets' => 'facets', + 'maxValuesPerFacet' => 'maxValuesPerFacet', + 'facetingAfterDistinct' => 'facetingAfterDistinct', + 'sortFacetValuesBy' => 'sortFacetValuesBy', + 'page' => 'page', + 'offset' => 'offset', + 'length' => 'length', + 'aroundLatLng' => 'aroundLatLng', + 'aroundLatLngViaIP' => 'aroundLatLngViaIP', + 'aroundRadius' => 'aroundRadius', + 'aroundPrecision' => 'aroundPrecision', + 'minimumAroundRadius' => 'minimumAroundRadius', + 'insideBoundingBox' => 'insideBoundingBox', + 'insidePolygon' => 'insidePolygon', + 'naturalLanguages' => 'naturalLanguages', + 'ruleContexts' => 'ruleContexts', + 'personalizationImpact' => 'personalizationImpact', + 'userToken' => 'userToken', + 'getRankingInfo' => 'getRankingInfo', + 'clickAnalytics' => 'clickAnalytics', + 'analytics' => 'analytics', + 'analyticsTags' => 'analyticsTags', + 'percentileComputation' => 'percentileComputation', + 'enableABTest' => 'enableABTest', + 'enableReRanking' => 'enableReRanking', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'similarQuery' => 'setSimilarQuery', + 'filters' => 'setFilters', + 'facetFilters' => 'setFacetFilters', + 'optionalFilters' => 'setOptionalFilters', + 'numericFilters' => 'setNumericFilters', + 'tagFilters' => 'setTagFilters', + 'sumOrFiltersScores' => 'setSumOrFiltersScores', + 'facets' => 'setFacets', + 'maxValuesPerFacet' => 'setMaxValuesPerFacet', + 'facetingAfterDistinct' => 'setFacetingAfterDistinct', + 'sortFacetValuesBy' => 'setSortFacetValuesBy', + 'page' => 'setPage', + 'offset' => 'setOffset', + 'length' => 'setLength', + 'aroundLatLng' => 'setAroundLatLng', + 'aroundLatLngViaIP' => 'setAroundLatLngViaIP', + 'aroundRadius' => 'setAroundRadius', + 'aroundPrecision' => 'setAroundPrecision', + 'minimumAroundRadius' => 'setMinimumAroundRadius', + 'insideBoundingBox' => 'setInsideBoundingBox', + 'insidePolygon' => 'setInsidePolygon', + 'naturalLanguages' => 'setNaturalLanguages', + 'ruleContexts' => 'setRuleContexts', + 'personalizationImpact' => 'setPersonalizationImpact', + 'userToken' => 'setUserToken', + 'getRankingInfo' => 'setGetRankingInfo', + 'clickAnalytics' => 'setClickAnalytics', + 'analytics' => 'setAnalytics', + 'analyticsTags' => 'setAnalyticsTags', + 'percentileComputation' => 'setPercentileComputation', + 'enableABTest' => 'setEnableABTest', + 'enableReRanking' => 'setEnableReRanking', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'similarQuery' => 'getSimilarQuery', + 'filters' => 'getFilters', + 'facetFilters' => 'getFacetFilters', + 'optionalFilters' => 'getOptionalFilters', + 'numericFilters' => 'getNumericFilters', + 'tagFilters' => 'getTagFilters', + 'sumOrFiltersScores' => 'getSumOrFiltersScores', + 'facets' => 'getFacets', + 'maxValuesPerFacet' => 'getMaxValuesPerFacet', + 'facetingAfterDistinct' => 'getFacetingAfterDistinct', + 'sortFacetValuesBy' => 'getSortFacetValuesBy', + 'page' => 'getPage', + 'offset' => 'getOffset', + 'length' => 'getLength', + 'aroundLatLng' => 'getAroundLatLng', + 'aroundLatLngViaIP' => 'getAroundLatLngViaIP', + 'aroundRadius' => 'getAroundRadius', + 'aroundPrecision' => 'getAroundPrecision', + 'minimumAroundRadius' => 'getMinimumAroundRadius', + 'insideBoundingBox' => 'getInsideBoundingBox', + 'insidePolygon' => 'getInsidePolygon', + 'naturalLanguages' => 'getNaturalLanguages', + 'ruleContexts' => 'getRuleContexts', + 'personalizationImpact' => 'getPersonalizationImpact', + 'userToken' => 'getUserToken', + 'getRankingInfo' => 'getGetRankingInfo', + 'clickAnalytics' => 'getClickAnalytics', + 'analytics' => 'getAnalytics', + 'analyticsTags' => 'getAnalyticsTags', + 'percentileComputation' => 'getPercentileComputation', + 'enableABTest' => 'getEnableABTest', + 'enableReRanking' => 'getEnableReRanking', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['similarQuery'] = $data['similarQuery'] ?? ''; + $this->container['filters'] = $data['filters'] ?? ''; + $this->container['facetFilters'] = $data['facetFilters'] ?? null; + $this->container['optionalFilters'] = $data['optionalFilters'] ?? null; + $this->container['numericFilters'] = $data['numericFilters'] ?? null; + $this->container['tagFilters'] = $data['tagFilters'] ?? null; + $this->container['sumOrFiltersScores'] = $data['sumOrFiltersScores'] ?? false; + $this->container['facets'] = $data['facets'] ?? null; + $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet'] ?? 100; + $this->container['facetingAfterDistinct'] = $data['facetingAfterDistinct'] ?? false; + $this->container['sortFacetValuesBy'] = $data['sortFacetValuesBy'] ?? 'count'; + $this->container['page'] = $data['page'] ?? 0; + $this->container['offset'] = $data['offset'] ?? null; + $this->container['length'] = $data['length'] ?? null; + $this->container['aroundLatLng'] = $data['aroundLatLng'] ?? ''; + $this->container['aroundLatLngViaIP'] = $data['aroundLatLngViaIP'] ?? false; + $this->container['aroundRadius'] = $data['aroundRadius'] ?? null; + $this->container['aroundPrecision'] = $data['aroundPrecision'] ?? 10; + $this->container['minimumAroundRadius'] = $data['minimumAroundRadius'] ?? null; + $this->container['insideBoundingBox'] = $data['insideBoundingBox'] ?? null; + $this->container['insidePolygon'] = $data['insidePolygon'] ?? null; + $this->container['naturalLanguages'] = $data['naturalLanguages'] ?? null; + $this->container['ruleContexts'] = $data['ruleContexts'] ?? null; + $this->container['personalizationImpact'] = $data['personalizationImpact'] ?? 100; + $this->container['userToken'] = $data['userToken'] ?? null; + $this->container['getRankingInfo'] = $data['getRankingInfo'] ?? false; + $this->container['clickAnalytics'] = $data['clickAnalytics'] ?? false; + $this->container['analytics'] = $data['analytics'] ?? true; + $this->container['analyticsTags'] = $data['analyticsTags'] ?? null; + $this->container['percentileComputation'] = $data['percentileComputation'] ?? true; + $this->container['enableABTest'] = $data['enableABTest'] ?? true; + $this->container['enableReRanking'] = $data['enableReRanking'] ?? true; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['length']) && ($this->container['length'] > 1000)) { + $invalidProperties[] = "invalid value for 'length', must be smaller than or equal to 1000."; + } + + if (!is_null($this->container['length']) && ($this->container['length'] < 1)) { + $invalidProperties[] = "invalid value for 'length', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['minimumAroundRadius']) && ($this->container['minimumAroundRadius'] < 1)) { + $invalidProperties[] = "invalid value for 'minimumAroundRadius', must be bigger than or equal to 1."; + } + + 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 similarQuery + * + * @return string|null + */ + public function getSimilarQuery() + { + return $this->container['similarQuery']; + } + + /** + * Sets similarQuery + * + * @param string|null $similarQuery overrides the query parameter and performs a more generic search that can be used to find \"similar\" results + * + * @return self + */ + public function setSimilarQuery($similarQuery) + { + $this->container['similarQuery'] = $similarQuery; + + return $this; + } + + /** + * Gets filters + * + * @return string|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param string|null $filters filter the query with numeric, facet and/or tag filters + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets facetFilters + * + * @return string[]|null + */ + public function getFacetFilters() + { + return $this->container['facetFilters']; + } + + /** + * Sets facetFilters + * + * @param string[]|null $facetFilters filter hits by facet value + * + * @return self + */ + public function setFacetFilters($facetFilters) + { + $this->container['facetFilters'] = $facetFilters; + + return $this; + } + + /** + * Gets optionalFilters + * + * @return string[]|null + */ + public function getOptionalFilters() + { + return $this->container['optionalFilters']; + } + + /** + * Sets optionalFilters + * + * @param string[]|null $optionalFilters create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter + * + * @return self + */ + public function setOptionalFilters($optionalFilters) + { + $this->container['optionalFilters'] = $optionalFilters; + + return $this; + } + + /** + * Gets numericFilters + * + * @return string[]|null + */ + public function getNumericFilters() + { + return $this->container['numericFilters']; + } + + /** + * Sets numericFilters + * + * @param string[]|null $numericFilters filter on numeric attributes + * + * @return self + */ + public function setNumericFilters($numericFilters) + { + $this->container['numericFilters'] = $numericFilters; + + return $this; + } + + /** + * Gets tagFilters + * + * @return string[]|null + */ + public function getTagFilters() + { + return $this->container['tagFilters']; + } + + /** + * Sets tagFilters + * + * @param string[]|null $tagFilters filter hits by tags + * + * @return self + */ + public function setTagFilters($tagFilters) + { + $this->container['tagFilters'] = $tagFilters; + + return $this; + } + + /** + * Gets sumOrFiltersScores + * + * @return bool|null + */ + public function getSumOrFiltersScores() + { + return $this->container['sumOrFiltersScores']; + } + + /** + * Sets sumOrFiltersScores + * + * @param bool|null $sumOrFiltersScores determines how to calculate the total score for filtering + * + * @return self + */ + public function setSumOrFiltersScores($sumOrFiltersScores) + { + $this->container['sumOrFiltersScores'] = $sumOrFiltersScores; + + return $this; + } + + /** + * Gets facets + * + * @return string[]|null + */ + public function getFacets() + { + return $this->container['facets']; + } + + /** + * Sets facets + * + * @param string[]|null $facets retrieve facets and their facet values + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets maxValuesPerFacet + * + * @return int|null + */ + public function getMaxValuesPerFacet() + { + return $this->container['maxValuesPerFacet']; + } + + /** + * Sets maxValuesPerFacet + * + * @param int|null $maxValuesPerFacet maximum number of facet values to return for each facet during a regular search + * + * @return self + */ + public function setMaxValuesPerFacet($maxValuesPerFacet) + { + $this->container['maxValuesPerFacet'] = $maxValuesPerFacet; + + return $this; + } + + /** + * Gets facetingAfterDistinct + * + * @return bool|null + */ + public function getFacetingAfterDistinct() + { + return $this->container['facetingAfterDistinct']; + } + + /** + * Sets facetingAfterDistinct + * + * @param bool|null $facetingAfterDistinct force faceting to be applied after de-duplication (via the Distinct setting) + * + * @return self + */ + public function setFacetingAfterDistinct($facetingAfterDistinct) + { + $this->container['facetingAfterDistinct'] = $facetingAfterDistinct; + + return $this; + } + + /** + * Gets sortFacetValuesBy + * + * @return string|null + */ + public function getSortFacetValuesBy() + { + return $this->container['sortFacetValuesBy']; + } + + /** + * Sets sortFacetValuesBy + * + * @param string|null $sortFacetValuesBy controls how facet values are fetched + * + * @return self + */ + public function setSortFacetValuesBy($sortFacetValuesBy) + { + $this->container['sortFacetValuesBy'] = $sortFacetValuesBy; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets offset + * + * @return int|null + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * + * @param int|null $offset specify the offset of the first hit to return + * + * @return self + */ + public function setOffset($offset) + { + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets length + * + * @return int|null + */ + public function getLength() + { + return $this->container['length']; + } + + /** + * Sets length + * + * @param int|null $length set the number of hits to retrieve (used only with offset) + * + * @return self + */ + public function setLength($length) + { + if (!is_null($length) && ($length > 1000)) { + throw new \InvalidArgumentException('invalid value for $length when calling BaseSearchParams., must be smaller than or equal to 1000.'); + } + if (!is_null($length) && ($length < 1)) { + throw new \InvalidArgumentException('invalid value for $length when calling BaseSearchParams., must be bigger than or equal to 1.'); + } + + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng']; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng search for entries around a central geolocation, enabling a geo search within a circular area + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets aroundLatLngViaIP + * + * @return bool|null + */ + public function getAroundLatLngViaIP() + { + return $this->container['aroundLatLngViaIP']; + } + + /** + * Sets aroundLatLngViaIP + * + * @param bool|null $aroundLatLngViaIP search for entries around a given location automatically computed from the requester's IP address + * + * @return self + */ + public function setAroundLatLngViaIP($aroundLatLngViaIP) + { + $this->container['aroundLatLngViaIP'] = $aroundLatLngViaIP; + + return $this; + } + + /** + * Gets aroundRadius + * + * @return OneOfIntegerString|null + */ + public function getAroundRadius() + { + return $this->container['aroundRadius']; + } + + /** + * Sets aroundRadius + * + * @param OneOfIntegerString|null $aroundRadius define the maximum radius for a geo search (in meters) + * + * @return self + */ + public function setAroundRadius($aroundRadius) + { + $this->container['aroundRadius'] = $aroundRadius; + + return $this; + } + + /** + * Gets aroundPrecision + * + * @return int|null + */ + public function getAroundPrecision() + { + return $this->container['aroundPrecision']; + } + + /** + * Sets aroundPrecision + * + * @param int|null $aroundPrecision precision of geo search (in meters), to add grouping by geo location to the ranking formula + * + * @return self + */ + public function setAroundPrecision($aroundPrecision) + { + $this->container['aroundPrecision'] = $aroundPrecision; + + return $this; + } + + /** + * Gets minimumAroundRadius + * + * @return int|null + */ + public function getMinimumAroundRadius() + { + return $this->container['minimumAroundRadius']; + } + + /** + * Sets minimumAroundRadius + * + * @param int|null $minimumAroundRadius minimum radius (in meters) used for a geo search when aroundRadius is not set + * + * @return self + */ + public function setMinimumAroundRadius($minimumAroundRadius) + { + if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { + throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling BaseSearchParams., must be bigger than or equal to 1.'); + } + + $this->container['minimumAroundRadius'] = $minimumAroundRadius; + + return $this; + } + + /** + * Gets insideBoundingBox + * + * @return float[]|null + */ + public function getInsideBoundingBox() + { + return $this->container['insideBoundingBox']; + } + + /** + * Sets insideBoundingBox + * + * @param float[]|null $insideBoundingBox search inside a rectangular area (in geo coordinates) + * + * @return self + */ + public function setInsideBoundingBox($insideBoundingBox) + { + $this->container['insideBoundingBox'] = $insideBoundingBox; + + return $this; + } + + /** + * Gets insidePolygon + * + * @return float[]|null + */ + public function getInsidePolygon() + { + return $this->container['insidePolygon']; + } + + /** + * Sets insidePolygon + * + * @param float[]|null $insidePolygon search inside a polygon (in geo coordinates) + * + * @return self + */ + public function setInsidePolygon($insidePolygon) + { + $this->container['insidePolygon'] = $insidePolygon; + + return $this; + } + + /** + * Gets naturalLanguages + * + * @return string[]|null + */ + public function getNaturalLanguages() + { + return $this->container['naturalLanguages']; + } + + /** + * Sets naturalLanguages + * + * @param string[]|null $naturalLanguages This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. + * + * @return self + */ + public function setNaturalLanguages($naturalLanguages) + { + $this->container['naturalLanguages'] = $naturalLanguages; + + return $this; + } + + /** + * Gets ruleContexts + * + * @return string[]|null + */ + public function getRuleContexts() + { + return $this->container['ruleContexts']; + } + + /** + * Sets ruleContexts + * + * @param string[]|null $ruleContexts enables contextual rules + * + * @return self + */ + public function setRuleContexts($ruleContexts) + { + $this->container['ruleContexts'] = $ruleContexts; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int|null + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact']; + } + + /** + * Sets personalizationImpact + * + * @param int|null $personalizationImpact define the impact of the Personalization feature + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + return $this; + } + + /** + * Gets userToken + * + * @return string|null + */ + public function getUserToken() + { + return $this->container['userToken']; + } + + /** + * Sets userToken + * + * @param string|null $userToken associates a certain user token with the current search + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets getRankingInfo + * + * @return bool|null + */ + public function getGetRankingInfo() + { + return $this->container['getRankingInfo']; + } + + /** + * Sets getRankingInfo + * + * @param bool|null $getRankingInfo retrieve detailed ranking information + * + * @return self + */ + public function setGetRankingInfo($getRankingInfo) + { + $this->container['getRankingInfo'] = $getRankingInfo; + + return $this; + } + + /** + * Gets clickAnalytics + * + * @return bool|null + */ + public function getClickAnalytics() + { + return $this->container['clickAnalytics']; + } + + /** + * Sets clickAnalytics + * + * @param bool|null $clickAnalytics enable the Click Analytics feature + * + * @return self + */ + public function setClickAnalytics($clickAnalytics) + { + $this->container['clickAnalytics'] = $clickAnalytics; + + return $this; + } + + /** + * Gets analytics + * + * @return bool|null + */ + public function getAnalytics() + { + return $this->container['analytics']; + } + + /** + * Sets analytics + * + * @param bool|null $analytics whether the current query will be taken into account in the Analytics + * + * @return self + */ + public function setAnalytics($analytics) + { + $this->container['analytics'] = $analytics; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[]|null + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags']; + } + + /** + * Sets analyticsTags + * + * @param string[]|null $analyticsTags list of tags to apply to the query for analytics purposes + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets percentileComputation + * + * @return bool|null + */ + public function getPercentileComputation() + { + return $this->container['percentileComputation']; + } + + /** + * Sets percentileComputation + * + * @param bool|null $percentileComputation whether to include or exclude a query from the processing-time percentile computation + * + * @return self + */ + public function setPercentileComputation($percentileComputation) + { + $this->container['percentileComputation'] = $percentileComputation; + + return $this; + } + + /** + * Gets enableABTest + * + * @return bool|null + */ + public function getEnableABTest() + { + return $this->container['enableABTest']; + } + + /** + * Sets enableABTest + * + * @param bool|null $enableABTest whether this search should participate in running AB tests + * + * @return self + */ + public function setEnableABTest($enableABTest) + { + $this->container['enableABTest'] = $enableABTest; + + return $this; + } + + /** + * Gets enableReRanking + * + * @return bool|null + */ + public function getEnableReRanking() + { + return $this->container['enableReRanking']; + } + + /** + * Sets enableReRanking + * + * @param bool|null $enableReRanking whether this search should use AI Re-Ranking + * + * @return self + */ + public function setEnableReRanking($enableReRanking) + { + $this->container['enableReRanking'] = $enableReRanking; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponse.php b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponse.php new file mode 100644 index 0000000000..319c0ce6a9 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponse.php @@ -0,0 +1,1016 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseSearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'baseSearchResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'abTestID' => 'int', + 'abTestVariantID' => 'int', + 'aroundLatLng' => 'string', + 'automaticRadius' => 'string', + 'exhaustiveFacetsCount' => 'bool', + 'exhaustiveNbHits' => 'bool', + 'exhaustiveTypo' => 'bool', + 'facets' => 'array>', + 'facetsStats' => 'array', + 'hitsPerPage' => 'int', + 'index' => 'string', + 'indexUsed' => 'string', + 'message' => 'string', + 'nbHits' => 'int', + 'nbPages' => 'int', + 'nbSortedHits' => 'int', + 'page' => 'int', + 'params' => 'string', + 'parsedQuery' => 'string', + 'processingTimeMS' => 'int', + 'query' => 'string', + 'queryAfterRemoval' => 'string', + 'serverUsed' => 'string', + 'userData' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'abTestID' => null, + 'abTestVariantID' => null, + 'aroundLatLng' => null, + 'automaticRadius' => null, + 'exhaustiveFacetsCount' => null, + 'exhaustiveNbHits' => null, + 'exhaustiveTypo' => null, + 'facets' => null, + 'facetsStats' => null, + 'hitsPerPage' => null, + 'index' => null, + 'indexUsed' => null, + 'message' => null, + 'nbHits' => null, + 'nbPages' => null, + 'nbSortedHits' => null, + 'page' => null, + 'params' => null, + 'parsedQuery' => null, + 'processingTimeMS' => null, + 'query' => null, + 'queryAfterRemoval' => null, + 'serverUsed' => null, + 'userData' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'abTestID' => 'abTestID', + 'abTestVariantID' => 'abTestVariantID', + 'aroundLatLng' => 'aroundLatLng', + 'automaticRadius' => 'automaticRadius', + 'exhaustiveFacetsCount' => 'exhaustiveFacetsCount', + 'exhaustiveNbHits' => 'exhaustiveNbHits', + 'exhaustiveTypo' => 'exhaustiveTypo', + 'facets' => 'facets', + 'facetsStats' => 'facets_stats', + 'hitsPerPage' => 'hitsPerPage', + 'index' => 'index', + 'indexUsed' => 'indexUsed', + 'message' => 'message', + 'nbHits' => 'nbHits', + 'nbPages' => 'nbPages', + 'nbSortedHits' => 'nbSortedHits', + 'page' => 'page', + 'params' => 'params', + 'parsedQuery' => 'parsedQuery', + 'processingTimeMS' => 'processingTimeMS', + 'query' => 'query', + 'queryAfterRemoval' => 'queryAfterRemoval', + 'serverUsed' => 'serverUsed', + 'userData' => 'userData', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abTestID' => 'setAbTestID', + 'abTestVariantID' => 'setAbTestVariantID', + 'aroundLatLng' => 'setAroundLatLng', + 'automaticRadius' => 'setAutomaticRadius', + 'exhaustiveFacetsCount' => 'setExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'setExhaustiveNbHits', + 'exhaustiveTypo' => 'setExhaustiveTypo', + 'facets' => 'setFacets', + 'facetsStats' => 'setFacetsStats', + 'hitsPerPage' => 'setHitsPerPage', + 'index' => 'setIndex', + 'indexUsed' => 'setIndexUsed', + 'message' => 'setMessage', + 'nbHits' => 'setNbHits', + 'nbPages' => 'setNbPages', + 'nbSortedHits' => 'setNbSortedHits', + 'page' => 'setPage', + 'params' => 'setParams', + 'parsedQuery' => 'setParsedQuery', + 'processingTimeMS' => 'setProcessingTimeMS', + 'query' => 'setQuery', + 'queryAfterRemoval' => 'setQueryAfterRemoval', + 'serverUsed' => 'setServerUsed', + 'userData' => 'setUserData', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abTestID' => 'getAbTestID', + 'abTestVariantID' => 'getAbTestVariantID', + 'aroundLatLng' => 'getAroundLatLng', + 'automaticRadius' => 'getAutomaticRadius', + 'exhaustiveFacetsCount' => 'getExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'getExhaustiveNbHits', + 'exhaustiveTypo' => 'getExhaustiveTypo', + 'facets' => 'getFacets', + 'facetsStats' => 'getFacetsStats', + 'hitsPerPage' => 'getHitsPerPage', + 'index' => 'getIndex', + 'indexUsed' => 'getIndexUsed', + 'message' => 'getMessage', + 'nbHits' => 'getNbHits', + 'nbPages' => 'getNbPages', + 'nbSortedHits' => 'getNbSortedHits', + 'page' => 'getPage', + 'params' => 'getParams', + 'parsedQuery' => 'getParsedQuery', + 'processingTimeMS' => 'getProcessingTimeMS', + 'query' => 'getQuery', + 'queryAfterRemoval' => 'getQueryAfterRemoval', + 'serverUsed' => 'getServerUsed', + 'userData' => 'getUserData', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['abTestID'] = $data['abTestID'] ?? null; + $this->container['abTestVariantID'] = $data['abTestVariantID'] ?? null; + $this->container['aroundLatLng'] = $data['aroundLatLng'] ?? null; + $this->container['automaticRadius'] = $data['automaticRadius'] ?? null; + $this->container['exhaustiveFacetsCount'] = $data['exhaustiveFacetsCount'] ?? null; + $this->container['exhaustiveNbHits'] = $data['exhaustiveNbHits'] ?? null; + $this->container['exhaustiveTypo'] = $data['exhaustiveTypo'] ?? null; + $this->container['facets'] = $data['facets'] ?? null; + $this->container['facetsStats'] = $data['facetsStats'] ?? null; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['index'] = $data['index'] ?? null; + $this->container['indexUsed'] = $data['indexUsed'] ?? null; + $this->container['message'] = $data['message'] ?? null; + $this->container['nbHits'] = $data['nbHits'] ?? null; + $this->container['nbPages'] = $data['nbPages'] ?? null; + $this->container['nbSortedHits'] = $data['nbSortedHits'] ?? null; + $this->container['page'] = $data['page'] ?? 0; + $this->container['params'] = $data['params'] ?? null; + $this->container['parsedQuery'] = $data['parsedQuery'] ?? null; + $this->container['processingTimeMS'] = $data['processingTimeMS'] ?? null; + $this->container['query'] = $data['query'] ?? ''; + $this->container['queryAfterRemoval'] = $data['queryAfterRemoval'] ?? null; + $this->container['serverUsed'] = $data['serverUsed'] ?? null; + $this->container['userData'] = $data['userData'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['aroundLatLng']) && !preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $this->container['aroundLatLng'])) { + $invalidProperties[] = "invalid value for 'aroundLatLng', must be conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."; + } + + if ($this->container['exhaustiveNbHits'] === null) { + $invalidProperties[] = "'exhaustiveNbHits' can't be null"; + } + if ($this->container['exhaustiveTypo'] === null) { + $invalidProperties[] = "'exhaustiveTypo' can't be null"; + } + if ($this->container['hitsPerPage'] === null) { + $invalidProperties[] = "'hitsPerPage' can't be null"; + } + if ($this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if ($this->container['nbPages'] === null) { + $invalidProperties[] = "'nbPages' can't be null"; + } + if ($this->container['page'] === null) { + $invalidProperties[] = "'page' can't be null"; + } + if ($this->container['params'] === null) { + $invalidProperties[] = "'params' can't be null"; + } + if ($this->container['processingTimeMS'] === null) { + $invalidProperties[] = "'processingTimeMS' can't be null"; + } + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' 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 abTestID + * + * @return int|null + */ + public function getAbTestID() + { + return $this->container['abTestID']; + } + + /** + * Sets abTestID + * + * @param int|null $abTestID if a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets abTestVariantID + * + * @return int|null + */ + public function getAbTestVariantID() + { + return $this->container['abTestVariantID']; + } + + /** + * Sets abTestVariantID + * + * @param int|null $abTestVariantID if a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used + * + * @return self + */ + public function setAbTestVariantID($abTestVariantID) + { + $this->container['abTestVariantID'] = $abTestVariantID; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng']; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng the computed geo location + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + if (!is_null($aroundLatLng) && (!preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $aroundLatLng))) { + throw new \InvalidArgumentException("invalid value for $aroundLatLng when calling BaseSearchResponse., must conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."); + } + + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets automaticRadius + * + * @return string|null + */ + public function getAutomaticRadius() + { + return $this->container['automaticRadius']; + } + + /** + * Sets automaticRadius + * + * @param string|null $automaticRadius The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. + * + * @return self + */ + public function setAutomaticRadius($automaticRadius) + { + $this->container['automaticRadius'] = $automaticRadius; + + return $this; + } + + /** + * Gets exhaustiveFacetsCount + * + * @return bool|null + */ + public function getExhaustiveFacetsCount() + { + return $this->container['exhaustiveFacetsCount']; + } + + /** + * Sets exhaustiveFacetsCount + * + * @param bool|null $exhaustiveFacetsCount whether the facet count is exhaustive or approximate + * + * @return self + */ + public function setExhaustiveFacetsCount($exhaustiveFacetsCount) + { + $this->container['exhaustiveFacetsCount'] = $exhaustiveFacetsCount; + + return $this; + } + + /** + * Gets exhaustiveNbHits + * + * @return bool + */ + public function getExhaustiveNbHits() + { + return $this->container['exhaustiveNbHits']; + } + + /** + * Sets exhaustiveNbHits + * + * @param bool $exhaustiveNbHits Indicate if the nbHits count was exhaustive or approximate + * + * @return self + */ + public function setExhaustiveNbHits($exhaustiveNbHits) + { + $this->container['exhaustiveNbHits'] = $exhaustiveNbHits; + + return $this; + } + + /** + * Gets exhaustiveTypo + * + * @return bool + */ + public function getExhaustiveTypo() + { + return $this->container['exhaustiveTypo']; + } + + /** + * Sets exhaustiveTypo + * + * @param bool $exhaustiveTypo Indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * + * @return self + */ + public function setExhaustiveTypo($exhaustiveTypo) + { + $this->container['exhaustiveTypo'] = $exhaustiveTypo; + + return $this; + } + + /** + * Gets facets + * + * @return array>|null + */ + public function getFacets() + { + return $this->container['facets']; + } + + /** + * Sets facets + * + * @param array>|null $facets a mapping of each facet name to the corresponding facet counts + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets facetsStats + * + * @return array|null + */ + public function getFacetsStats() + { + return $this->container['facetsStats']; + } + + /** + * Sets facetsStats + * + * @param array|null $facetsStats statistics for numerical facets + * + * @return self + */ + public function setFacetsStats($facetsStats) + { + $this->container['facetsStats'] = $facetsStats; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets index + * + * @return string|null + */ + public function getIndex() + { + return $this->container['index']; + } + + /** + * Sets index + * + * @param string|null $index index name used for the query + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets indexUsed + * + * @return string|null + */ + public function getIndexUsed() + { + return $this->container['indexUsed']; + } + + /** + * Sets indexUsed + * + * @param string|null $indexUsed Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. + * + * @return self + */ + public function setIndexUsed($indexUsed) + { + $this->container['indexUsed'] = $indexUsed; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message used to return warnings about the query + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits']; + } + + /** + * Sets nbHits + * + * @param int $nbHits number of hits that the search query matched + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets nbPages + * + * @return int + */ + public function getNbPages() + { + return $this->container['nbPages']; + } + + /** + * Sets nbPages + * + * @param int $nbPages Number of pages available for the current query + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + + /** + * Gets nbSortedHits + * + * @return int|null + */ + public function getNbSortedHits() + { + return $this->container['nbSortedHits']; + } + + /** + * Sets nbSortedHits + * + * @param int|null $nbSortedHits The number of hits selected and sorted by the relevant sort algorithm + * + * @return self + */ + public function setNbSortedHits($nbSortedHits) + { + $this->container['nbSortedHits'] = $nbSortedHits; + + return $this; + } + + /** + * Gets page + * + * @return int + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets params + * + * @return string + */ + public function getParams() + { + return $this->container['params']; + } + + /** + * Sets params + * + * @param string $params a url-encoded string of all search parameters + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets parsedQuery + * + * @return string|null + */ + public function getParsedQuery() + { + return $this->container['parsedQuery']; + } + + /** + * Sets parsedQuery + * + * @param string|null $parsedQuery the query string that will be searched, after normalization + * + * @return self + */ + public function setParsedQuery($parsedQuery) + { + $this->container['parsedQuery'] = $parsedQuery; + + return $this; + } + + /** + * Gets processingTimeMS + * + * @return int + */ + public function getProcessingTimeMS() + { + return $this->container['processingTimeMS']; + } + + /** + * Sets processingTimeMS + * + * @param int $processingTimeMS time the server took to process the request, in milliseconds + * + * @return self + */ + public function setProcessingTimeMS($processingTimeMS) + { + $this->container['processingTimeMS'] = $processingTimeMS; + + return $this; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets queryAfterRemoval + * + * @return string|null + */ + public function getQueryAfterRemoval() + { + return $this->container['queryAfterRemoval']; + } + + /** + * Sets queryAfterRemoval + * + * @param string|null $queryAfterRemoval a markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set + * + * @return self + */ + public function setQueryAfterRemoval($queryAfterRemoval) + { + $this->container['queryAfterRemoval'] = $queryAfterRemoval; + + return $this; + } + + /** + * Gets serverUsed + * + * @return string|null + */ + public function getServerUsed() + { + return $this->container['serverUsed']; + } + + /** + * Sets serverUsed + * + * @param string|null $serverUsed actual host name of the server that processed the request + * + * @return self + */ + public function setServerUsed($serverUsed) + { + $this->container['serverUsed'] = $serverUsed; + + return $this; + } + + /** + * Gets userData + * + * @return object|null + */ + public function getUserData() + { + return $this->container['userData']; + } + + /** + * Sets userData + * + * @param object|null $userData lets you store custom data in your indices + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponseFacetsStats.php b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponseFacetsStats.php new file mode 100644 index 0000000000..80bc80570e --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponseFacetsStats.php @@ -0,0 +1,380 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class BaseSearchResponseFacetsStats implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'baseSearchResponse_facets_stats'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'min' => 'int', + 'max' => 'int', + 'avg' => 'int', + 'sum' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'min' => null, + 'max' => null, + 'avg' => null, + 'sum' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'min' => 'min', + 'max' => 'max', + 'avg' => 'avg', + 'sum' => 'sum', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'min' => 'setMin', + 'max' => 'setMax', + 'avg' => 'setAvg', + 'sum' => 'setSum', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'min' => 'getMin', + 'max' => 'getMax', + 'avg' => 'getAvg', + 'sum' => 'getSum', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['min'] = $data['min'] ?? null; + $this->container['max'] = $data['max'] ?? null; + $this->container['avg'] = $data['avg'] ?? null; + $this->container['sum'] = $data['sum'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 min + * + * @return int|null + */ + public function getMin() + { + return $this->container['min']; + } + + /** + * Sets min + * + * @param int|null $min the minimum value in the result set + * + * @return self + */ + public function setMin($min) + { + $this->container['min'] = $min; + + return $this; + } + + /** + * Gets max + * + * @return int|null + */ + public function getMax() + { + return $this->container['max']; + } + + /** + * Sets max + * + * @param int|null $max the maximum value in the result set + * + * @return self + */ + public function setMax($max) + { + $this->container['max'] = $max; + + return $this; + } + + /** + * Gets avg + * + * @return int|null + */ + public function getAvg() + { + return $this->container['avg']; + } + + /** + * Sets avg + * + * @param int|null $avg the average facet value in the result set + * + * @return self + */ + public function setAvg($avg) + { + $this->container['avg'] = $avg; + + return $this; + } + + /** + * Gets sum + * + * @return int|null + */ + public function getSum() + { + return $this->container['sum']; + } + + /** + * Sets sum + * + * @param int|null $sum the sum of all values in the result set + * + * @return self + */ + public function setSum($sum) + { + $this->container['sum'] = $sum; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/ErrorBase.php b/clients/algoliasearch-client-php/lib/Model/Recommend/ErrorBase.php new file mode 100644 index 0000000000..c4d818464f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/ErrorBase.php @@ -0,0 +1,292 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ErrorBase implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ErrorBase'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'message' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['message'] = $data['message'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/GetRecommendations.php b/clients/algoliasearch-client-php/lib/Model/Recommend/GetRecommendations.php similarity index 94% rename from clients/algoliasearch-client-php/lib/Model/GetRecommendations.php rename to clients/algoliasearch-client-php/lib/Model/Recommend/GetRecommendations.php index eb22e73e3d..9fe2ebcdac 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetRecommendations.php +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/GetRecommendations.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\RecommendationRequest[]', + 'requests' => '\Algolia\AlgoliaSearch\Model\Recommend\RecommendationRequest[]', ]; /** @@ -184,7 +184,7 @@ public function valid() /** * Gets requests * - * @return \Algolia\AlgoliaSearch\Model\RecommendationRequest[] + * @return \Algolia\AlgoliaSearch\Model\Recommend\RecommendationRequest[] */ public function getRequests() { @@ -194,7 +194,7 @@ public function getRequests() /** * Sets requests * - * @param \Algolia\AlgoliaSearch\Model\RecommendationRequest[] $requests the `getRecommendations` requests + * @param \Algolia\AlgoliaSearch\Model\Recommend\RecommendationRequest[] $requests the `getRecommendations` requests * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetRecommendationsResponse.php b/clients/algoliasearch-client-php/lib/Model/Recommend/GetRecommendationsResponse.php similarity index 94% rename from clients/algoliasearch-client-php/lib/Model/GetRecommendationsResponse.php rename to clients/algoliasearch-client-php/lib/Model/Recommend/GetRecommendationsResponse.php index a8e38f3239..e5c5aba8ef 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetRecommendationsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/GetRecommendationsResponse.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\RecommendationsResponse[]', + 'results' => '\Algolia\AlgoliaSearch\Model\Recommend\RecommendationsResponse[]', ]; /** @@ -178,7 +178,7 @@ public function valid() /** * Gets results * - * @return \Algolia\AlgoliaSearch\Model\RecommendationsResponse[]|null + * @return \Algolia\AlgoliaSearch\Model\Recommend\RecommendationsResponse[]|null */ public function getResults() { @@ -188,7 +188,7 @@ public function getResults() /** * Sets results * - * @param \Algolia\AlgoliaSearch\Model\RecommendationsResponse[]|null $results results + * @param \Algolia\AlgoliaSearch\Model\Recommend\RecommendationsResponse[]|null $results results * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/HighlightResult.php b/clients/algoliasearch-client-php/lib/Model/Recommend/HighlightResult.php new file mode 100644 index 0000000000..73958efd3b --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/HighlightResult.php @@ -0,0 +1,419 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class HighlightResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'highlightResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'value' => 'string', + 'matchLevel' => 'string', + 'matchedWords' => 'string[]', + 'fullyHighlighted' => 'bool', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'matchLevel' => null, + 'matchedWords' => null, + 'fullyHighlighted' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'matchLevel' => 'matchLevel', + 'matchedWords' => 'matchedWords', + 'fullyHighlighted' => 'fullyHighlighted', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'matchLevel' => 'setMatchLevel', + 'matchedWords' => 'setMatchedWords', + 'fullyHighlighted' => 'setFullyHighlighted', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'matchLevel' => 'getMatchLevel', + 'matchedWords' => 'getMatchedWords', + 'fullyHighlighted' => 'getFullyHighlighted', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const MATCH_LEVEL_NONE = 'none'; + const MATCH_LEVEL_PARTIAL = 'partial'; + const MATCH_LEVEL_FULL = 'full'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMatchLevelAllowableValues() + { + return [ + self::MATCH_LEVEL_NONE, + self::MATCH_LEVEL_PARTIAL, + self::MATCH_LEVEL_FULL, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + $this->container['matchLevel'] = $data['matchLevel'] ?? null; + $this->container['matchedWords'] = $data['matchedWords'] ?? null; + $this->container['fullyHighlighted'] = $data['fullyHighlighted'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMatchLevelAllowableValues(); + if (!is_null($this->container['matchLevel']) && !in_array($this->container['matchLevel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'matchLevel', must be one of '%s'", + $this->container['matchLevel'], + implode("', '", $allowedValues) + ); + } + + 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 value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value markup text with occurrences highlighted + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matchLevel + * + * @return string|null + */ + public function getMatchLevel() + { + return $this->container['matchLevel']; + } + + /** + * Sets matchLevel + * + * @param string|null $matchLevel indicates how well the attribute matched the search query + * + * @return self + */ + public function setMatchLevel($matchLevel) + { + $allowedValues = $this->getMatchLevelAllowableValues(); + if (!is_null($matchLevel) && !in_array($matchLevel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'matchLevel', must be one of '%s'", + $matchLevel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['matchLevel'] = $matchLevel; + + return $this; + } + + /** + * Gets matchedWords + * + * @return string[]|null + */ + public function getMatchedWords() + { + return $this->container['matchedWords']; + } + + /** + * Sets matchedWords + * + * @param string[]|null $matchedWords list of words from the query that matched the object + * + * @return self + */ + public function setMatchedWords($matchedWords) + { + $this->container['matchedWords'] = $matchedWords; + + return $this; + } + + /** + * Gets fullyHighlighted + * + * @return bool|null + */ + public function getFullyHighlighted() + { + return $this->container['fullyHighlighted']; + } + + /** + * Sets fullyHighlighted + * + * @param bool|null $fullyHighlighted whether the entire attribute value is highlighted + * + * @return self + */ + public function setFullyHighlighted($fullyHighlighted) + { + $this->container['fullyHighlighted'] = $fullyHighlighted; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/IndexSettingsAsSearchParams.php b/clients/algoliasearch-client-php/lib/Model/Recommend/IndexSettingsAsSearchParams.php new file mode 100644 index 0000000000..cbbda45cd2 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/IndexSettingsAsSearchParams.php @@ -0,0 +1,1817 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class IndexSettingsAsSearchParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'indexSettingsAsSearchParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'searchableAttributes' => 'string[]', + 'attributesForFaceting' => 'string[]', + 'unretrievableAttributes' => 'string[]', + 'attributesToRetrieve' => 'string[]', + 'restrictSearchableAttributes' => 'string[]', + 'ranking' => 'string[]', + 'customRanking' => 'string[]', + 'relevancyStrictness' => 'int', + 'attributesToHighlight' => 'string[]', + 'attributesToSnippet' => 'string[]', + 'highlightPreTag' => 'string', + 'highlightPostTag' => 'string', + 'snippetEllipsisText' => 'string', + 'restrictHighlightAndSnippetArrays' => 'bool', + 'hitsPerPage' => 'int', + 'minWordSizefor1Typo' => 'int', + 'minWordSizefor2Typos' => 'int', + 'typoTolerance' => 'string', + 'allowTyposOnNumericTokens' => 'bool', + 'disableTypoToleranceOnAttributes' => 'string[]', + 'separatorsToIndex' => 'string', + 'ignorePlurals' => 'string', + 'removeStopWords' => 'string', + 'keepDiacriticsOnCharacters' => 'string', + 'queryLanguages' => 'string[]', + 'decompoundQuery' => 'bool', + 'enableRules' => 'bool', + 'enablePersonalization' => 'bool', + 'queryType' => 'string', + 'removeWordsIfNoResults' => 'string', + 'advancedSyntax' => 'bool', + 'optionalWords' => 'string[]', + 'disableExactOnAttributes' => 'string[]', + 'exactOnSingleWordQuery' => 'string', + 'alternativesAsExact' => 'string[]', + 'advancedSyntaxFeatures' => 'string[]', + 'distinct' => 'int', + 'synonyms' => 'bool', + 'replaceSynonymsInHighlight' => 'bool', + 'minProximity' => 'int', + 'responseFields' => 'string[]', + 'maxFacetHits' => 'int', + 'attributeCriteriaComputedByMinProximity' => 'bool', + 'renderingContent' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'searchableAttributes' => null, + 'attributesForFaceting' => null, + 'unretrievableAttributes' => null, + 'attributesToRetrieve' => null, + 'restrictSearchableAttributes' => null, + 'ranking' => null, + 'customRanking' => null, + 'relevancyStrictness' => null, + 'attributesToHighlight' => null, + 'attributesToSnippet' => null, + 'highlightPreTag' => null, + 'highlightPostTag' => null, + 'snippetEllipsisText' => null, + 'restrictHighlightAndSnippetArrays' => null, + 'hitsPerPage' => null, + 'minWordSizefor1Typo' => null, + 'minWordSizefor2Typos' => null, + 'typoTolerance' => null, + 'allowTyposOnNumericTokens' => null, + 'disableTypoToleranceOnAttributes' => null, + 'separatorsToIndex' => null, + 'ignorePlurals' => null, + 'removeStopWords' => null, + 'keepDiacriticsOnCharacters' => null, + 'queryLanguages' => null, + 'decompoundQuery' => null, + 'enableRules' => null, + 'enablePersonalization' => null, + 'queryType' => null, + 'removeWordsIfNoResults' => null, + 'advancedSyntax' => null, + 'optionalWords' => null, + 'disableExactOnAttributes' => null, + 'exactOnSingleWordQuery' => null, + 'alternativesAsExact' => null, + 'advancedSyntaxFeatures' => null, + 'distinct' => null, + 'synonyms' => null, + 'replaceSynonymsInHighlight' => null, + 'minProximity' => null, + 'responseFields' => null, + 'maxFacetHits' => null, + 'attributeCriteriaComputedByMinProximity' => null, + 'renderingContent' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'searchableAttributes' => 'searchableAttributes', + 'attributesForFaceting' => 'attributesForFaceting', + 'unretrievableAttributes' => 'unretrievableAttributes', + 'attributesToRetrieve' => 'attributesToRetrieve', + 'restrictSearchableAttributes' => 'restrictSearchableAttributes', + 'ranking' => 'ranking', + 'customRanking' => 'customRanking', + 'relevancyStrictness' => 'relevancyStrictness', + 'attributesToHighlight' => 'attributesToHighlight', + 'attributesToSnippet' => 'attributesToSnippet', + 'highlightPreTag' => 'highlightPreTag', + 'highlightPostTag' => 'highlightPostTag', + 'snippetEllipsisText' => 'snippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'restrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'hitsPerPage', + 'minWordSizefor1Typo' => 'minWordSizefor1Typo', + 'minWordSizefor2Typos' => 'minWordSizefor2Typos', + 'typoTolerance' => 'typoTolerance', + 'allowTyposOnNumericTokens' => 'allowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'disableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'separatorsToIndex', + 'ignorePlurals' => 'ignorePlurals', + 'removeStopWords' => 'removeStopWords', + 'keepDiacriticsOnCharacters' => 'keepDiacriticsOnCharacters', + 'queryLanguages' => 'queryLanguages', + 'decompoundQuery' => 'decompoundQuery', + 'enableRules' => 'enableRules', + 'enablePersonalization' => 'enablePersonalization', + 'queryType' => 'queryType', + 'removeWordsIfNoResults' => 'removeWordsIfNoResults', + 'advancedSyntax' => 'advancedSyntax', + 'optionalWords' => 'optionalWords', + 'disableExactOnAttributes' => 'disableExactOnAttributes', + 'exactOnSingleWordQuery' => 'exactOnSingleWordQuery', + 'alternativesAsExact' => 'alternativesAsExact', + 'advancedSyntaxFeatures' => 'advancedSyntaxFeatures', + 'distinct' => 'distinct', + 'synonyms' => 'synonyms', + 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', + 'minProximity' => 'minProximity', + 'responseFields' => 'responseFields', + 'maxFacetHits' => 'maxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', + 'renderingContent' => 'renderingContent', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'searchableAttributes' => 'setSearchableAttributes', + 'attributesForFaceting' => 'setAttributesForFaceting', + 'unretrievableAttributes' => 'setUnretrievableAttributes', + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'restrictSearchableAttributes' => 'setRestrictSearchableAttributes', + 'ranking' => 'setRanking', + 'customRanking' => 'setCustomRanking', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'attributesToHighlight' => 'setAttributesToHighlight', + 'attributesToSnippet' => 'setAttributesToSnippet', + 'highlightPreTag' => 'setHighlightPreTag', + 'highlightPostTag' => 'setHighlightPostTag', + 'snippetEllipsisText' => 'setSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'setRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'setHitsPerPage', + 'minWordSizefor1Typo' => 'setMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'setMinWordSizefor2Typos', + 'typoTolerance' => 'setTypoTolerance', + 'allowTyposOnNumericTokens' => 'setAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'setDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'setSeparatorsToIndex', + 'ignorePlurals' => 'setIgnorePlurals', + 'removeStopWords' => 'setRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'setKeepDiacriticsOnCharacters', + 'queryLanguages' => 'setQueryLanguages', + 'decompoundQuery' => 'setDecompoundQuery', + 'enableRules' => 'setEnableRules', + 'enablePersonalization' => 'setEnablePersonalization', + 'queryType' => 'setQueryType', + 'removeWordsIfNoResults' => 'setRemoveWordsIfNoResults', + 'advancedSyntax' => 'setAdvancedSyntax', + 'optionalWords' => 'setOptionalWords', + 'disableExactOnAttributes' => 'setDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'setExactOnSingleWordQuery', + 'alternativesAsExact' => 'setAlternativesAsExact', + 'advancedSyntaxFeatures' => 'setAdvancedSyntaxFeatures', + 'distinct' => 'setDistinct', + 'synonyms' => 'setSynonyms', + 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', + 'minProximity' => 'setMinProximity', + 'responseFields' => 'setResponseFields', + 'maxFacetHits' => 'setMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'setRenderingContent', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'searchableAttributes' => 'getSearchableAttributes', + 'attributesForFaceting' => 'getAttributesForFaceting', + 'unretrievableAttributes' => 'getUnretrievableAttributes', + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'restrictSearchableAttributes' => 'getRestrictSearchableAttributes', + 'ranking' => 'getRanking', + 'customRanking' => 'getCustomRanking', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'attributesToHighlight' => 'getAttributesToHighlight', + 'attributesToSnippet' => 'getAttributesToSnippet', + 'highlightPreTag' => 'getHighlightPreTag', + 'highlightPostTag' => 'getHighlightPostTag', + 'snippetEllipsisText' => 'getSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'getRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'getHitsPerPage', + 'minWordSizefor1Typo' => 'getMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'getMinWordSizefor2Typos', + 'typoTolerance' => 'getTypoTolerance', + 'allowTyposOnNumericTokens' => 'getAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'getDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'getSeparatorsToIndex', + 'ignorePlurals' => 'getIgnorePlurals', + 'removeStopWords' => 'getRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'getKeepDiacriticsOnCharacters', + 'queryLanguages' => 'getQueryLanguages', + 'decompoundQuery' => 'getDecompoundQuery', + 'enableRules' => 'getEnableRules', + 'enablePersonalization' => 'getEnablePersonalization', + 'queryType' => 'getQueryType', + 'removeWordsIfNoResults' => 'getRemoveWordsIfNoResults', + 'advancedSyntax' => 'getAdvancedSyntax', + 'optionalWords' => 'getOptionalWords', + 'disableExactOnAttributes' => 'getDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'getExactOnSingleWordQuery', + 'alternativesAsExact' => 'getAlternativesAsExact', + 'advancedSyntaxFeatures' => 'getAdvancedSyntaxFeatures', + 'distinct' => 'getDistinct', + 'synonyms' => 'getSynonyms', + 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', + 'minProximity' => 'getMinProximity', + 'responseFields' => 'getResponseFields', + 'maxFacetHits' => 'getMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'getRenderingContent', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const TYPO_TOLERANCE_TRUE = 'true'; + const TYPO_TOLERANCE_FALSE = 'false'; + const TYPO_TOLERANCE_MIN = 'min'; + const TYPO_TOLERANCE_STRICT = 'strict'; + const QUERY_TYPE_PREFIX_LAST = 'prefixLast'; + const QUERY_TYPE_PREFIX_ALL = 'prefixAll'; + const QUERY_TYPE_PREFIX_NONE = 'prefixNone'; + const REMOVE_WORDS_IF_NO_RESULTS_NONE = 'none'; + const REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS = 'lastWords'; + const REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS = 'firstWords'; + const REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL = 'allOptional'; + const EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE = 'attribute'; + const EXACT_ON_SINGLE_WORD_QUERY_NONE = 'none'; + const EXACT_ON_SINGLE_WORD_QUERY_WORD = 'word'; + const ALTERNATIVES_AS_EXACT_IGNORE_PLURALS = 'ignorePlurals'; + const ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM = 'singleWordSynonym'; + const ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM = 'multiWordsSynonym'; + const ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE = 'exactPhrase'; + const ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS = 'excludeWords'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypoToleranceAllowableValues() + { + return [ + self::TYPO_TOLERANCE_TRUE, + self::TYPO_TOLERANCE_FALSE, + self::TYPO_TOLERANCE_MIN, + self::TYPO_TOLERANCE_STRICT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getQueryTypeAllowableValues() + { + return [ + self::QUERY_TYPE_PREFIX_LAST, + self::QUERY_TYPE_PREFIX_ALL, + self::QUERY_TYPE_PREFIX_NONE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemoveWordsIfNoResultsAllowableValues() + { + return [ + self::REMOVE_WORDS_IF_NO_RESULTS_NONE, + self::REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExactOnSingleWordQueryAllowableValues() + { + return [ + self::EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE, + self::EXACT_ON_SINGLE_WORD_QUERY_NONE, + self::EXACT_ON_SINGLE_WORD_QUERY_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAlternativesAsExactAllowableValues() + { + return [ + self::ALTERNATIVES_AS_EXACT_IGNORE_PLURALS, + self::ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM, + self::ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdvancedSyntaxFeaturesAllowableValues() + { + return [ + self::ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE, + self::ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['searchableAttributes'] = $data['searchableAttributes'] ?? null; + $this->container['attributesForFaceting'] = $data['attributesForFaceting'] ?? null; + $this->container['unretrievableAttributes'] = $data['unretrievableAttributes'] ?? null; + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve'] ?? null; + $this->container['restrictSearchableAttributes'] = $data['restrictSearchableAttributes'] ?? null; + $this->container['ranking'] = $data['ranking'] ?? null; + $this->container['customRanking'] = $data['customRanking'] ?? null; + $this->container['relevancyStrictness'] = $data['relevancyStrictness'] ?? 100; + $this->container['attributesToHighlight'] = $data['attributesToHighlight'] ?? null; + $this->container['attributesToSnippet'] = $data['attributesToSnippet'] ?? null; + $this->container['highlightPreTag'] = $data['highlightPreTag'] ?? ''; + $this->container['highlightPostTag'] = $data['highlightPostTag'] ?? ''; + $this->container['snippetEllipsisText'] = $data['snippetEllipsisText'] ?? '…'; + $this->container['restrictHighlightAndSnippetArrays'] = $data['restrictHighlightAndSnippetArrays'] ?? false; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['minWordSizefor1Typo'] = $data['minWordSizefor1Typo'] ?? 4; + $this->container['minWordSizefor2Typos'] = $data['minWordSizefor2Typos'] ?? 8; + $this->container['typoTolerance'] = $data['typoTolerance'] ?? 'true'; + $this->container['allowTyposOnNumericTokens'] = $data['allowTyposOnNumericTokens'] ?? true; + $this->container['disableTypoToleranceOnAttributes'] = $data['disableTypoToleranceOnAttributes'] ?? null; + $this->container['separatorsToIndex'] = $data['separatorsToIndex'] ?? ''; + $this->container['ignorePlurals'] = $data['ignorePlurals'] ?? 'false'; + $this->container['removeStopWords'] = $data['removeStopWords'] ?? 'false'; + $this->container['keepDiacriticsOnCharacters'] = $data['keepDiacriticsOnCharacters'] ?? ''; + $this->container['queryLanguages'] = $data['queryLanguages'] ?? null; + $this->container['decompoundQuery'] = $data['decompoundQuery'] ?? true; + $this->container['enableRules'] = $data['enableRules'] ?? true; + $this->container['enablePersonalization'] = $data['enablePersonalization'] ?? false; + $this->container['queryType'] = $data['queryType'] ?? 'prefixLast'; + $this->container['removeWordsIfNoResults'] = $data['removeWordsIfNoResults'] ?? 'none'; + $this->container['advancedSyntax'] = $data['advancedSyntax'] ?? false; + $this->container['optionalWords'] = $data['optionalWords'] ?? null; + $this->container['disableExactOnAttributes'] = $data['disableExactOnAttributes'] ?? null; + $this->container['exactOnSingleWordQuery'] = $data['exactOnSingleWordQuery'] ?? 'attribute'; + $this->container['alternativesAsExact'] = $data['alternativesAsExact'] ?? null; + $this->container['advancedSyntaxFeatures'] = $data['advancedSyntaxFeatures'] ?? null; + $this->container['distinct'] = $data['distinct'] ?? 0; + $this->container['synonyms'] = $data['synonyms'] ?? true; + $this->container['replaceSynonymsInHighlight'] = $data['replaceSynonymsInHighlight'] ?? false; + $this->container['minProximity'] = $data['minProximity'] ?? 1; + $this->container['responseFields'] = $data['responseFields'] ?? null; + $this->container['maxFacetHits'] = $data['maxFacetHits'] ?? 10; + $this->container['attributeCriteriaComputedByMinProximity'] = $data['attributeCriteriaComputedByMinProximity'] ?? false; + $this->container['renderingContent'] = $data['renderingContent'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($this->container['typoTolerance']) && !in_array($this->container['typoTolerance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'typoTolerance', must be one of '%s'", + $this->container['typoTolerance'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'queryType', must be one of '%s'", + $this->container['queryType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($this->container['removeWordsIfNoResults']) && !in_array($this->container['removeWordsIfNoResults'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $this->container['removeWordsIfNoResults'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($this->container['exactOnSingleWordQuery']) && !in_array($this->container['exactOnSingleWordQuery'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $this->container['exactOnSingleWordQuery'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['distinct']) && ($this->container['distinct'] > 4)) { + $invalidProperties[] = "invalid value for 'distinct', must be smaller than or equal to 4."; + } + + if (!is_null($this->container['distinct']) && ($this->container['distinct'] < 0)) { + $invalidProperties[] = "invalid value for 'distinct', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['minProximity']) && ($this->container['minProximity'] > 7)) { + $invalidProperties[] = "invalid value for 'minProximity', must be smaller than or equal to 7."; + } + + if (!is_null($this->container['minProximity']) && ($this->container['minProximity'] < 1)) { + $invalidProperties[] = "invalid value for 'minProximity', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + 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 searchableAttributes + * + * @return string[]|null + */ + public function getSearchableAttributes() + { + return $this->container['searchableAttributes']; + } + + /** + * Sets searchableAttributes + * + * @param string[]|null $searchableAttributes the complete list of attributes used for searching + * + * @return self + */ + public function setSearchableAttributes($searchableAttributes) + { + $this->container['searchableAttributes'] = $searchableAttributes; + + return $this; + } + + /** + * Gets attributesForFaceting + * + * @return string[]|null + */ + public function getAttributesForFaceting() + { + return $this->container['attributesForFaceting']; + } + + /** + * Sets attributesForFaceting + * + * @param string[]|null $attributesForFaceting the complete list of attributes that will be used for faceting + * + * @return self + */ + public function setAttributesForFaceting($attributesForFaceting) + { + $this->container['attributesForFaceting'] = $attributesForFaceting; + + return $this; + } + + /** + * Gets unretrievableAttributes + * + * @return string[]|null + */ + public function getUnretrievableAttributes() + { + return $this->container['unretrievableAttributes']; + } + + /** + * Sets unretrievableAttributes + * + * @param string[]|null $unretrievableAttributes list of attributes that can't be retrieved at query time + * + * @return self + */ + public function setUnretrievableAttributes($unretrievableAttributes) + { + $this->container['unretrievableAttributes'] = $unretrievableAttributes; + + return $this; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve']; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve this parameter controls which attributes to retrieve and which not to retrieve + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets restrictSearchableAttributes + * + * @return string[]|null + */ + public function getRestrictSearchableAttributes() + { + return $this->container['restrictSearchableAttributes']; + } + + /** + * Sets restrictSearchableAttributes + * + * @param string[]|null $restrictSearchableAttributes restricts a given query to look in only a subset of your searchable attributes + * + * @return self + */ + public function setRestrictSearchableAttributes($restrictSearchableAttributes) + { + $this->container['restrictSearchableAttributes'] = $restrictSearchableAttributes; + + return $this; + } + + /** + * Gets ranking + * + * @return string[]|null + */ + public function getRanking() + { + return $this->container['ranking']; + } + + /** + * Sets ranking + * + * @param string[]|null $ranking controls how Algolia should sort your results + * + * @return self + */ + public function setRanking($ranking) + { + $this->container['ranking'] = $ranking; + + return $this; + } + + /** + * Gets customRanking + * + * @return string[]|null + */ + public function getCustomRanking() + { + return $this->container['customRanking']; + } + + /** + * Sets customRanking + * + * @param string[]|null $customRanking specifies the custom ranking criterion + * + * @return self + */ + public function setCustomRanking($customRanking) + { + $this->container['customRanking'] = $customRanking; + + return $this; + } + + /** + * Gets relevancyStrictness + * + * @return int|null + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness']; + } + + /** + * Sets relevancyStrictness + * + * @param int|null $relevancyStrictness controls the relevancy threshold below which less relevant results aren't included in the results + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets attributesToHighlight + * + * @return string[]|null + */ + public function getAttributesToHighlight() + { + return $this->container['attributesToHighlight']; + } + + /** + * Sets attributesToHighlight + * + * @param string[]|null $attributesToHighlight list of attributes to highlight + * + * @return self + */ + public function setAttributesToHighlight($attributesToHighlight) + { + $this->container['attributesToHighlight'] = $attributesToHighlight; + + return $this; + } + + /** + * Gets attributesToSnippet + * + * @return string[]|null + */ + public function getAttributesToSnippet() + { + return $this->container['attributesToSnippet']; + } + + /** + * Sets attributesToSnippet + * + * @param string[]|null $attributesToSnippet list of attributes to snippet, with an optional maximum number of words to snippet + * + * @return self + */ + public function setAttributesToSnippet($attributesToSnippet) + { + $this->container['attributesToSnippet'] = $attributesToSnippet; + + return $this; + } + + /** + * Gets highlightPreTag + * + * @return string|null + */ + public function getHighlightPreTag() + { + return $this->container['highlightPreTag']; + } + + /** + * Sets highlightPreTag + * + * @param string|null $highlightPreTag the HTML string to insert before the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPreTag($highlightPreTag) + { + $this->container['highlightPreTag'] = $highlightPreTag; + + return $this; + } + + /** + * Gets highlightPostTag + * + * @return string|null + */ + public function getHighlightPostTag() + { + return $this->container['highlightPostTag']; + } + + /** + * Sets highlightPostTag + * + * @param string|null $highlightPostTag the HTML string to insert after the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPostTag($highlightPostTag) + { + $this->container['highlightPostTag'] = $highlightPostTag; + + return $this; + } + + /** + * Gets snippetEllipsisText + * + * @return string|null + */ + public function getSnippetEllipsisText() + { + return $this->container['snippetEllipsisText']; + } + + /** + * Sets snippetEllipsisText + * + * @param string|null $snippetEllipsisText string used as an ellipsis indicator when a snippet is truncated + * + * @return self + */ + public function setSnippetEllipsisText($snippetEllipsisText) + { + $this->container['snippetEllipsisText'] = $snippetEllipsisText; + + return $this; + } + + /** + * Gets restrictHighlightAndSnippetArrays + * + * @return bool|null + */ + public function getRestrictHighlightAndSnippetArrays() + { + return $this->container['restrictHighlightAndSnippetArrays']; + } + + /** + * Sets restrictHighlightAndSnippetArrays + * + * @param bool|null $restrictHighlightAndSnippetArrays restrict highlighting and snippeting to items that matched the query + * + * @return self + */ + public function setRestrictHighlightAndSnippetArrays($restrictHighlightAndSnippetArrays) + { + $this->container['restrictHighlightAndSnippetArrays'] = $restrictHighlightAndSnippetArrays; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets minWordSizefor1Typo + * + * @return int|null + */ + public function getMinWordSizefor1Typo() + { + return $this->container['minWordSizefor1Typo']; + } + + /** + * Sets minWordSizefor1Typo + * + * @param int|null $minWordSizefor1Typo minimum number of characters a word in the query string must contain to accept matches with 1 typo + * + * @return self + */ + public function setMinWordSizefor1Typo($minWordSizefor1Typo) + { + $this->container['minWordSizefor1Typo'] = $minWordSizefor1Typo; + + return $this; + } + + /** + * Gets minWordSizefor2Typos + * + * @return int|null + */ + public function getMinWordSizefor2Typos() + { + return $this->container['minWordSizefor2Typos']; + } + + /** + * Sets minWordSizefor2Typos + * + * @param int|null $minWordSizefor2Typos minimum number of characters a word in the query string must contain to accept matches with 2 typos + * + * @return self + */ + public function setMinWordSizefor2Typos($minWordSizefor2Typos) + { + $this->container['minWordSizefor2Typos'] = $minWordSizefor2Typos; + + return $this; + } + + /** + * Gets typoTolerance + * + * @return string|null + */ + public function getTypoTolerance() + { + return $this->container['typoTolerance']; + } + + /** + * Sets typoTolerance + * + * @param string|null $typoTolerance controls whether typo tolerance is enabled and how it is applied + * + * @return self + */ + public function setTypoTolerance($typoTolerance) + { + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($typoTolerance) && !in_array($typoTolerance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'typoTolerance', must be one of '%s'", + $typoTolerance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['typoTolerance'] = $typoTolerance; + + return $this; + } + + /** + * Gets allowTyposOnNumericTokens + * + * @return bool|null + */ + public function getAllowTyposOnNumericTokens() + { + return $this->container['allowTyposOnNumericTokens']; + } + + /** + * Sets allowTyposOnNumericTokens + * + * @param bool|null $allowTyposOnNumericTokens whether to allow typos on numbers (\"numeric tokens\") in the query string + * + * @return self + */ + public function setAllowTyposOnNumericTokens($allowTyposOnNumericTokens) + { + $this->container['allowTyposOnNumericTokens'] = $allowTyposOnNumericTokens; + + return $this; + } + + /** + * Gets disableTypoToleranceOnAttributes + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnAttributes() + { + return $this->container['disableTypoToleranceOnAttributes']; + } + + /** + * Sets disableTypoToleranceOnAttributes + * + * @param string[]|null $disableTypoToleranceOnAttributes list of attributes on which you want to disable typo tolerance + * + * @return self + */ + public function setDisableTypoToleranceOnAttributes($disableTypoToleranceOnAttributes) + { + $this->container['disableTypoToleranceOnAttributes'] = $disableTypoToleranceOnAttributes; + + return $this; + } + + /** + * Gets separatorsToIndex + * + * @return string|null + */ + public function getSeparatorsToIndex() + { + return $this->container['separatorsToIndex']; + } + + /** + * Sets separatorsToIndex + * + * @param string|null $separatorsToIndex control which separators are indexed + * + * @return self + */ + public function setSeparatorsToIndex($separatorsToIndex) + { + $this->container['separatorsToIndex'] = $separatorsToIndex; + + return $this; + } + + /** + * Gets ignorePlurals + * + * @return string|null + */ + public function getIgnorePlurals() + { + return $this->container['ignorePlurals']; + } + + /** + * Sets ignorePlurals + * + * @param string|null $ignorePlurals treats singular, plurals, and other forms of declensions as matching terms + * + * @return self + */ + public function setIgnorePlurals($ignorePlurals) + { + $this->container['ignorePlurals'] = $ignorePlurals; + + return $this; + } + + /** + * Gets removeStopWords + * + * @return string|null + */ + public function getRemoveStopWords() + { + return $this->container['removeStopWords']; + } + + /** + * Sets removeStopWords + * + * @param string|null $removeStopWords removes stop (common) words from the query before executing it + * + * @return self + */ + public function setRemoveStopWords($removeStopWords) + { + $this->container['removeStopWords'] = $removeStopWords; + + return $this; + } + + /** + * Gets keepDiacriticsOnCharacters + * + * @return string|null + */ + public function getKeepDiacriticsOnCharacters() + { + return $this->container['keepDiacriticsOnCharacters']; + } + + /** + * Sets keepDiacriticsOnCharacters + * + * @param string|null $keepDiacriticsOnCharacters list of characters that the engine shouldn't automatically normalize + * + * @return self + */ + public function setKeepDiacriticsOnCharacters($keepDiacriticsOnCharacters) + { + $this->container['keepDiacriticsOnCharacters'] = $keepDiacriticsOnCharacters; + + return $this; + } + + /** + * Gets queryLanguages + * + * @return string[]|null + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages']; + } + + /** + * Sets queryLanguages + * + * @param string[]|null $queryLanguages sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets decompoundQuery + * + * @return bool|null + */ + public function getDecompoundQuery() + { + return $this->container['decompoundQuery']; + } + + /** + * Sets decompoundQuery + * + * @param bool|null $decompoundQuery splits compound words into their composing atoms in the query + * + * @return self + */ + public function setDecompoundQuery($decompoundQuery) + { + $this->container['decompoundQuery'] = $decompoundQuery; + + return $this; + } + + /** + * Gets enableRules + * + * @return bool|null + */ + public function getEnableRules() + { + return $this->container['enableRules']; + } + + /** + * Sets enableRules + * + * @param bool|null $enableRules whether Rules should be globally enabled + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets enablePersonalization + * + * @return bool|null + */ + public function getEnablePersonalization() + { + return $this->container['enablePersonalization']; + } + + /** + * Sets enablePersonalization + * + * @param bool|null $enablePersonalization enable the Personalization feature + * + * @return self + */ + public function setEnablePersonalization($enablePersonalization) + { + $this->container['enablePersonalization'] = $enablePersonalization; + + return $this; + } + + /** + * Gets queryType + * + * @return string|null + */ + public function getQueryType() + { + return $this->container['queryType']; + } + + /** + * Sets queryType + * + * @param string|null $queryType controls if and how query words are interpreted as prefixes + * + * @return self + */ + public function setQueryType($queryType) + { + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($queryType) && !in_array($queryType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'queryType', must be one of '%s'", + $queryType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['queryType'] = $queryType; + + return $this; + } + + /** + * Gets removeWordsIfNoResults + * + * @return string|null + */ + public function getRemoveWordsIfNoResults() + { + return $this->container['removeWordsIfNoResults']; + } + + /** + * Sets removeWordsIfNoResults + * + * @param string|null $removeWordsIfNoResults selects a strategy to remove words from the query when it doesn't match any hits + * + * @return self + */ + public function setRemoveWordsIfNoResults($removeWordsIfNoResults) + { + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($removeWordsIfNoResults) && !in_array($removeWordsIfNoResults, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $removeWordsIfNoResults, + implode("', '", $allowedValues) + ) + ); + } + $this->container['removeWordsIfNoResults'] = $removeWordsIfNoResults; + + return $this; + } + + /** + * Gets advancedSyntax + * + * @return bool|null + */ + public function getAdvancedSyntax() + { + return $this->container['advancedSyntax']; + } + + /** + * Sets advancedSyntax + * + * @param bool|null $advancedSyntax enables the advanced query syntax + * + * @return self + */ + public function setAdvancedSyntax($advancedSyntax) + { + $this->container['advancedSyntax'] = $advancedSyntax; + + return $this; + } + + /** + * Gets optionalWords + * + * @return string[]|null + */ + public function getOptionalWords() + { + return $this->container['optionalWords']; + } + + /** + * Sets optionalWords + * + * @param string[]|null $optionalWords a list of words that should be considered as optional when found in the query + * + * @return self + */ + public function setOptionalWords($optionalWords) + { + $this->container['optionalWords'] = $optionalWords; + + return $this; + } + + /** + * Gets disableExactOnAttributes + * + * @return string[]|null + */ + public function getDisableExactOnAttributes() + { + return $this->container['disableExactOnAttributes']; + } + + /** + * Sets disableExactOnAttributes + * + * @param string[]|null $disableExactOnAttributes list of attributes on which you want to disable the exact ranking criterion + * + * @return self + */ + public function setDisableExactOnAttributes($disableExactOnAttributes) + { + $this->container['disableExactOnAttributes'] = $disableExactOnAttributes; + + return $this; + } + + /** + * Gets exactOnSingleWordQuery + * + * @return string|null + */ + public function getExactOnSingleWordQuery() + { + return $this->container['exactOnSingleWordQuery']; + } + + /** + * Sets exactOnSingleWordQuery + * + * @param string|null $exactOnSingleWordQuery controls how the exact ranking criterion is computed when the query contains only one word + * + * @return self + */ + public function setExactOnSingleWordQuery($exactOnSingleWordQuery) + { + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($exactOnSingleWordQuery) && !in_array($exactOnSingleWordQuery, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $exactOnSingleWordQuery, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exactOnSingleWordQuery'] = $exactOnSingleWordQuery; + + return $this; + } + + /** + * Gets alternativesAsExact + * + * @return string[]|null + */ + public function getAlternativesAsExact() + { + return $this->container['alternativesAsExact']; + } + + /** + * Sets alternativesAsExact + * + * @param string[]|null $alternativesAsExact list of alternatives that should be considered an exact match by the exact ranking criterion + * + * @return self + */ + public function setAlternativesAsExact($alternativesAsExact) + { + $allowedValues = $this->getAlternativesAsExactAllowableValues(); + if (!is_null($alternativesAsExact) && array_diff($alternativesAsExact, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'alternativesAsExact', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['alternativesAsExact'] = $alternativesAsExact; + + return $this; + } + + /** + * Gets advancedSyntaxFeatures + * + * @return string[]|null + */ + public function getAdvancedSyntaxFeatures() + { + return $this->container['advancedSyntaxFeatures']; + } + + /** + * Sets advancedSyntaxFeatures + * + * @param string[]|null $advancedSyntaxFeatures allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled + * + * @return self + */ + public function setAdvancedSyntaxFeatures($advancedSyntaxFeatures) + { + $allowedValues = $this->getAdvancedSyntaxFeaturesAllowableValues(); + if (!is_null($advancedSyntaxFeatures) && array_diff($advancedSyntaxFeatures, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'advancedSyntaxFeatures', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['advancedSyntaxFeatures'] = $advancedSyntaxFeatures; + + return $this; + } + + /** + * Gets distinct + * + * @return int|null + */ + public function getDistinct() + { + return $this->container['distinct']; + } + + /** + * Sets distinct + * + * @param int|null $distinct enables de-duplication or grouping of results + * + * @return self + */ + public function setDistinct($distinct) + { + if (!is_null($distinct) && ($distinct > 4)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling IndexSettingsAsSearchParams., must be smaller than or equal to 4.'); + } + if (!is_null($distinct) && ($distinct < 0)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling IndexSettingsAsSearchParams., must be bigger than or equal to 0.'); + } + + $this->container['distinct'] = $distinct; + + return $this; + } + + /** + * Gets synonyms + * + * @return bool|null + */ + public function getSynonyms() + { + return $this->container['synonyms']; + } + + /** + * Sets synonyms + * + * @param bool|null $synonyms whether to take into account an index's synonyms for a particular search + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets replaceSynonymsInHighlight + * + * @return bool|null + */ + public function getReplaceSynonymsInHighlight() + { + return $this->container['replaceSynonymsInHighlight']; + } + + /** + * Sets replaceSynonymsInHighlight + * + * @param bool|null $replaceSynonymsInHighlight whether to highlight and snippet the original word that matches the synonym or the synonym itself + * + * @return self + */ + public function setReplaceSynonymsInHighlight($replaceSynonymsInHighlight) + { + $this->container['replaceSynonymsInHighlight'] = $replaceSynonymsInHighlight; + + return $this; + } + + /** + * Gets minProximity + * + * @return int|null + */ + public function getMinProximity() + { + return $this->container['minProximity']; + } + + /** + * Sets minProximity + * + * @param int|null $minProximity precision of the proximity ranking criterion + * + * @return self + */ + public function setMinProximity($minProximity) + { + if (!is_null($minProximity) && ($minProximity > 7)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling IndexSettingsAsSearchParams., must be smaller than or equal to 7.'); + } + if (!is_null($minProximity) && ($minProximity < 1)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling IndexSettingsAsSearchParams., must be bigger than or equal to 1.'); + } + + $this->container['minProximity'] = $minProximity; + + return $this; + } + + /** + * Gets responseFields + * + * @return string[]|null + */ + public function getResponseFields() + { + return $this->container['responseFields']; + } + + /** + * Sets responseFields + * + * @param string[]|null $responseFields Choose which fields to return in the API response. This parameters applies to search and browse queries. + * + * @return self + */ + public function setResponseFields($responseFields) + { + $this->container['responseFields'] = $responseFields; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits']; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling IndexSettingsAsSearchParams., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets attributeCriteriaComputedByMinProximity + * + * @return bool|null + */ + public function getAttributeCriteriaComputedByMinProximity() + { + return $this->container['attributeCriteriaComputedByMinProximity']; + } + + /** + * Sets attributeCriteriaComputedByMinProximity + * + * @param bool|null $attributeCriteriaComputedByMinProximity when attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage + * + * @return self + */ + public function setAttributeCriteriaComputedByMinProximity($attributeCriteriaComputedByMinProximity) + { + $this->container['attributeCriteriaComputedByMinProximity'] = $attributeCriteriaComputedByMinProximity; + + return $this; + } + + /** + * Gets renderingContent + * + * @return object|null + */ + public function getRenderingContent() + { + return $this->container['renderingContent']; + } + + /** + * Sets renderingContent + * + * @param object|null $renderingContent Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/ModelInterface.php b/clients/algoliasearch-client-php/lib/Model/Recommend/ModelInterface.php new file mode 100644 index 0000000000..124b81ee45 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/ModelInterface.php @@ -0,0 +1,68 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RankingInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'rankingInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'filters' => 'int', + 'firstMatchedWord' => 'int', + 'geoDistance' => 'int', + 'geoPrecision' => 'int', + 'matchedGeoLocation' => 'array', + 'nbExactWords' => 'int', + 'nbTypos' => 'int', + 'promoted' => 'bool', + 'proximityDistance' => 'int', + 'userScore' => 'int', + 'word' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'filters' => null, + 'firstMatchedWord' => null, + 'geoDistance' => null, + 'geoPrecision' => null, + 'matchedGeoLocation' => null, + 'nbExactWords' => null, + 'nbTypos' => null, + 'promoted' => null, + 'proximityDistance' => null, + 'userScore' => null, + 'word' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'filters' => 'filters', + 'firstMatchedWord' => 'firstMatchedWord', + 'geoDistance' => 'geoDistance', + 'geoPrecision' => 'geoPrecision', + 'matchedGeoLocation' => 'matchedGeoLocation', + 'nbExactWords' => 'nbExactWords', + 'nbTypos' => 'nbTypos', + 'promoted' => 'promoted', + 'proximityDistance' => 'proximityDistance', + 'userScore' => 'userScore', + 'word' => 'word', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'filters' => 'setFilters', + 'firstMatchedWord' => 'setFirstMatchedWord', + 'geoDistance' => 'setGeoDistance', + 'geoPrecision' => 'setGeoPrecision', + 'matchedGeoLocation' => 'setMatchedGeoLocation', + 'nbExactWords' => 'setNbExactWords', + 'nbTypos' => 'setNbTypos', + 'promoted' => 'setPromoted', + 'proximityDistance' => 'setProximityDistance', + 'userScore' => 'setUserScore', + 'word' => 'setWord', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'filters' => 'getFilters', + 'firstMatchedWord' => 'getFirstMatchedWord', + 'geoDistance' => 'getGeoDistance', + 'geoPrecision' => 'getGeoPrecision', + 'matchedGeoLocation' => 'getMatchedGeoLocation', + 'nbExactWords' => 'getNbExactWords', + 'nbTypos' => 'getNbTypos', + 'promoted' => 'getPromoted', + 'proximityDistance' => 'getProximityDistance', + 'userScore' => 'getUserScore', + 'word' => 'getWord', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['filters'] = $data['filters'] ?? null; + $this->container['firstMatchedWord'] = $data['firstMatchedWord'] ?? null; + $this->container['geoDistance'] = $data['geoDistance'] ?? null; + $this->container['geoPrecision'] = $data['geoPrecision'] ?? null; + $this->container['matchedGeoLocation'] = $data['matchedGeoLocation'] ?? null; + $this->container['nbExactWords'] = $data['nbExactWords'] ?? null; + $this->container['nbTypos'] = $data['nbTypos'] ?? null; + $this->container['promoted'] = $data['promoted'] ?? null; + $this->container['proximityDistance'] = $data['proximityDistance'] ?? null; + $this->container['userScore'] = $data['userScore'] ?? null; + $this->container['word'] = $data['word'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 filters + * + * @return int|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param int|null $filters this field is reserved for advanced usage + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets firstMatchedWord + * + * @return int|null + */ + public function getFirstMatchedWord() + { + return $this->container['firstMatchedWord']; + } + + /** + * Sets firstMatchedWord + * + * @param int|null $firstMatchedWord position of the most important matched attribute in the attributes to index list + * + * @return self + */ + public function setFirstMatchedWord($firstMatchedWord) + { + $this->container['firstMatchedWord'] = $firstMatchedWord; + + return $this; + } + + /** + * Gets geoDistance + * + * @return int|null + */ + public function getGeoDistance() + { + return $this->container['geoDistance']; + } + + /** + * Sets geoDistance + * + * @param int|null $geoDistance distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters) + * + * @return self + */ + public function setGeoDistance($geoDistance) + { + $this->container['geoDistance'] = $geoDistance; + + return $this; + } + + /** + * Gets geoPrecision + * + * @return int|null + */ + public function getGeoPrecision() + { + return $this->container['geoPrecision']; + } + + /** + * Sets geoPrecision + * + * @param int|null $geoPrecision precision used when computing the geo distance, in meters + * + * @return self + */ + public function setGeoPrecision($geoPrecision) + { + $this->container['geoPrecision'] = $geoPrecision; + + return $this; + } + + /** + * Gets matchedGeoLocation + * + * @return array|null + */ + public function getMatchedGeoLocation() + { + return $this->container['matchedGeoLocation']; + } + + /** + * Sets matchedGeoLocation + * + * @param array|null $matchedGeoLocation matchedGeoLocation + * + * @return self + */ + public function setMatchedGeoLocation($matchedGeoLocation) + { + $this->container['matchedGeoLocation'] = $matchedGeoLocation; + + return $this; + } + + /** + * Gets nbExactWords + * + * @return int|null + */ + public function getNbExactWords() + { + return $this->container['nbExactWords']; + } + + /** + * Sets nbExactWords + * + * @param int|null $nbExactWords number of exactly matched words + * + * @return self + */ + public function setNbExactWords($nbExactWords) + { + $this->container['nbExactWords'] = $nbExactWords; + + return $this; + } + + /** + * Gets nbTypos + * + * @return int|null + */ + public function getNbTypos() + { + return $this->container['nbTypos']; + } + + /** + * Sets nbTypos + * + * @param int|null $nbTypos number of typos encountered when matching the record + * + * @return self + */ + public function setNbTypos($nbTypos) + { + $this->container['nbTypos'] = $nbTypos; + + return $this; + } + + /** + * Gets promoted + * + * @return bool|null + */ + public function getPromoted() + { + return $this->container['promoted']; + } + + /** + * Sets promoted + * + * @param bool|null $promoted present and set to true if a Rule promoted the hit + * + * @return self + */ + public function setPromoted($promoted) + { + $this->container['promoted'] = $promoted; + + return $this; + } + + /** + * Gets proximityDistance + * + * @return int|null + */ + public function getProximityDistance() + { + return $this->container['proximityDistance']; + } + + /** + * Sets proximityDistance + * + * @param int|null $proximityDistance when the query contains more than one word, the sum of the distances between matched words (in meters) + * + * @return self + */ + public function setProximityDistance($proximityDistance) + { + $this->container['proximityDistance'] = $proximityDistance; + + return $this; + } + + /** + * Gets userScore + * + * @return int|null + */ + public function getUserScore() + { + return $this->container['userScore']; + } + + /** + * Sets userScore + * + * @param int|null $userScore custom ranking for the object, expressed as a single integer value + * + * @return self + */ + public function setUserScore($userScore) + { + $this->container['userScore'] = $userScore; + + return $this; + } + + /** + * Gets word + * + * @return int|null + */ + public function getWord() + { + return $this->container['word']; + } + + /** + * Sets word + * + * @param int|null $word number of matched words, including prefixes and typos + * + * @return self + */ + public function setWord($word) + { + $this->container['word'] = $word; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/RankingInfoMatchedGeoLocation.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RankingInfoMatchedGeoLocation.php new file mode 100644 index 0000000000..770ad75ff7 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RankingInfoMatchedGeoLocation.php @@ -0,0 +1,350 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RankingInfoMatchedGeoLocation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'rankingInfo_matchedGeoLocation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'lat' => 'double', + 'lng' => 'double', + 'distance' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'lat' => 'double', + 'lng' => 'double', + 'distance' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'lat' => 'lat', + 'lng' => 'lng', + 'distance' => 'distance', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'lat' => 'setLat', + 'lng' => 'setLng', + 'distance' => 'setDistance', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'lat' => 'getLat', + 'lng' => 'getLng', + 'distance' => 'getDistance', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['lat'] = $data['lat'] ?? null; + $this->container['lng'] = $data['lng'] ?? null; + $this->container['distance'] = $data['distance'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + 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 lat + * + * @return float|null + */ + public function getLat() + { + return $this->container['lat']; + } + + /** + * Sets lat + * + * @param float|null $lat latitude of the matched location + * + * @return self + */ + public function setLat($lat) + { + $this->container['lat'] = $lat; + + return $this; + } + + /** + * Gets lng + * + * @return float|null + */ + public function getLng() + { + return $this->container['lng']; + } + + /** + * Sets lng + * + * @param float|null $lng longitude of the matched location + * + * @return self + */ + public function setLng($lng) + { + $this->container['lng'] = $lng; + + return $this; + } + + /** + * Gets distance + * + * @return int|null + */ + public function getDistance() + { + return $this->container['distance']; + } + + /** + * Sets distance + * + * @param int|null $distance distance between the matched location and the search location (in meters) + * + * @return self + */ + public function setDistance($distance) + { + $this->container['distance'] = $distance; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/RecommendHit.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendHit.php similarity index 92% rename from clients/algoliasearch-client-php/lib/Model/RecommendHit.php rename to clients/algoliasearch-client-php/lib/Model/Recommend/RecommendHit.php index 9fa2db0e09..b4fc8f74f0 100644 --- a/clients/algoliasearch-client-php/lib/Model/RecommendHit.php +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendHit.php @@ -1,6 +1,6 @@ 'string', - 'highlightResult' => '\Algolia\AlgoliaSearch\Model\HighlightResult', - 'snippetResult' => '\Algolia\AlgoliaSearch\Model\SnippetResult', - 'rankingInfo' => '\Algolia\AlgoliaSearch\Model\RankingInfo', + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\Recommend\HighlightResult', + 'snippetResult' => '\Algolia\AlgoliaSearch\Model\Recommend\SnippetResult', + 'rankingInfo' => '\Algolia\AlgoliaSearch\Model\Recommend\RankingInfo', 'distinctSeqID' => 'int', 'score' => 'double', ]; @@ -248,7 +248,7 @@ public function setObjectID($objectID) /** * Gets highlightResult * - * @return \Algolia\AlgoliaSearch\Model\HighlightResult|null + * @return \Algolia\AlgoliaSearch\Model\Recommend\HighlightResult|null */ public function getHighlightResult() { @@ -258,7 +258,7 @@ public function getHighlightResult() /** * Sets highlightResult * - * @param \Algolia\AlgoliaSearch\Model\HighlightResult|null $highlightResult highlightResult + * @param \Algolia\AlgoliaSearch\Model\Recommend\HighlightResult|null $highlightResult highlightResult * * @return self */ @@ -272,7 +272,7 @@ public function setHighlightResult($highlightResult) /** * Gets snippetResult * - * @return \Algolia\AlgoliaSearch\Model\SnippetResult|null + * @return \Algolia\AlgoliaSearch\Model\Recommend\SnippetResult|null */ public function getSnippetResult() { @@ -282,7 +282,7 @@ public function getSnippetResult() /** * Sets snippetResult * - * @param \Algolia\AlgoliaSearch\Model\SnippetResult|null $snippetResult snippetResult + * @param \Algolia\AlgoliaSearch\Model\Recommend\SnippetResult|null $snippetResult snippetResult * * @return self */ @@ -296,7 +296,7 @@ public function setSnippetResult($snippetResult) /** * Gets rankingInfo * - * @return \Algolia\AlgoliaSearch\Model\RankingInfo|null + * @return \Algolia\AlgoliaSearch\Model\Recommend\RankingInfo|null */ public function getRankingInfo() { @@ -306,7 +306,7 @@ public function getRankingInfo() /** * Sets rankingInfo * - * @param \Algolia\AlgoliaSearch\Model\RankingInfo|null $rankingInfo rankingInfo + * @param \Algolia\AlgoliaSearch\Model\Recommend\RankingInfo|null $rankingInfo rankingInfo * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/RecommendHits.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendHits.php similarity index 95% rename from clients/algoliasearch-client-php/lib/Model/RecommendHits.php rename to clients/algoliasearch-client-php/lib/Model/Recommend/RecommendHits.php index 3b25352c10..c4f66e5325 100644 --- a/clients/algoliasearch-client-php/lib/Model/RecommendHits.php +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendHits.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\RecommendHit[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\Recommend\RecommendHit[]', ]; /** @@ -178,7 +178,7 @@ public function valid() /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\RecommendHit[]|null + * @return \Algolia\AlgoliaSearch\Model\Recommend\RecommendHit[]|null */ public function getHits() { @@ -188,7 +188,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\RecommendHit[]|null $hits hits + * @param \Algolia\AlgoliaSearch\Model\Recommend\RecommendHit[]|null $hits hits * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/RecommendationRequest.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationRequest.php similarity index 95% rename from clients/algoliasearch-client-php/lib/Model/RecommendationRequest.php rename to clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationRequest.php index d72630b8e5..8e6800bbec 100644 --- a/clients/algoliasearch-client-php/lib/Model/RecommendationRequest.php +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationRequest.php @@ -1,6 +1,6 @@ 'string', 'threshold' => 'int', 'maxRecommendations' => 'int', - 'queryParameters' => '\Algolia\AlgoliaSearch\Model\SearchParams', - 'fallbackParameters' => '\Algolia\AlgoliaSearch\Model\SearchParams', + 'queryParameters' => '\Algolia\AlgoliaSearch\Model\Recommend\SearchParams', + 'fallbackParameters' => '\Algolia\AlgoliaSearch\Model\Recommend\SearchParams', ]; /** @@ -396,7 +396,7 @@ public function setMaxRecommendations($maxRecommendations) /** * Gets queryParameters * - * @return \Algolia\AlgoliaSearch\Model\SearchParams|null + * @return \Algolia\AlgoliaSearch\Model\Recommend\SearchParams|null */ public function getQueryParameters() { @@ -406,7 +406,7 @@ public function getQueryParameters() /** * Sets queryParameters * - * @param \Algolia\AlgoliaSearch\Model\SearchParams|null $queryParameters queryParameters + * @param \Algolia\AlgoliaSearch\Model\Recommend\SearchParams|null $queryParameters queryParameters * * @return self */ @@ -420,7 +420,7 @@ public function setQueryParameters($queryParameters) /** * Gets fallbackParameters * - * @return \Algolia\AlgoliaSearch\Model\SearchParams|null + * @return \Algolia\AlgoliaSearch\Model\Recommend\SearchParams|null */ public function getFallbackParameters() { @@ -430,7 +430,7 @@ public function getFallbackParameters() /** * Sets fallbackParameters * - * @param \Algolia\AlgoliaSearch\Model\SearchParams|null $fallbackParameters fallbackParameters + * @param \Algolia\AlgoliaSearch\Model\Recommend\SearchParams|null $fallbackParameters fallbackParameters * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/RecommendationsResponse.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsResponse.php similarity index 97% rename from clients/algoliasearch-client-php/lib/Model/RecommendationsResponse.php rename to clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsResponse.php index 54ffb28f63..9aa697d6aa 100644 --- a/clients/algoliasearch-client-php/lib/Model/RecommendationsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsResponse.php @@ -1,6 +1,6 @@ 'bool', 'exhaustiveTypo' => 'bool', 'facets' => 'array>', - 'facetsStats' => 'array', + 'facetsStats' => 'array', 'hitsPerPage' => 'int', 'index' => 'string', 'indexUsed' => 'string', @@ -55,7 +55,7 @@ class RecommendationsResponse implements ModelInterface, ArrayAccess, \JsonSeria 'queryAfterRemoval' => 'string', 'serverUsed' => 'string', 'userData' => 'object', - 'hits' => '\Algolia\AlgoliaSearch\Model\RecommendHit[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\Recommend\RecommendHit[]', ]; /** @@ -553,7 +553,7 @@ public function setFacets($facets) /** * Gets facetsStats * - * @return array|null + * @return array|null */ public function getFacetsStats() { @@ -563,7 +563,7 @@ public function getFacetsStats() /** * Sets facetsStats * - * @param array|null $facetsStats statistics for numerical facets + * @param array|null $facetsStats statistics for numerical facets * * @return self */ @@ -937,7 +937,7 @@ public function setUserData($userData) /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\RecommendHit[] + * @return \Algolia\AlgoliaSearch\Model\Recommend\RecommendHit[] */ public function getHits() { @@ -947,7 +947,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\RecommendHit[] $hits hits + * @param \Algolia\AlgoliaSearch\Model\Recommend\RecommendHit[] $hits hits * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/RequiredSearchParams.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RequiredSearchParams.php new file mode 100644 index 0000000000..332adc5732 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RequiredSearchParams.php @@ -0,0 +1,294 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class RequiredSearchParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'requiredSearchParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'query' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'query' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'query' => 'query', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['query'] = $data['query'] ?? ''; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' 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 query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/SearchParams.php b/clients/algoliasearch-client-php/lib/Model/Recommend/SearchParams.php new file mode 100644 index 0000000000..870f3f6c51 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/SearchParams.php @@ -0,0 +1,2833 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SearchParams implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'searchParams'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'similarQuery' => 'string', + 'filters' => 'string', + 'facetFilters' => 'string[]', + 'optionalFilters' => 'string[]', + 'numericFilters' => 'string[]', + 'tagFilters' => 'string[]', + 'sumOrFiltersScores' => 'bool', + 'facets' => 'string[]', + 'maxValuesPerFacet' => 'int', + 'facetingAfterDistinct' => 'bool', + 'sortFacetValuesBy' => 'string', + 'page' => 'int', + 'offset' => 'int', + 'length' => 'int', + 'aroundLatLng' => 'string', + 'aroundLatLngViaIP' => 'bool', + 'aroundRadius' => 'OneOfIntegerString', + 'aroundPrecision' => 'int', + 'minimumAroundRadius' => 'int', + 'insideBoundingBox' => 'float[]', + 'insidePolygon' => 'float[]', + 'naturalLanguages' => 'string[]', + 'ruleContexts' => 'string[]', + 'personalizationImpact' => 'int', + 'userToken' => 'string', + 'getRankingInfo' => 'bool', + 'clickAnalytics' => 'bool', + 'analytics' => 'bool', + 'analyticsTags' => 'string[]', + 'percentileComputation' => 'bool', + 'enableABTest' => 'bool', + 'enableReRanking' => 'bool', + 'query' => 'string', + 'searchableAttributes' => 'string[]', + 'attributesForFaceting' => 'string[]', + 'unretrievableAttributes' => 'string[]', + 'attributesToRetrieve' => 'string[]', + 'restrictSearchableAttributes' => 'string[]', + 'ranking' => 'string[]', + 'customRanking' => 'string[]', + 'relevancyStrictness' => 'int', + 'attributesToHighlight' => 'string[]', + 'attributesToSnippet' => 'string[]', + 'highlightPreTag' => 'string', + 'highlightPostTag' => 'string', + 'snippetEllipsisText' => 'string', + 'restrictHighlightAndSnippetArrays' => 'bool', + 'hitsPerPage' => 'int', + 'minWordSizefor1Typo' => 'int', + 'minWordSizefor2Typos' => 'int', + 'typoTolerance' => 'string', + 'allowTyposOnNumericTokens' => 'bool', + 'disableTypoToleranceOnAttributes' => 'string[]', + 'separatorsToIndex' => 'string', + 'ignorePlurals' => 'string', + 'removeStopWords' => 'string', + 'keepDiacriticsOnCharacters' => 'string', + 'queryLanguages' => 'string[]', + 'decompoundQuery' => 'bool', + 'enableRules' => 'bool', + 'enablePersonalization' => 'bool', + 'queryType' => 'string', + 'removeWordsIfNoResults' => 'string', + 'advancedSyntax' => 'bool', + 'optionalWords' => 'string[]', + 'disableExactOnAttributes' => 'string[]', + 'exactOnSingleWordQuery' => 'string', + 'alternativesAsExact' => 'string[]', + 'advancedSyntaxFeatures' => 'string[]', + 'distinct' => 'int', + 'synonyms' => 'bool', + 'replaceSynonymsInHighlight' => 'bool', + 'minProximity' => 'int', + 'responseFields' => 'string[]', + 'maxFacetHits' => 'int', + 'attributeCriteriaComputedByMinProximity' => 'bool', + 'renderingContent' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'similarQuery' => null, + 'filters' => null, + 'facetFilters' => null, + 'optionalFilters' => null, + 'numericFilters' => null, + 'tagFilters' => null, + 'sumOrFiltersScores' => null, + 'facets' => null, + 'maxValuesPerFacet' => null, + 'facetingAfterDistinct' => null, + 'sortFacetValuesBy' => null, + 'page' => null, + 'offset' => null, + 'length' => null, + 'aroundLatLng' => null, + 'aroundLatLngViaIP' => null, + 'aroundRadius' => null, + 'aroundPrecision' => null, + 'minimumAroundRadius' => null, + 'insideBoundingBox' => null, + 'insidePolygon' => null, + 'naturalLanguages' => null, + 'ruleContexts' => null, + 'personalizationImpact' => null, + 'userToken' => null, + 'getRankingInfo' => null, + 'clickAnalytics' => null, + 'analytics' => null, + 'analyticsTags' => null, + 'percentileComputation' => null, + 'enableABTest' => null, + 'enableReRanking' => null, + 'query' => null, + 'searchableAttributes' => null, + 'attributesForFaceting' => null, + 'unretrievableAttributes' => null, + 'attributesToRetrieve' => null, + 'restrictSearchableAttributes' => null, + 'ranking' => null, + 'customRanking' => null, + 'relevancyStrictness' => null, + 'attributesToHighlight' => null, + 'attributesToSnippet' => null, + 'highlightPreTag' => null, + 'highlightPostTag' => null, + 'snippetEllipsisText' => null, + 'restrictHighlightAndSnippetArrays' => null, + 'hitsPerPage' => null, + 'minWordSizefor1Typo' => null, + 'minWordSizefor2Typos' => null, + 'typoTolerance' => null, + 'allowTyposOnNumericTokens' => null, + 'disableTypoToleranceOnAttributes' => null, + 'separatorsToIndex' => null, + 'ignorePlurals' => null, + 'removeStopWords' => null, + 'keepDiacriticsOnCharacters' => null, + 'queryLanguages' => null, + 'decompoundQuery' => null, + 'enableRules' => null, + 'enablePersonalization' => null, + 'queryType' => null, + 'removeWordsIfNoResults' => null, + 'advancedSyntax' => null, + 'optionalWords' => null, + 'disableExactOnAttributes' => null, + 'exactOnSingleWordQuery' => null, + 'alternativesAsExact' => null, + 'advancedSyntaxFeatures' => null, + 'distinct' => null, + 'synonyms' => null, + 'replaceSynonymsInHighlight' => null, + 'minProximity' => null, + 'responseFields' => null, + 'maxFacetHits' => null, + 'attributeCriteriaComputedByMinProximity' => null, + 'renderingContent' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'similarQuery' => 'similarQuery', + 'filters' => 'filters', + 'facetFilters' => 'facetFilters', + 'optionalFilters' => 'optionalFilters', + 'numericFilters' => 'numericFilters', + 'tagFilters' => 'tagFilters', + 'sumOrFiltersScores' => 'sumOrFiltersScores', + 'facets' => 'facets', + 'maxValuesPerFacet' => 'maxValuesPerFacet', + 'facetingAfterDistinct' => 'facetingAfterDistinct', + 'sortFacetValuesBy' => 'sortFacetValuesBy', + 'page' => 'page', + 'offset' => 'offset', + 'length' => 'length', + 'aroundLatLng' => 'aroundLatLng', + 'aroundLatLngViaIP' => 'aroundLatLngViaIP', + 'aroundRadius' => 'aroundRadius', + 'aroundPrecision' => 'aroundPrecision', + 'minimumAroundRadius' => 'minimumAroundRadius', + 'insideBoundingBox' => 'insideBoundingBox', + 'insidePolygon' => 'insidePolygon', + 'naturalLanguages' => 'naturalLanguages', + 'ruleContexts' => 'ruleContexts', + 'personalizationImpact' => 'personalizationImpact', + 'userToken' => 'userToken', + 'getRankingInfo' => 'getRankingInfo', + 'clickAnalytics' => 'clickAnalytics', + 'analytics' => 'analytics', + 'analyticsTags' => 'analyticsTags', + 'percentileComputation' => 'percentileComputation', + 'enableABTest' => 'enableABTest', + 'enableReRanking' => 'enableReRanking', + 'query' => 'query', + 'searchableAttributes' => 'searchableAttributes', + 'attributesForFaceting' => 'attributesForFaceting', + 'unretrievableAttributes' => 'unretrievableAttributes', + 'attributesToRetrieve' => 'attributesToRetrieve', + 'restrictSearchableAttributes' => 'restrictSearchableAttributes', + 'ranking' => 'ranking', + 'customRanking' => 'customRanking', + 'relevancyStrictness' => 'relevancyStrictness', + 'attributesToHighlight' => 'attributesToHighlight', + 'attributesToSnippet' => 'attributesToSnippet', + 'highlightPreTag' => 'highlightPreTag', + 'highlightPostTag' => 'highlightPostTag', + 'snippetEllipsisText' => 'snippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'restrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'hitsPerPage', + 'minWordSizefor1Typo' => 'minWordSizefor1Typo', + 'minWordSizefor2Typos' => 'minWordSizefor2Typos', + 'typoTolerance' => 'typoTolerance', + 'allowTyposOnNumericTokens' => 'allowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'disableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'separatorsToIndex', + 'ignorePlurals' => 'ignorePlurals', + 'removeStopWords' => 'removeStopWords', + 'keepDiacriticsOnCharacters' => 'keepDiacriticsOnCharacters', + 'queryLanguages' => 'queryLanguages', + 'decompoundQuery' => 'decompoundQuery', + 'enableRules' => 'enableRules', + 'enablePersonalization' => 'enablePersonalization', + 'queryType' => 'queryType', + 'removeWordsIfNoResults' => 'removeWordsIfNoResults', + 'advancedSyntax' => 'advancedSyntax', + 'optionalWords' => 'optionalWords', + 'disableExactOnAttributes' => 'disableExactOnAttributes', + 'exactOnSingleWordQuery' => 'exactOnSingleWordQuery', + 'alternativesAsExact' => 'alternativesAsExact', + 'advancedSyntaxFeatures' => 'advancedSyntaxFeatures', + 'distinct' => 'distinct', + 'synonyms' => 'synonyms', + 'replaceSynonymsInHighlight' => 'replaceSynonymsInHighlight', + 'minProximity' => 'minProximity', + 'responseFields' => 'responseFields', + 'maxFacetHits' => 'maxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'attributeCriteriaComputedByMinProximity', + 'renderingContent' => 'renderingContent', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'similarQuery' => 'setSimilarQuery', + 'filters' => 'setFilters', + 'facetFilters' => 'setFacetFilters', + 'optionalFilters' => 'setOptionalFilters', + 'numericFilters' => 'setNumericFilters', + 'tagFilters' => 'setTagFilters', + 'sumOrFiltersScores' => 'setSumOrFiltersScores', + 'facets' => 'setFacets', + 'maxValuesPerFacet' => 'setMaxValuesPerFacet', + 'facetingAfterDistinct' => 'setFacetingAfterDistinct', + 'sortFacetValuesBy' => 'setSortFacetValuesBy', + 'page' => 'setPage', + 'offset' => 'setOffset', + 'length' => 'setLength', + 'aroundLatLng' => 'setAroundLatLng', + 'aroundLatLngViaIP' => 'setAroundLatLngViaIP', + 'aroundRadius' => 'setAroundRadius', + 'aroundPrecision' => 'setAroundPrecision', + 'minimumAroundRadius' => 'setMinimumAroundRadius', + 'insideBoundingBox' => 'setInsideBoundingBox', + 'insidePolygon' => 'setInsidePolygon', + 'naturalLanguages' => 'setNaturalLanguages', + 'ruleContexts' => 'setRuleContexts', + 'personalizationImpact' => 'setPersonalizationImpact', + 'userToken' => 'setUserToken', + 'getRankingInfo' => 'setGetRankingInfo', + 'clickAnalytics' => 'setClickAnalytics', + 'analytics' => 'setAnalytics', + 'analyticsTags' => 'setAnalyticsTags', + 'percentileComputation' => 'setPercentileComputation', + 'enableABTest' => 'setEnableABTest', + 'enableReRanking' => 'setEnableReRanking', + 'query' => 'setQuery', + 'searchableAttributes' => 'setSearchableAttributes', + 'attributesForFaceting' => 'setAttributesForFaceting', + 'unretrievableAttributes' => 'setUnretrievableAttributes', + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'restrictSearchableAttributes' => 'setRestrictSearchableAttributes', + 'ranking' => 'setRanking', + 'customRanking' => 'setCustomRanking', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'attributesToHighlight' => 'setAttributesToHighlight', + 'attributesToSnippet' => 'setAttributesToSnippet', + 'highlightPreTag' => 'setHighlightPreTag', + 'highlightPostTag' => 'setHighlightPostTag', + 'snippetEllipsisText' => 'setSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'setRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'setHitsPerPage', + 'minWordSizefor1Typo' => 'setMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'setMinWordSizefor2Typos', + 'typoTolerance' => 'setTypoTolerance', + 'allowTyposOnNumericTokens' => 'setAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'setDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'setSeparatorsToIndex', + 'ignorePlurals' => 'setIgnorePlurals', + 'removeStopWords' => 'setRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'setKeepDiacriticsOnCharacters', + 'queryLanguages' => 'setQueryLanguages', + 'decompoundQuery' => 'setDecompoundQuery', + 'enableRules' => 'setEnableRules', + 'enablePersonalization' => 'setEnablePersonalization', + 'queryType' => 'setQueryType', + 'removeWordsIfNoResults' => 'setRemoveWordsIfNoResults', + 'advancedSyntax' => 'setAdvancedSyntax', + 'optionalWords' => 'setOptionalWords', + 'disableExactOnAttributes' => 'setDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'setExactOnSingleWordQuery', + 'alternativesAsExact' => 'setAlternativesAsExact', + 'advancedSyntaxFeatures' => 'setAdvancedSyntaxFeatures', + 'distinct' => 'setDistinct', + 'synonyms' => 'setSynonyms', + 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', + 'minProximity' => 'setMinProximity', + 'responseFields' => 'setResponseFields', + 'maxFacetHits' => 'setMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'setRenderingContent', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'similarQuery' => 'getSimilarQuery', + 'filters' => 'getFilters', + 'facetFilters' => 'getFacetFilters', + 'optionalFilters' => 'getOptionalFilters', + 'numericFilters' => 'getNumericFilters', + 'tagFilters' => 'getTagFilters', + 'sumOrFiltersScores' => 'getSumOrFiltersScores', + 'facets' => 'getFacets', + 'maxValuesPerFacet' => 'getMaxValuesPerFacet', + 'facetingAfterDistinct' => 'getFacetingAfterDistinct', + 'sortFacetValuesBy' => 'getSortFacetValuesBy', + 'page' => 'getPage', + 'offset' => 'getOffset', + 'length' => 'getLength', + 'aroundLatLng' => 'getAroundLatLng', + 'aroundLatLngViaIP' => 'getAroundLatLngViaIP', + 'aroundRadius' => 'getAroundRadius', + 'aroundPrecision' => 'getAroundPrecision', + 'minimumAroundRadius' => 'getMinimumAroundRadius', + 'insideBoundingBox' => 'getInsideBoundingBox', + 'insidePolygon' => 'getInsidePolygon', + 'naturalLanguages' => 'getNaturalLanguages', + 'ruleContexts' => 'getRuleContexts', + 'personalizationImpact' => 'getPersonalizationImpact', + 'userToken' => 'getUserToken', + 'getRankingInfo' => 'getGetRankingInfo', + 'clickAnalytics' => 'getClickAnalytics', + 'analytics' => 'getAnalytics', + 'analyticsTags' => 'getAnalyticsTags', + 'percentileComputation' => 'getPercentileComputation', + 'enableABTest' => 'getEnableABTest', + 'enableReRanking' => 'getEnableReRanking', + 'query' => 'getQuery', + 'searchableAttributes' => 'getSearchableAttributes', + 'attributesForFaceting' => 'getAttributesForFaceting', + 'unretrievableAttributes' => 'getUnretrievableAttributes', + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'restrictSearchableAttributes' => 'getRestrictSearchableAttributes', + 'ranking' => 'getRanking', + 'customRanking' => 'getCustomRanking', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'attributesToHighlight' => 'getAttributesToHighlight', + 'attributesToSnippet' => 'getAttributesToSnippet', + 'highlightPreTag' => 'getHighlightPreTag', + 'highlightPostTag' => 'getHighlightPostTag', + 'snippetEllipsisText' => 'getSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'getRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'getHitsPerPage', + 'minWordSizefor1Typo' => 'getMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'getMinWordSizefor2Typos', + 'typoTolerance' => 'getTypoTolerance', + 'allowTyposOnNumericTokens' => 'getAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'getDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'getSeparatorsToIndex', + 'ignorePlurals' => 'getIgnorePlurals', + 'removeStopWords' => 'getRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'getKeepDiacriticsOnCharacters', + 'queryLanguages' => 'getQueryLanguages', + 'decompoundQuery' => 'getDecompoundQuery', + 'enableRules' => 'getEnableRules', + 'enablePersonalization' => 'getEnablePersonalization', + 'queryType' => 'getQueryType', + 'removeWordsIfNoResults' => 'getRemoveWordsIfNoResults', + 'advancedSyntax' => 'getAdvancedSyntax', + 'optionalWords' => 'getOptionalWords', + 'disableExactOnAttributes' => 'getDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'getExactOnSingleWordQuery', + 'alternativesAsExact' => 'getAlternativesAsExact', + 'advancedSyntaxFeatures' => 'getAdvancedSyntaxFeatures', + 'distinct' => 'getDistinct', + 'synonyms' => 'getSynonyms', + 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', + 'minProximity' => 'getMinProximity', + 'responseFields' => 'getResponseFields', + 'maxFacetHits' => 'getMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'getRenderingContent', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const TYPO_TOLERANCE_TRUE = 'true'; + const TYPO_TOLERANCE_FALSE = 'false'; + const TYPO_TOLERANCE_MIN = 'min'; + const TYPO_TOLERANCE_STRICT = 'strict'; + const QUERY_TYPE_PREFIX_LAST = 'prefixLast'; + const QUERY_TYPE_PREFIX_ALL = 'prefixAll'; + const QUERY_TYPE_PREFIX_NONE = 'prefixNone'; + const REMOVE_WORDS_IF_NO_RESULTS_NONE = 'none'; + const REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS = 'lastWords'; + const REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS = 'firstWords'; + const REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL = 'allOptional'; + const EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE = 'attribute'; + const EXACT_ON_SINGLE_WORD_QUERY_NONE = 'none'; + const EXACT_ON_SINGLE_WORD_QUERY_WORD = 'word'; + const ALTERNATIVES_AS_EXACT_IGNORE_PLURALS = 'ignorePlurals'; + const ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM = 'singleWordSynonym'; + const ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM = 'multiWordsSynonym'; + const ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE = 'exactPhrase'; + const ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS = 'excludeWords'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypoToleranceAllowableValues() + { + return [ + self::TYPO_TOLERANCE_TRUE, + self::TYPO_TOLERANCE_FALSE, + self::TYPO_TOLERANCE_MIN, + self::TYPO_TOLERANCE_STRICT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getQueryTypeAllowableValues() + { + return [ + self::QUERY_TYPE_PREFIX_LAST, + self::QUERY_TYPE_PREFIX_ALL, + self::QUERY_TYPE_PREFIX_NONE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemoveWordsIfNoResultsAllowableValues() + { + return [ + self::REMOVE_WORDS_IF_NO_RESULTS_NONE, + self::REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExactOnSingleWordQueryAllowableValues() + { + return [ + self::EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE, + self::EXACT_ON_SINGLE_WORD_QUERY_NONE, + self::EXACT_ON_SINGLE_WORD_QUERY_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAlternativesAsExactAllowableValues() + { + return [ + self::ALTERNATIVES_AS_EXACT_IGNORE_PLURALS, + self::ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM, + self::ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdvancedSyntaxFeaturesAllowableValues() + { + return [ + self::ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE, + self::ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['similarQuery'] = $data['similarQuery'] ?? ''; + $this->container['filters'] = $data['filters'] ?? ''; + $this->container['facetFilters'] = $data['facetFilters'] ?? null; + $this->container['optionalFilters'] = $data['optionalFilters'] ?? null; + $this->container['numericFilters'] = $data['numericFilters'] ?? null; + $this->container['tagFilters'] = $data['tagFilters'] ?? null; + $this->container['sumOrFiltersScores'] = $data['sumOrFiltersScores'] ?? false; + $this->container['facets'] = $data['facets'] ?? null; + $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet'] ?? 100; + $this->container['facetingAfterDistinct'] = $data['facetingAfterDistinct'] ?? false; + $this->container['sortFacetValuesBy'] = $data['sortFacetValuesBy'] ?? 'count'; + $this->container['page'] = $data['page'] ?? 0; + $this->container['offset'] = $data['offset'] ?? null; + $this->container['length'] = $data['length'] ?? null; + $this->container['aroundLatLng'] = $data['aroundLatLng'] ?? ''; + $this->container['aroundLatLngViaIP'] = $data['aroundLatLngViaIP'] ?? false; + $this->container['aroundRadius'] = $data['aroundRadius'] ?? null; + $this->container['aroundPrecision'] = $data['aroundPrecision'] ?? 10; + $this->container['minimumAroundRadius'] = $data['minimumAroundRadius'] ?? null; + $this->container['insideBoundingBox'] = $data['insideBoundingBox'] ?? null; + $this->container['insidePolygon'] = $data['insidePolygon'] ?? null; + $this->container['naturalLanguages'] = $data['naturalLanguages'] ?? null; + $this->container['ruleContexts'] = $data['ruleContexts'] ?? null; + $this->container['personalizationImpact'] = $data['personalizationImpact'] ?? 100; + $this->container['userToken'] = $data['userToken'] ?? null; + $this->container['getRankingInfo'] = $data['getRankingInfo'] ?? false; + $this->container['clickAnalytics'] = $data['clickAnalytics'] ?? false; + $this->container['analytics'] = $data['analytics'] ?? true; + $this->container['analyticsTags'] = $data['analyticsTags'] ?? null; + $this->container['percentileComputation'] = $data['percentileComputation'] ?? true; + $this->container['enableABTest'] = $data['enableABTest'] ?? true; + $this->container['enableReRanking'] = $data['enableReRanking'] ?? true; + $this->container['query'] = $data['query'] ?? ''; + $this->container['searchableAttributes'] = $data['searchableAttributes'] ?? null; + $this->container['attributesForFaceting'] = $data['attributesForFaceting'] ?? null; + $this->container['unretrievableAttributes'] = $data['unretrievableAttributes'] ?? null; + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve'] ?? null; + $this->container['restrictSearchableAttributes'] = $data['restrictSearchableAttributes'] ?? null; + $this->container['ranking'] = $data['ranking'] ?? null; + $this->container['customRanking'] = $data['customRanking'] ?? null; + $this->container['relevancyStrictness'] = $data['relevancyStrictness'] ?? 100; + $this->container['attributesToHighlight'] = $data['attributesToHighlight'] ?? null; + $this->container['attributesToSnippet'] = $data['attributesToSnippet'] ?? null; + $this->container['highlightPreTag'] = $data['highlightPreTag'] ?? ''; + $this->container['highlightPostTag'] = $data['highlightPostTag'] ?? ''; + $this->container['snippetEllipsisText'] = $data['snippetEllipsisText'] ?? '…'; + $this->container['restrictHighlightAndSnippetArrays'] = $data['restrictHighlightAndSnippetArrays'] ?? false; + $this->container['hitsPerPage'] = $data['hitsPerPage'] ?? 20; + $this->container['minWordSizefor1Typo'] = $data['minWordSizefor1Typo'] ?? 4; + $this->container['minWordSizefor2Typos'] = $data['minWordSizefor2Typos'] ?? 8; + $this->container['typoTolerance'] = $data['typoTolerance'] ?? 'true'; + $this->container['allowTyposOnNumericTokens'] = $data['allowTyposOnNumericTokens'] ?? true; + $this->container['disableTypoToleranceOnAttributes'] = $data['disableTypoToleranceOnAttributes'] ?? null; + $this->container['separatorsToIndex'] = $data['separatorsToIndex'] ?? ''; + $this->container['ignorePlurals'] = $data['ignorePlurals'] ?? 'false'; + $this->container['removeStopWords'] = $data['removeStopWords'] ?? 'false'; + $this->container['keepDiacriticsOnCharacters'] = $data['keepDiacriticsOnCharacters'] ?? ''; + $this->container['queryLanguages'] = $data['queryLanguages'] ?? null; + $this->container['decompoundQuery'] = $data['decompoundQuery'] ?? true; + $this->container['enableRules'] = $data['enableRules'] ?? true; + $this->container['enablePersonalization'] = $data['enablePersonalization'] ?? false; + $this->container['queryType'] = $data['queryType'] ?? 'prefixLast'; + $this->container['removeWordsIfNoResults'] = $data['removeWordsIfNoResults'] ?? 'none'; + $this->container['advancedSyntax'] = $data['advancedSyntax'] ?? false; + $this->container['optionalWords'] = $data['optionalWords'] ?? null; + $this->container['disableExactOnAttributes'] = $data['disableExactOnAttributes'] ?? null; + $this->container['exactOnSingleWordQuery'] = $data['exactOnSingleWordQuery'] ?? 'attribute'; + $this->container['alternativesAsExact'] = $data['alternativesAsExact'] ?? null; + $this->container['advancedSyntaxFeatures'] = $data['advancedSyntaxFeatures'] ?? null; + $this->container['distinct'] = $data['distinct'] ?? 0; + $this->container['synonyms'] = $data['synonyms'] ?? true; + $this->container['replaceSynonymsInHighlight'] = $data['replaceSynonymsInHighlight'] ?? false; + $this->container['minProximity'] = $data['minProximity'] ?? 1; + $this->container['responseFields'] = $data['responseFields'] ?? null; + $this->container['maxFacetHits'] = $data['maxFacetHits'] ?? 10; + $this->container['attributeCriteriaComputedByMinProximity'] = $data['attributeCriteriaComputedByMinProximity'] ?? false; + $this->container['renderingContent'] = $data['renderingContent'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!is_null($this->container['length']) && ($this->container['length'] > 1000)) { + $invalidProperties[] = "invalid value for 'length', must be smaller than or equal to 1000."; + } + + if (!is_null($this->container['length']) && ($this->container['length'] < 1)) { + $invalidProperties[] = "invalid value for 'length', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['minimumAroundRadius']) && ($this->container['minimumAroundRadius'] < 1)) { + $invalidProperties[] = "invalid value for 'minimumAroundRadius', must be bigger than or equal to 1."; + } + + if ($this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($this->container['typoTolerance']) && !in_array($this->container['typoTolerance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'typoTolerance', must be one of '%s'", + $this->container['typoTolerance'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'queryType', must be one of '%s'", + $this->container['queryType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($this->container['removeWordsIfNoResults']) && !in_array($this->container['removeWordsIfNoResults'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $this->container['removeWordsIfNoResults'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($this->container['exactOnSingleWordQuery']) && !in_array($this->container['exactOnSingleWordQuery'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $this->container['exactOnSingleWordQuery'], + implode("', '", $allowedValues) + ); + } + + if (!is_null($this->container['distinct']) && ($this->container['distinct'] > 4)) { + $invalidProperties[] = "invalid value for 'distinct', must be smaller than or equal to 4."; + } + + if (!is_null($this->container['distinct']) && ($this->container['distinct'] < 0)) { + $invalidProperties[] = "invalid value for 'distinct', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['minProximity']) && ($this->container['minProximity'] > 7)) { + $invalidProperties[] = "invalid value for 'minProximity', must be smaller than or equal to 7."; + } + + if (!is_null($this->container['minProximity']) && ($this->container['minProximity'] < 1)) { + $invalidProperties[] = "invalid value for 'minProximity', must be bigger than or equal to 1."; + } + + if (!is_null($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + 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 similarQuery + * + * @return string|null + */ + public function getSimilarQuery() + { + return $this->container['similarQuery']; + } + + /** + * Sets similarQuery + * + * @param string|null $similarQuery overrides the query parameter and performs a more generic search that can be used to find \"similar\" results + * + * @return self + */ + public function setSimilarQuery($similarQuery) + { + $this->container['similarQuery'] = $similarQuery; + + return $this; + } + + /** + * Gets filters + * + * @return string|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param string|null $filters filter the query with numeric, facet and/or tag filters + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets facetFilters + * + * @return string[]|null + */ + public function getFacetFilters() + { + return $this->container['facetFilters']; + } + + /** + * Sets facetFilters + * + * @param string[]|null $facetFilters filter hits by facet value + * + * @return self + */ + public function setFacetFilters($facetFilters) + { + $this->container['facetFilters'] = $facetFilters; + + return $this; + } + + /** + * Gets optionalFilters + * + * @return string[]|null + */ + public function getOptionalFilters() + { + return $this->container['optionalFilters']; + } + + /** + * Sets optionalFilters + * + * @param string[]|null $optionalFilters create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter + * + * @return self + */ + public function setOptionalFilters($optionalFilters) + { + $this->container['optionalFilters'] = $optionalFilters; + + return $this; + } + + /** + * Gets numericFilters + * + * @return string[]|null + */ + public function getNumericFilters() + { + return $this->container['numericFilters']; + } + + /** + * Sets numericFilters + * + * @param string[]|null $numericFilters filter on numeric attributes + * + * @return self + */ + public function setNumericFilters($numericFilters) + { + $this->container['numericFilters'] = $numericFilters; + + return $this; + } + + /** + * Gets tagFilters + * + * @return string[]|null + */ + public function getTagFilters() + { + return $this->container['tagFilters']; + } + + /** + * Sets tagFilters + * + * @param string[]|null $tagFilters filter hits by tags + * + * @return self + */ + public function setTagFilters($tagFilters) + { + $this->container['tagFilters'] = $tagFilters; + + return $this; + } + + /** + * Gets sumOrFiltersScores + * + * @return bool|null + */ + public function getSumOrFiltersScores() + { + return $this->container['sumOrFiltersScores']; + } + + /** + * Sets sumOrFiltersScores + * + * @param bool|null $sumOrFiltersScores determines how to calculate the total score for filtering + * + * @return self + */ + public function setSumOrFiltersScores($sumOrFiltersScores) + { + $this->container['sumOrFiltersScores'] = $sumOrFiltersScores; + + return $this; + } + + /** + * Gets facets + * + * @return string[]|null + */ + public function getFacets() + { + return $this->container['facets']; + } + + /** + * Sets facets + * + * @param string[]|null $facets retrieve facets and their facet values + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets maxValuesPerFacet + * + * @return int|null + */ + public function getMaxValuesPerFacet() + { + return $this->container['maxValuesPerFacet']; + } + + /** + * Sets maxValuesPerFacet + * + * @param int|null $maxValuesPerFacet maximum number of facet values to return for each facet during a regular search + * + * @return self + */ + public function setMaxValuesPerFacet($maxValuesPerFacet) + { + $this->container['maxValuesPerFacet'] = $maxValuesPerFacet; + + return $this; + } + + /** + * Gets facetingAfterDistinct + * + * @return bool|null + */ + public function getFacetingAfterDistinct() + { + return $this->container['facetingAfterDistinct']; + } + + /** + * Sets facetingAfterDistinct + * + * @param bool|null $facetingAfterDistinct force faceting to be applied after de-duplication (via the Distinct setting) + * + * @return self + */ + public function setFacetingAfterDistinct($facetingAfterDistinct) + { + $this->container['facetingAfterDistinct'] = $facetingAfterDistinct; + + return $this; + } + + /** + * Gets sortFacetValuesBy + * + * @return string|null + */ + public function getSortFacetValuesBy() + { + return $this->container['sortFacetValuesBy']; + } + + /** + * Sets sortFacetValuesBy + * + * @param string|null $sortFacetValuesBy controls how facet values are fetched + * + * @return self + */ + public function setSortFacetValuesBy($sortFacetValuesBy) + { + $this->container['sortFacetValuesBy'] = $sortFacetValuesBy; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets offset + * + * @return int|null + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * + * @param int|null $offset specify the offset of the first hit to return + * + * @return self + */ + public function setOffset($offset) + { + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets length + * + * @return int|null + */ + public function getLength() + { + return $this->container['length']; + } + + /** + * Sets length + * + * @param int|null $length set the number of hits to retrieve (used only with offset) + * + * @return self + */ + public function setLength($length) + { + if (!is_null($length) && ($length > 1000)) { + throw new \InvalidArgumentException('invalid value for $length when calling SearchParams., must be smaller than or equal to 1000.'); + } + if (!is_null($length) && ($length < 1)) { + throw new \InvalidArgumentException('invalid value for $length when calling SearchParams., must be bigger than or equal to 1.'); + } + + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng']; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng search for entries around a central geolocation, enabling a geo search within a circular area + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets aroundLatLngViaIP + * + * @return bool|null + */ + public function getAroundLatLngViaIP() + { + return $this->container['aroundLatLngViaIP']; + } + + /** + * Sets aroundLatLngViaIP + * + * @param bool|null $aroundLatLngViaIP search for entries around a given location automatically computed from the requester's IP address + * + * @return self + */ + public function setAroundLatLngViaIP($aroundLatLngViaIP) + { + $this->container['aroundLatLngViaIP'] = $aroundLatLngViaIP; + + return $this; + } + + /** + * Gets aroundRadius + * + * @return OneOfIntegerString|null + */ + public function getAroundRadius() + { + return $this->container['aroundRadius']; + } + + /** + * Sets aroundRadius + * + * @param OneOfIntegerString|null $aroundRadius define the maximum radius for a geo search (in meters) + * + * @return self + */ + public function setAroundRadius($aroundRadius) + { + $this->container['aroundRadius'] = $aroundRadius; + + return $this; + } + + /** + * Gets aroundPrecision + * + * @return int|null + */ + public function getAroundPrecision() + { + return $this->container['aroundPrecision']; + } + + /** + * Sets aroundPrecision + * + * @param int|null $aroundPrecision precision of geo search (in meters), to add grouping by geo location to the ranking formula + * + * @return self + */ + public function setAroundPrecision($aroundPrecision) + { + $this->container['aroundPrecision'] = $aroundPrecision; + + return $this; + } + + /** + * Gets minimumAroundRadius + * + * @return int|null + */ + public function getMinimumAroundRadius() + { + return $this->container['minimumAroundRadius']; + } + + /** + * Sets minimumAroundRadius + * + * @param int|null $minimumAroundRadius minimum radius (in meters) used for a geo search when aroundRadius is not set + * + * @return self + */ + public function setMinimumAroundRadius($minimumAroundRadius) + { + if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { + throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling SearchParams., must be bigger than or equal to 1.'); + } + + $this->container['minimumAroundRadius'] = $minimumAroundRadius; + + return $this; + } + + /** + * Gets insideBoundingBox + * + * @return float[]|null + */ + public function getInsideBoundingBox() + { + return $this->container['insideBoundingBox']; + } + + /** + * Sets insideBoundingBox + * + * @param float[]|null $insideBoundingBox search inside a rectangular area (in geo coordinates) + * + * @return self + */ + public function setInsideBoundingBox($insideBoundingBox) + { + $this->container['insideBoundingBox'] = $insideBoundingBox; + + return $this; + } + + /** + * Gets insidePolygon + * + * @return float[]|null + */ + public function getInsidePolygon() + { + return $this->container['insidePolygon']; + } + + /** + * Sets insidePolygon + * + * @param float[]|null $insidePolygon search inside a polygon (in geo coordinates) + * + * @return self + */ + public function setInsidePolygon($insidePolygon) + { + $this->container['insidePolygon'] = $insidePolygon; + + return $this; + } + + /** + * Gets naturalLanguages + * + * @return string[]|null + */ + public function getNaturalLanguages() + { + return $this->container['naturalLanguages']; + } + + /** + * Sets naturalLanguages + * + * @param string[]|null $naturalLanguages This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. + * + * @return self + */ + public function setNaturalLanguages($naturalLanguages) + { + $this->container['naturalLanguages'] = $naturalLanguages; + + return $this; + } + + /** + * Gets ruleContexts + * + * @return string[]|null + */ + public function getRuleContexts() + { + return $this->container['ruleContexts']; + } + + /** + * Sets ruleContexts + * + * @param string[]|null $ruleContexts enables contextual rules + * + * @return self + */ + public function setRuleContexts($ruleContexts) + { + $this->container['ruleContexts'] = $ruleContexts; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int|null + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact']; + } + + /** + * Sets personalizationImpact + * + * @param int|null $personalizationImpact define the impact of the Personalization feature + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + return $this; + } + + /** + * Gets userToken + * + * @return string|null + */ + public function getUserToken() + { + return $this->container['userToken']; + } + + /** + * Sets userToken + * + * @param string|null $userToken associates a certain user token with the current search + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets getRankingInfo + * + * @return bool|null + */ + public function getGetRankingInfo() + { + return $this->container['getRankingInfo']; + } + + /** + * Sets getRankingInfo + * + * @param bool|null $getRankingInfo retrieve detailed ranking information + * + * @return self + */ + public function setGetRankingInfo($getRankingInfo) + { + $this->container['getRankingInfo'] = $getRankingInfo; + + return $this; + } + + /** + * Gets clickAnalytics + * + * @return bool|null + */ + public function getClickAnalytics() + { + return $this->container['clickAnalytics']; + } + + /** + * Sets clickAnalytics + * + * @param bool|null $clickAnalytics enable the Click Analytics feature + * + * @return self + */ + public function setClickAnalytics($clickAnalytics) + { + $this->container['clickAnalytics'] = $clickAnalytics; + + return $this; + } + + /** + * Gets analytics + * + * @return bool|null + */ + public function getAnalytics() + { + return $this->container['analytics']; + } + + /** + * Sets analytics + * + * @param bool|null $analytics whether the current query will be taken into account in the Analytics + * + * @return self + */ + public function setAnalytics($analytics) + { + $this->container['analytics'] = $analytics; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[]|null + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags']; + } + + /** + * Sets analyticsTags + * + * @param string[]|null $analyticsTags list of tags to apply to the query for analytics purposes + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets percentileComputation + * + * @return bool|null + */ + public function getPercentileComputation() + { + return $this->container['percentileComputation']; + } + + /** + * Sets percentileComputation + * + * @param bool|null $percentileComputation whether to include or exclude a query from the processing-time percentile computation + * + * @return self + */ + public function setPercentileComputation($percentileComputation) + { + $this->container['percentileComputation'] = $percentileComputation; + + return $this; + } + + /** + * Gets enableABTest + * + * @return bool|null + */ + public function getEnableABTest() + { + return $this->container['enableABTest']; + } + + /** + * Sets enableABTest + * + * @param bool|null $enableABTest whether this search should participate in running AB tests + * + * @return self + */ + public function setEnableABTest($enableABTest) + { + $this->container['enableABTest'] = $enableABTest; + + return $this; + } + + /** + * Gets enableReRanking + * + * @return bool|null + */ + public function getEnableReRanking() + { + return $this->container['enableReRanking']; + } + + /** + * Sets enableReRanking + * + * @param bool|null $enableReRanking whether this search should use AI Re-Ranking + * + * @return self + */ + public function setEnableReRanking($enableReRanking) + { + $this->container['enableReRanking'] = $enableReRanking; + + return $this; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets searchableAttributes + * + * @return string[]|null + */ + public function getSearchableAttributes() + { + return $this->container['searchableAttributes']; + } + + /** + * Sets searchableAttributes + * + * @param string[]|null $searchableAttributes the complete list of attributes used for searching + * + * @return self + */ + public function setSearchableAttributes($searchableAttributes) + { + $this->container['searchableAttributes'] = $searchableAttributes; + + return $this; + } + + /** + * Gets attributesForFaceting + * + * @return string[]|null + */ + public function getAttributesForFaceting() + { + return $this->container['attributesForFaceting']; + } + + /** + * Sets attributesForFaceting + * + * @param string[]|null $attributesForFaceting the complete list of attributes that will be used for faceting + * + * @return self + */ + public function setAttributesForFaceting($attributesForFaceting) + { + $this->container['attributesForFaceting'] = $attributesForFaceting; + + return $this; + } + + /** + * Gets unretrievableAttributes + * + * @return string[]|null + */ + public function getUnretrievableAttributes() + { + return $this->container['unretrievableAttributes']; + } + + /** + * Sets unretrievableAttributes + * + * @param string[]|null $unretrievableAttributes list of attributes that can't be retrieved at query time + * + * @return self + */ + public function setUnretrievableAttributes($unretrievableAttributes) + { + $this->container['unretrievableAttributes'] = $unretrievableAttributes; + + return $this; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve']; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve this parameter controls which attributes to retrieve and which not to retrieve + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets restrictSearchableAttributes + * + * @return string[]|null + */ + public function getRestrictSearchableAttributes() + { + return $this->container['restrictSearchableAttributes']; + } + + /** + * Sets restrictSearchableAttributes + * + * @param string[]|null $restrictSearchableAttributes restricts a given query to look in only a subset of your searchable attributes + * + * @return self + */ + public function setRestrictSearchableAttributes($restrictSearchableAttributes) + { + $this->container['restrictSearchableAttributes'] = $restrictSearchableAttributes; + + return $this; + } + + /** + * Gets ranking + * + * @return string[]|null + */ + public function getRanking() + { + return $this->container['ranking']; + } + + /** + * Sets ranking + * + * @param string[]|null $ranking controls how Algolia should sort your results + * + * @return self + */ + public function setRanking($ranking) + { + $this->container['ranking'] = $ranking; + + return $this; + } + + /** + * Gets customRanking + * + * @return string[]|null + */ + public function getCustomRanking() + { + return $this->container['customRanking']; + } + + /** + * Sets customRanking + * + * @param string[]|null $customRanking specifies the custom ranking criterion + * + * @return self + */ + public function setCustomRanking($customRanking) + { + $this->container['customRanking'] = $customRanking; + + return $this; + } + + /** + * Gets relevancyStrictness + * + * @return int|null + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness']; + } + + /** + * Sets relevancyStrictness + * + * @param int|null $relevancyStrictness controls the relevancy threshold below which less relevant results aren't included in the results + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets attributesToHighlight + * + * @return string[]|null + */ + public function getAttributesToHighlight() + { + return $this->container['attributesToHighlight']; + } + + /** + * Sets attributesToHighlight + * + * @param string[]|null $attributesToHighlight list of attributes to highlight + * + * @return self + */ + public function setAttributesToHighlight($attributesToHighlight) + { + $this->container['attributesToHighlight'] = $attributesToHighlight; + + return $this; + } + + /** + * Gets attributesToSnippet + * + * @return string[]|null + */ + public function getAttributesToSnippet() + { + return $this->container['attributesToSnippet']; + } + + /** + * Sets attributesToSnippet + * + * @param string[]|null $attributesToSnippet list of attributes to snippet, with an optional maximum number of words to snippet + * + * @return self + */ + public function setAttributesToSnippet($attributesToSnippet) + { + $this->container['attributesToSnippet'] = $attributesToSnippet; + + return $this; + } + + /** + * Gets highlightPreTag + * + * @return string|null + */ + public function getHighlightPreTag() + { + return $this->container['highlightPreTag']; + } + + /** + * Sets highlightPreTag + * + * @param string|null $highlightPreTag the HTML string to insert before the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPreTag($highlightPreTag) + { + $this->container['highlightPreTag'] = $highlightPreTag; + + return $this; + } + + /** + * Gets highlightPostTag + * + * @return string|null + */ + public function getHighlightPostTag() + { + return $this->container['highlightPostTag']; + } + + /** + * Sets highlightPostTag + * + * @param string|null $highlightPostTag the HTML string to insert after the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPostTag($highlightPostTag) + { + $this->container['highlightPostTag'] = $highlightPostTag; + + return $this; + } + + /** + * Gets snippetEllipsisText + * + * @return string|null + */ + public function getSnippetEllipsisText() + { + return $this->container['snippetEllipsisText']; + } + + /** + * Sets snippetEllipsisText + * + * @param string|null $snippetEllipsisText string used as an ellipsis indicator when a snippet is truncated + * + * @return self + */ + public function setSnippetEllipsisText($snippetEllipsisText) + { + $this->container['snippetEllipsisText'] = $snippetEllipsisText; + + return $this; + } + + /** + * Gets restrictHighlightAndSnippetArrays + * + * @return bool|null + */ + public function getRestrictHighlightAndSnippetArrays() + { + return $this->container['restrictHighlightAndSnippetArrays']; + } + + /** + * Sets restrictHighlightAndSnippetArrays + * + * @param bool|null $restrictHighlightAndSnippetArrays restrict highlighting and snippeting to items that matched the query + * + * @return self + */ + public function setRestrictHighlightAndSnippetArrays($restrictHighlightAndSnippetArrays) + { + $this->container['restrictHighlightAndSnippetArrays'] = $restrictHighlightAndSnippetArrays; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage']; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets minWordSizefor1Typo + * + * @return int|null + */ + public function getMinWordSizefor1Typo() + { + return $this->container['minWordSizefor1Typo']; + } + + /** + * Sets minWordSizefor1Typo + * + * @param int|null $minWordSizefor1Typo minimum number of characters a word in the query string must contain to accept matches with 1 typo + * + * @return self + */ + public function setMinWordSizefor1Typo($minWordSizefor1Typo) + { + $this->container['minWordSizefor1Typo'] = $minWordSizefor1Typo; + + return $this; + } + + /** + * Gets minWordSizefor2Typos + * + * @return int|null + */ + public function getMinWordSizefor2Typos() + { + return $this->container['minWordSizefor2Typos']; + } + + /** + * Sets minWordSizefor2Typos + * + * @param int|null $minWordSizefor2Typos minimum number of characters a word in the query string must contain to accept matches with 2 typos + * + * @return self + */ + public function setMinWordSizefor2Typos($minWordSizefor2Typos) + { + $this->container['minWordSizefor2Typos'] = $minWordSizefor2Typos; + + return $this; + } + + /** + * Gets typoTolerance + * + * @return string|null + */ + public function getTypoTolerance() + { + return $this->container['typoTolerance']; + } + + /** + * Sets typoTolerance + * + * @param string|null $typoTolerance controls whether typo tolerance is enabled and how it is applied + * + * @return self + */ + public function setTypoTolerance($typoTolerance) + { + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($typoTolerance) && !in_array($typoTolerance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'typoTolerance', must be one of '%s'", + $typoTolerance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['typoTolerance'] = $typoTolerance; + + return $this; + } + + /** + * Gets allowTyposOnNumericTokens + * + * @return bool|null + */ + public function getAllowTyposOnNumericTokens() + { + return $this->container['allowTyposOnNumericTokens']; + } + + /** + * Sets allowTyposOnNumericTokens + * + * @param bool|null $allowTyposOnNumericTokens whether to allow typos on numbers (\"numeric tokens\") in the query string + * + * @return self + */ + public function setAllowTyposOnNumericTokens($allowTyposOnNumericTokens) + { + $this->container['allowTyposOnNumericTokens'] = $allowTyposOnNumericTokens; + + return $this; + } + + /** + * Gets disableTypoToleranceOnAttributes + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnAttributes() + { + return $this->container['disableTypoToleranceOnAttributes']; + } + + /** + * Sets disableTypoToleranceOnAttributes + * + * @param string[]|null $disableTypoToleranceOnAttributes list of attributes on which you want to disable typo tolerance + * + * @return self + */ + public function setDisableTypoToleranceOnAttributes($disableTypoToleranceOnAttributes) + { + $this->container['disableTypoToleranceOnAttributes'] = $disableTypoToleranceOnAttributes; + + return $this; + } + + /** + * Gets separatorsToIndex + * + * @return string|null + */ + public function getSeparatorsToIndex() + { + return $this->container['separatorsToIndex']; + } + + /** + * Sets separatorsToIndex + * + * @param string|null $separatorsToIndex control which separators are indexed + * + * @return self + */ + public function setSeparatorsToIndex($separatorsToIndex) + { + $this->container['separatorsToIndex'] = $separatorsToIndex; + + return $this; + } + + /** + * Gets ignorePlurals + * + * @return string|null + */ + public function getIgnorePlurals() + { + return $this->container['ignorePlurals']; + } + + /** + * Sets ignorePlurals + * + * @param string|null $ignorePlurals treats singular, plurals, and other forms of declensions as matching terms + * + * @return self + */ + public function setIgnorePlurals($ignorePlurals) + { + $this->container['ignorePlurals'] = $ignorePlurals; + + return $this; + } + + /** + * Gets removeStopWords + * + * @return string|null + */ + public function getRemoveStopWords() + { + return $this->container['removeStopWords']; + } + + /** + * Sets removeStopWords + * + * @param string|null $removeStopWords removes stop (common) words from the query before executing it + * + * @return self + */ + public function setRemoveStopWords($removeStopWords) + { + $this->container['removeStopWords'] = $removeStopWords; + + return $this; + } + + /** + * Gets keepDiacriticsOnCharacters + * + * @return string|null + */ + public function getKeepDiacriticsOnCharacters() + { + return $this->container['keepDiacriticsOnCharacters']; + } + + /** + * Sets keepDiacriticsOnCharacters + * + * @param string|null $keepDiacriticsOnCharacters list of characters that the engine shouldn't automatically normalize + * + * @return self + */ + public function setKeepDiacriticsOnCharacters($keepDiacriticsOnCharacters) + { + $this->container['keepDiacriticsOnCharacters'] = $keepDiacriticsOnCharacters; + + return $this; + } + + /** + * Gets queryLanguages + * + * @return string[]|null + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages']; + } + + /** + * Sets queryLanguages + * + * @param string[]|null $queryLanguages sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets decompoundQuery + * + * @return bool|null + */ + public function getDecompoundQuery() + { + return $this->container['decompoundQuery']; + } + + /** + * Sets decompoundQuery + * + * @param bool|null $decompoundQuery splits compound words into their composing atoms in the query + * + * @return self + */ + public function setDecompoundQuery($decompoundQuery) + { + $this->container['decompoundQuery'] = $decompoundQuery; + + return $this; + } + + /** + * Gets enableRules + * + * @return bool|null + */ + public function getEnableRules() + { + return $this->container['enableRules']; + } + + /** + * Sets enableRules + * + * @param bool|null $enableRules whether Rules should be globally enabled + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets enablePersonalization + * + * @return bool|null + */ + public function getEnablePersonalization() + { + return $this->container['enablePersonalization']; + } + + /** + * Sets enablePersonalization + * + * @param bool|null $enablePersonalization enable the Personalization feature + * + * @return self + */ + public function setEnablePersonalization($enablePersonalization) + { + $this->container['enablePersonalization'] = $enablePersonalization; + + return $this; + } + + /** + * Gets queryType + * + * @return string|null + */ + public function getQueryType() + { + return $this->container['queryType']; + } + + /** + * Sets queryType + * + * @param string|null $queryType controls if and how query words are interpreted as prefixes + * + * @return self + */ + public function setQueryType($queryType) + { + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($queryType) && !in_array($queryType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'queryType', must be one of '%s'", + $queryType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['queryType'] = $queryType; + + return $this; + } + + /** + * Gets removeWordsIfNoResults + * + * @return string|null + */ + public function getRemoveWordsIfNoResults() + { + return $this->container['removeWordsIfNoResults']; + } + + /** + * Sets removeWordsIfNoResults + * + * @param string|null $removeWordsIfNoResults selects a strategy to remove words from the query when it doesn't match any hits + * + * @return self + */ + public function setRemoveWordsIfNoResults($removeWordsIfNoResults) + { + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($removeWordsIfNoResults) && !in_array($removeWordsIfNoResults, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $removeWordsIfNoResults, + implode("', '", $allowedValues) + ) + ); + } + $this->container['removeWordsIfNoResults'] = $removeWordsIfNoResults; + + return $this; + } + + /** + * Gets advancedSyntax + * + * @return bool|null + */ + public function getAdvancedSyntax() + { + return $this->container['advancedSyntax']; + } + + /** + * Sets advancedSyntax + * + * @param bool|null $advancedSyntax enables the advanced query syntax + * + * @return self + */ + public function setAdvancedSyntax($advancedSyntax) + { + $this->container['advancedSyntax'] = $advancedSyntax; + + return $this; + } + + /** + * Gets optionalWords + * + * @return string[]|null + */ + public function getOptionalWords() + { + return $this->container['optionalWords']; + } + + /** + * Sets optionalWords + * + * @param string[]|null $optionalWords a list of words that should be considered as optional when found in the query + * + * @return self + */ + public function setOptionalWords($optionalWords) + { + $this->container['optionalWords'] = $optionalWords; + + return $this; + } + + /** + * Gets disableExactOnAttributes + * + * @return string[]|null + */ + public function getDisableExactOnAttributes() + { + return $this->container['disableExactOnAttributes']; + } + + /** + * Sets disableExactOnAttributes + * + * @param string[]|null $disableExactOnAttributes list of attributes on which you want to disable the exact ranking criterion + * + * @return self + */ + public function setDisableExactOnAttributes($disableExactOnAttributes) + { + $this->container['disableExactOnAttributes'] = $disableExactOnAttributes; + + return $this; + } + + /** + * Gets exactOnSingleWordQuery + * + * @return string|null + */ + public function getExactOnSingleWordQuery() + { + return $this->container['exactOnSingleWordQuery']; + } + + /** + * Sets exactOnSingleWordQuery + * + * @param string|null $exactOnSingleWordQuery controls how the exact ranking criterion is computed when the query contains only one word + * + * @return self + */ + public function setExactOnSingleWordQuery($exactOnSingleWordQuery) + { + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($exactOnSingleWordQuery) && !in_array($exactOnSingleWordQuery, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $exactOnSingleWordQuery, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exactOnSingleWordQuery'] = $exactOnSingleWordQuery; + + return $this; + } + + /** + * Gets alternativesAsExact + * + * @return string[]|null + */ + public function getAlternativesAsExact() + { + return $this->container['alternativesAsExact']; + } + + /** + * Sets alternativesAsExact + * + * @param string[]|null $alternativesAsExact list of alternatives that should be considered an exact match by the exact ranking criterion + * + * @return self + */ + public function setAlternativesAsExact($alternativesAsExact) + { + $allowedValues = $this->getAlternativesAsExactAllowableValues(); + if (!is_null($alternativesAsExact) && array_diff($alternativesAsExact, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'alternativesAsExact', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['alternativesAsExact'] = $alternativesAsExact; + + return $this; + } + + /** + * Gets advancedSyntaxFeatures + * + * @return string[]|null + */ + public function getAdvancedSyntaxFeatures() + { + return $this->container['advancedSyntaxFeatures']; + } + + /** + * Sets advancedSyntaxFeatures + * + * @param string[]|null $advancedSyntaxFeatures allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled + * + * @return self + */ + public function setAdvancedSyntaxFeatures($advancedSyntaxFeatures) + { + $allowedValues = $this->getAdvancedSyntaxFeaturesAllowableValues(); + if (!is_null($advancedSyntaxFeatures) && array_diff($advancedSyntaxFeatures, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'advancedSyntaxFeatures', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['advancedSyntaxFeatures'] = $advancedSyntaxFeatures; + + return $this; + } + + /** + * Gets distinct + * + * @return int|null + */ + public function getDistinct() + { + return $this->container['distinct']; + } + + /** + * Sets distinct + * + * @param int|null $distinct enables de-duplication or grouping of results + * + * @return self + */ + public function setDistinct($distinct) + { + if (!is_null($distinct) && ($distinct > 4)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling SearchParams., must be smaller than or equal to 4.'); + } + if (!is_null($distinct) && ($distinct < 0)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling SearchParams., must be bigger than or equal to 0.'); + } + + $this->container['distinct'] = $distinct; + + return $this; + } + + /** + * Gets synonyms + * + * @return bool|null + */ + public function getSynonyms() + { + return $this->container['synonyms']; + } + + /** + * Sets synonyms + * + * @param bool|null $synonyms whether to take into account an index's synonyms for a particular search + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets replaceSynonymsInHighlight + * + * @return bool|null + */ + public function getReplaceSynonymsInHighlight() + { + return $this->container['replaceSynonymsInHighlight']; + } + + /** + * Sets replaceSynonymsInHighlight + * + * @param bool|null $replaceSynonymsInHighlight whether to highlight and snippet the original word that matches the synonym or the synonym itself + * + * @return self + */ + public function setReplaceSynonymsInHighlight($replaceSynonymsInHighlight) + { + $this->container['replaceSynonymsInHighlight'] = $replaceSynonymsInHighlight; + + return $this; + } + + /** + * Gets minProximity + * + * @return int|null + */ + public function getMinProximity() + { + return $this->container['minProximity']; + } + + /** + * Sets minProximity + * + * @param int|null $minProximity precision of the proximity ranking criterion + * + * @return self + */ + public function setMinProximity($minProximity) + { + if (!is_null($minProximity) && ($minProximity > 7)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling SearchParams., must be smaller than or equal to 7.'); + } + if (!is_null($minProximity) && ($minProximity < 1)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling SearchParams., must be bigger than or equal to 1.'); + } + + $this->container['minProximity'] = $minProximity; + + return $this; + } + + /** + * Gets responseFields + * + * @return string[]|null + */ + public function getResponseFields() + { + return $this->container['responseFields']; + } + + /** + * Sets responseFields + * + * @param string[]|null $responseFields Choose which fields to return in the API response. This parameters applies to search and browse queries. + * + * @return self + */ + public function setResponseFields($responseFields) + { + $this->container['responseFields'] = $responseFields; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits']; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling SearchParams., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets attributeCriteriaComputedByMinProximity + * + * @return bool|null + */ + public function getAttributeCriteriaComputedByMinProximity() + { + return $this->container['attributeCriteriaComputedByMinProximity']; + } + + /** + * Sets attributeCriteriaComputedByMinProximity + * + * @param bool|null $attributeCriteriaComputedByMinProximity when attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage + * + * @return self + */ + public function setAttributeCriteriaComputedByMinProximity($attributeCriteriaComputedByMinProximity) + { + $this->container['attributeCriteriaComputedByMinProximity'] = $attributeCriteriaComputedByMinProximity; + + return $this; + } + + /** + * Gets renderingContent + * + * @return object|null + */ + public function getRenderingContent() + { + return $this->container['renderingContent']; + } + + /** + * Sets renderingContent + * + * @param object|null $renderingContent Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/SnippetResult.php b/clients/algoliasearch-client-php/lib/Model/Recommend/SnippetResult.php new file mode 100644 index 0000000000..dcb14d9751 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/SnippetResult.php @@ -0,0 +1,357 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SnippetResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'snippetResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'value' => 'string', + 'matchLevel' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'matchLevel' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'matchLevel' => 'matchLevel', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'matchLevel' => 'setMatchLevel', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'matchLevel' => 'getMatchLevel', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * 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; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + const MATCH_LEVEL_NONE = 'none'; + const MATCH_LEVEL_PARTIAL = 'partial'; + const MATCH_LEVEL_FULL = 'full'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMatchLevelAllowableValues() + { + return [ + self::MATCH_LEVEL_NONE, + self::MATCH_LEVEL_PARTIAL, + self::MATCH_LEVEL_FULL, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['value'] = $data['value'] ?? null; + $this->container['matchLevel'] = $data['matchLevel'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMatchLevelAllowableValues(); + if (!is_null($this->container['matchLevel']) && !in_array($this->container['matchLevel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'matchLevel', must be one of '%s'", + $this->container['matchLevel'], + implode("', '", $allowedValues) + ); + } + + 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 value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value markup text with occurrences highlighted + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matchLevel + * + * @return string|null + */ + public function getMatchLevel() + { + return $this->container['matchLevel']; + } + + /** + * Sets matchLevel + * + * @param string|null $matchLevel indicates how well the attribute matched the search query + * + * @return self + */ + public function setMatchLevel($matchLevel) + { + $allowedValues = $this->getMatchLevelAllowableValues(); + if (!is_null($matchLevel) && !in_array($matchLevel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'matchLevel', must be one of '%s'", + $matchLevel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['matchLevel'] = $matchLevel; + + 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]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Action.php b/clients/algoliasearch-client-php/lib/Model/Search/Action.php similarity index 95% rename from clients/algoliasearch-client-php/lib/Model/Action.php rename to clients/algoliasearch-client-php/lib/Model/Search/Action.php index 0296001727..140b709201 100644 --- a/clients/algoliasearch-client-php/lib/Model/Action.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/Action.php @@ -1,6 +1,6 @@ 'bool', 'exhaustiveTypo' => 'bool', 'facets' => 'array>', - 'facetsStats' => 'array', + 'facetsStats' => 'array', 'hitsPerPage' => 'int', 'index' => 'string', 'indexUsed' => 'string', @@ -544,7 +544,7 @@ public function setFacets($facets) /** * Gets facetsStats * - * @return array|null + * @return array|null */ public function getFacetsStats() { @@ -554,7 +554,7 @@ public function getFacetsStats() /** * Sets facetsStats * - * @param array|null $facetsStats statistics for numerical facets + * @param array|null $facetsStats statistics for numerical facets * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php b/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchResponseFacetsStats.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php rename to clients/algoliasearch-client-php/lib/Model/Search/BaseSearchResponseFacetsStats.php index 5af39f3245..0b74f01d81 100644 --- a/clients/algoliasearch-client-php/lib/Model/BaseSearchResponseFacetsStats.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchResponseFacetsStats.php @@ -1,6 +1,6 @@ 'bool', - 'requests' => '\Algolia\AlgoliaSearch\Model\BatchDictionaryEntriesRequest[]', + 'requests' => '\Algolia\AlgoliaSearch\Model\Search\BatchDictionaryEntriesRequest[]', ]; /** @@ -214,7 +214,7 @@ public function setClearExistingDictionaryEntries($clearExistingDictionaryEntrie /** * Gets requests * - * @return \Algolia\AlgoliaSearch\Model\BatchDictionaryEntriesRequest[] + * @return \Algolia\AlgoliaSearch\Model\Search\BatchDictionaryEntriesRequest[] */ public function getRequests() { @@ -224,7 +224,7 @@ public function getRequests() /** * Sets requests * - * @param \Algolia\AlgoliaSearch\Model\BatchDictionaryEntriesRequest[] $requests List of operations to batch. Each operation is described by an `action` and a `body`. + * @param \Algolia\AlgoliaSearch\Model\Search\BatchDictionaryEntriesRequest[] $requests List of operations to batch. Each operation is described by an `action` and a `body`. * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php b/clients/algoliasearch-client-php/lib/Model/Search/BatchDictionaryEntriesRequest.php similarity index 93% rename from clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php rename to clients/algoliasearch-client-php/lib/Model/Search/BatchDictionaryEntriesRequest.php index 79d0b964f7..51805d05da 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchDictionaryEntriesRequest.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/BatchDictionaryEntriesRequest.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\DictionaryAction', - 'body' => '\Algolia\AlgoliaSearch\Model\DictionaryEntry', + 'action' => '\Algolia\AlgoliaSearch\Model\Search\DictionaryAction', + 'body' => '\Algolia\AlgoliaSearch\Model\Search\DictionaryEntry', ]; /** @@ -191,7 +191,7 @@ public function valid() /** * Gets action * - * @return \Algolia\AlgoliaSearch\Model\DictionaryAction + * @return \Algolia\AlgoliaSearch\Model\Search\DictionaryAction */ public function getAction() { @@ -201,7 +201,7 @@ public function getAction() /** * Sets action * - * @param \Algolia\AlgoliaSearch\Model\DictionaryAction $action action + * @param \Algolia\AlgoliaSearch\Model\Search\DictionaryAction $action action * * @return self */ @@ -215,7 +215,7 @@ public function setAction($action) /** * Gets body * - * @return \Algolia\AlgoliaSearch\Model\DictionaryEntry + * @return \Algolia\AlgoliaSearch\Model\Search\DictionaryEntry */ public function getBody() { @@ -225,7 +225,7 @@ public function getBody() /** * Sets body * - * @param \Algolia\AlgoliaSearch\Model\DictionaryEntry $body body + * @param \Algolia\AlgoliaSearch\Model\Search\DictionaryEntry $body body * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/BatchParams.php b/clients/algoliasearch-client-php/lib/Model/Search/BatchParams.php similarity index 95% rename from clients/algoliasearch-client-php/lib/Model/BatchParams.php rename to clients/algoliasearch-client-php/lib/Model/Search/BatchParams.php index 40e2d3bf9f..a9bf58ead0 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/BatchParams.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\Operation[]', + 'requests' => '\Algolia\AlgoliaSearch\Model\Search\Operation[]', ]; /** @@ -180,7 +180,7 @@ public function valid() /** * Gets requests * - * @return \Algolia\AlgoliaSearch\Model\Operation[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\Operation[]|null */ public function getRequests() { @@ -190,7 +190,7 @@ public function getRequests() /** * Sets requests * - * @param \Algolia\AlgoliaSearch\Model\Operation[]|null $requests requests + * @param \Algolia\AlgoliaSearch\Model\Search\Operation[]|null $requests requests * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/BatchResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/BatchResponse.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/BatchResponse.php rename to clients/algoliasearch-client-php/lib/Model/Search/BatchResponse.php index b51b47bec8..de52770710 100644 --- a/clients/algoliasearch-client-php/lib/Model/BatchResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/BatchResponse.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\Operation[]', + 'requests' => '\Algolia\AlgoliaSearch\Model\Search\Operation[]', ]; /** @@ -180,7 +180,7 @@ public function valid() /** * Gets requests * - * @return \Algolia\AlgoliaSearch\Model\Operation[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\Operation[]|null */ public function getRequests() { @@ -190,7 +190,7 @@ public function getRequests() /** * Sets requests * - * @param \Algolia\AlgoliaSearch\Model\Operation[]|null $requests requests + * @param \Algolia\AlgoliaSearch\Model\Search\Operation[]|null $requests requests * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/BrowseRequest.php b/clients/algoliasearch-client-php/lib/Model/Search/BrowseRequest.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/BrowseRequest.php rename to clients/algoliasearch-client-php/lib/Model/Search/BrowseRequest.php index 5c53d672b9..ba0ee35fd8 100644 --- a/clients/algoliasearch-client-php/lib/Model/BrowseRequest.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/BrowseRequest.php @@ -1,6 +1,6 @@ 'bool', 'exhaustiveTypo' => 'bool', 'facets' => 'array>', - 'facetsStats' => 'array', + 'facetsStats' => 'array', 'hitsPerPage' => 'int', 'index' => 'string', 'indexUsed' => 'string', @@ -55,7 +55,7 @@ class BrowseResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'queryAfterRemoval' => 'string', 'serverUsed' => 'string', 'userData' => 'object', - 'hits' => '\Algolia\AlgoliaSearch\Model\Hit[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\Search\Hit[]', 'cursor' => 'string', ]; @@ -562,7 +562,7 @@ public function setFacets($facets) /** * Gets facetsStats * - * @return array|null + * @return array|null */ public function getFacetsStats() { @@ -572,7 +572,7 @@ public function getFacetsStats() /** * Sets facetsStats * - * @param array|null $facetsStats statistics for numerical facets + * @param array|null $facetsStats statistics for numerical facets * * @return self */ @@ -946,7 +946,7 @@ public function setUserData($userData) /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\Hit[] + * @return \Algolia\AlgoliaSearch\Model\Search\Hit[] */ public function getHits() { @@ -956,7 +956,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\Hit[] $hits hits + * @param \Algolia\AlgoliaSearch\Model\Search\Hit[] $hits hits * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/BuiltInOperation.php b/clients/algoliasearch-client-php/lib/Model/Search/BuiltInOperation.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/BuiltInOperation.php rename to clients/algoliasearch-client-php/lib/Model/Search/BuiltInOperation.php index ee3de71f05..3b431c5987 100644 --- a/clients/algoliasearch-client-php/lib/Model/BuiltInOperation.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/BuiltInOperation.php @@ -1,6 +1,6 @@ 'string', - 'anchoring' => '\Algolia\AlgoliaSearch\Model\Anchoring', + 'anchoring' => '\Algolia\AlgoliaSearch\Model\Search\Anchoring', 'alternatives' => 'bool', 'context' => 'string', ]; @@ -220,7 +220,7 @@ public function setPattern($pattern) /** * Gets anchoring * - * @return \Algolia\AlgoliaSearch\Model\Anchoring|null + * @return \Algolia\AlgoliaSearch\Model\Search\Anchoring|null */ public function getAnchoring() { @@ -230,7 +230,7 @@ public function getAnchoring() /** * Sets anchoring * - * @param \Algolia\AlgoliaSearch\Model\Anchoring|null $anchoring anchoring + * @param \Algolia\AlgoliaSearch\Model\Search\Anchoring|null $anchoring anchoring * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Consequence.php b/clients/algoliasearch-client-php/lib/Model/Search/Consequence.php similarity index 91% rename from clients/algoliasearch-client-php/lib/Model/Consequence.php rename to clients/algoliasearch-client-php/lib/Model/Search/Consequence.php index 36f7608c55..7926cdeb2c 100644 --- a/clients/algoliasearch-client-php/lib/Model/Consequence.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/Consequence.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\ConsequenceParams', - 'promote' => '\Algolia\AlgoliaSearch\Model\Promote[]', + 'params' => '\Algolia\AlgoliaSearch\Model\Search\ConsequenceParams', + 'promote' => '\Algolia\AlgoliaSearch\Model\Search\Promote[]', 'filterPromotes' => 'bool', - 'hide' => '\Algolia\AlgoliaSearch\Model\ConsequenceHide[]', + 'hide' => '\Algolia\AlgoliaSearch\Model\Search\ConsequenceHide[]', 'userData' => 'object', ]; @@ -204,7 +204,7 @@ public function valid() /** * Gets params * - * @return \Algolia\AlgoliaSearch\Model\ConsequenceParams|null + * @return \Algolia\AlgoliaSearch\Model\Search\ConsequenceParams|null */ public function getParams() { @@ -214,7 +214,7 @@ public function getParams() /** * Sets params * - * @param \Algolia\AlgoliaSearch\Model\ConsequenceParams|null $params params + * @param \Algolia\AlgoliaSearch\Model\Search\ConsequenceParams|null $params params * * @return self */ @@ -228,7 +228,7 @@ public function setParams($params) /** * Gets promote * - * @return \Algolia\AlgoliaSearch\Model\Promote[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\Promote[]|null */ public function getPromote() { @@ -238,7 +238,7 @@ public function getPromote() /** * Sets promote * - * @param \Algolia\AlgoliaSearch\Model\Promote[]|null $promote objects to promote as hits + * @param \Algolia\AlgoliaSearch\Model\Search\Promote[]|null $promote objects to promote as hits * * @return self */ @@ -276,7 +276,7 @@ public function setFilterPromotes($filterPromotes) /** * Gets hide * - * @return \Algolia\AlgoliaSearch\Model\ConsequenceHide[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\ConsequenceHide[]|null */ public function getHide() { @@ -286,7 +286,7 @@ public function getHide() /** * Sets hide * - * @param \Algolia\AlgoliaSearch\Model\ConsequenceHide[]|null $hide Objects to hide from hits. Each object must contain an objectID field. By default, you can hide up to 50 items per rule. + * @param \Algolia\AlgoliaSearch\Model\Search\ConsequenceHide[]|null $hide Objects to hide from hits. Each object must contain an objectID field. By default, you can hide up to 50 items per rule. * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php b/clients/algoliasearch-client-php/lib/Model/Search/ConsequenceHide.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php rename to clients/algoliasearch-client-php/lib/Model/Search/ConsequenceHide.php index 439670db5c..f99d024a5f 100644 --- a/clients/algoliasearch-client-php/lib/Model/ConsequenceHide.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/ConsequenceHide.php @@ -1,6 +1,6 @@ 'string', - 'automaticFacetFilters' => '\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]', - 'automaticOptionalFacetFilters' => '\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]', + 'automaticFacetFilters' => '\Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]', + 'automaticOptionalFacetFilters' => '\Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]', 'similarQuery' => 'string', 'filters' => 'string', 'facetFilters' => 'string[]', @@ -843,7 +843,7 @@ public function setQuery($query) /** * Gets automaticFacetFilters * - * @return \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null */ public function getAutomaticFacetFilters() { @@ -853,7 +853,7 @@ public function getAutomaticFacetFilters() /** * Sets automaticFacetFilters * - * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticFacetFilters names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern + * @param \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null $automaticFacetFilters names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern * * @return self */ @@ -867,7 +867,7 @@ public function setAutomaticFacetFilters($automaticFacetFilters) /** * Gets automaticOptionalFacetFilters * - * @return \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null */ public function getAutomaticOptionalFacetFilters() { @@ -877,7 +877,7 @@ public function getAutomaticOptionalFacetFilters() /** * Sets automaticOptionalFacetFilters * - * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticOptionalFacetFilters same syntax as automaticFacetFilters, but the engine treats the filters as optional + * @param \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null $automaticOptionalFacetFilters same syntax as automaticFacetFilters, but the engine treats the filters as optional * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php b/clients/algoliasearch-client-php/lib/Model/Search/CreatedAtObject.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php rename to clients/algoliasearch-client-php/lib/Model/Search/CreatedAtObject.php index f289737ba7..c3ff8c1ab1 100644 --- a/clients/algoliasearch-client-php/lib/Model/CreatedAtObject.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/CreatedAtObject.php @@ -1,6 +1,6 @@ 'string', 'words' => 'string[]', 'decomposition' => 'string[]', - 'state' => '\Algolia\AlgoliaSearch\Model\DictionaryEntryState', + 'state' => '\Algolia\AlgoliaSearch\Model\Search\DictionaryEntryState', ]; /** @@ -337,7 +337,7 @@ public function setDecomposition($decomposition) /** * Gets state * - * @return \Algolia\AlgoliaSearch\Model\DictionaryEntryState|null + * @return \Algolia\AlgoliaSearch\Model\Search\DictionaryEntryState|null */ public function getState() { @@ -347,7 +347,7 @@ public function getState() /** * Sets state * - * @param \Algolia\AlgoliaSearch\Model\DictionaryEntryState|null $state state + * @param \Algolia\AlgoliaSearch\Model\Search\DictionaryEntryState|null $state state * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/DictionaryEntryState.php b/clients/algoliasearch-client-php/lib/Model/Search/DictionaryEntryState.php similarity index 92% rename from clients/algoliasearch-client-php/lib/Model/DictionaryEntryState.php rename to clients/algoliasearch-client-php/lib/Model/Search/DictionaryEntryState.php index 823b81a3c2..dfe9245cec 100644 --- a/clients/algoliasearch-client-php/lib/Model/DictionaryEntryState.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/DictionaryEntryState.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\StandardEntries', + 'disableStandardEntries' => '\Algolia\AlgoliaSearch\Model\Search\StandardEntries', ]; /** @@ -184,7 +184,7 @@ public function valid() /** * Gets disableStandardEntries * - * @return \Algolia\AlgoliaSearch\Model\StandardEntries + * @return \Algolia\AlgoliaSearch\Model\Search\StandardEntries */ public function getDisableStandardEntries() { @@ -194,7 +194,7 @@ public function getDisableStandardEntries() /** * Sets disableStandardEntries * - * @param \Algolia\AlgoliaSearch\Model\StandardEntries $disableStandardEntries disableStandardEntries + * @param \Algolia\AlgoliaSearch\Model\Search\StandardEntries $disableStandardEntries disableStandardEntries * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/ErrorBase.php b/clients/algoliasearch-client-php/lib/Model/Search/ErrorBase.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/ErrorBase.php rename to clients/algoliasearch-client-php/lib/Model/Search/ErrorBase.php index 1bbea7821b..459e0af8de 100644 --- a/clients/algoliasearch-client-php/lib/Model/ErrorBase.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/ErrorBase.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\StandardEntries', + 'disableStandardEntries' => '\Algolia\AlgoliaSearch\Model\Search\StandardEntries', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets disableStandardEntries * - * @return \Algolia\AlgoliaSearch\Model\StandardEntries + * @return \Algolia\AlgoliaSearch\Model\Search\StandardEntries */ public function getDisableStandardEntries() { @@ -192,7 +192,7 @@ public function getDisableStandardEntries() /** * Sets disableStandardEntries * - * @param \Algolia\AlgoliaSearch\Model\StandardEntries $disableStandardEntries disableStandardEntries + * @param \Algolia\AlgoliaSearch\Model\Search\StandardEntries $disableStandardEntries disableStandardEntries * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponse.php similarity index 95% rename from clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php rename to clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponse.php index ce4a52628a..b8ef502bd2 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetLogsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponse.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\GetLogsResponseLogs[]', + 'logs' => '\Algolia\AlgoliaSearch\Model\Search\GetLogsResponseLogs[]', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets logs * - * @return \Algolia\AlgoliaSearch\Model\GetLogsResponseLogs[] + * @return \Algolia\AlgoliaSearch\Model\Search\GetLogsResponseLogs[] */ public function getLogs() { @@ -192,7 +192,7 @@ public function getLogs() /** * Sets logs * - * @param \Algolia\AlgoliaSearch\Model\GetLogsResponseLogs[] $logs logs + * @param \Algolia\AlgoliaSearch\Model\Search\GetLogsResponseLogs[] $logs logs * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php b/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponseInnerQueries.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php rename to clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponseInnerQueries.php index 8fef10989e..a10c2ec634 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetLogsResponseInnerQueries.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponseInnerQueries.php @@ -1,6 +1,6 @@ 'string', 'queryParams' => 'string', 'queryNbHits' => 'string', - 'innerQueries' => '\Algolia\AlgoliaSearch\Model\GetLogsResponseInnerQueries[]', + 'innerQueries' => '\Algolia\AlgoliaSearch\Model\Search\GetLogsResponseInnerQueries[]', ]; /** @@ -632,7 +632,7 @@ public function setQueryNbHits($queryNbHits) /** * Gets innerQueries * - * @return \Algolia\AlgoliaSearch\Model\GetLogsResponseInnerQueries[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\GetLogsResponseInnerQueries[]|null */ public function getInnerQueries() { @@ -642,7 +642,7 @@ public function getInnerQueries() /** * Sets innerQueries * - * @param \Algolia\AlgoliaSearch\Model\GetLogsResponseInnerQueries[]|null $innerQueries array of all performed queries for the given request + * @param \Algolia\AlgoliaSearch\Model\Search\GetLogsResponseInnerQueries[]|null $innerQueries array of all performed queries for the given request * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetObjectsParams.php b/clients/algoliasearch-client-php/lib/Model/Search/GetObjectsParams.php similarity index 95% rename from clients/algoliasearch-client-php/lib/Model/GetObjectsParams.php rename to clients/algoliasearch-client-php/lib/Model/Search/GetObjectsParams.php index 41de8bc00b..6501009716 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetObjectsParams.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/GetObjectsParams.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\MultipleGetObjectsParams[]', + 'requests' => '\Algolia\AlgoliaSearch\Model\Search\MultipleGetObjectsParams[]', ]; /** @@ -180,7 +180,7 @@ public function valid() /** * Gets requests * - * @return \Algolia\AlgoliaSearch\Model\MultipleGetObjectsParams[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\MultipleGetObjectsParams[]|null */ public function getRequests() { @@ -190,7 +190,7 @@ public function getRequests() /** * Sets requests * - * @param \Algolia\AlgoliaSearch\Model\MultipleGetObjectsParams[]|null $requests requests + * @param \Algolia\AlgoliaSearch\Model\Search\MultipleGetObjectsParams[]|null $requests requests * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/GetObjectsResponse.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php rename to clients/algoliasearch-client-php/lib/Model/Search/GetObjectsResponse.php index 27c7531669..f83202728e 100644 --- a/clients/algoliasearch-client-php/lib/Model/GetObjectsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/GetObjectsResponse.php @@ -1,6 +1,6 @@ 'array[]', + 'topUsers' => 'array[]', ]; /** @@ -184,7 +184,7 @@ public function valid() /** * Gets topUsers * - * @return array[] + * @return array[] */ public function getTopUsers() { @@ -194,7 +194,7 @@ public function getTopUsers() /** * Sets topUsers * - * @param array[] $topUsers Mapping of cluster names to top users + * @param array[] $topUsers Mapping of cluster names to top users * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/HighlightResult.php b/clients/algoliasearch-client-php/lib/Model/Search/HighlightResult.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/HighlightResult.php rename to clients/algoliasearch-client-php/lib/Model/Search/HighlightResult.php index 2fb9d53ddb..9b37a61f10 100644 --- a/clients/algoliasearch-client-php/lib/Model/HighlightResult.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/HighlightResult.php @@ -1,6 +1,6 @@ 'string', - 'highlightResult' => '\Algolia\AlgoliaSearch\Model\HighlightResult', - 'snippetResult' => '\Algolia\AlgoliaSearch\Model\SnippetResult', - 'rankingInfo' => '\Algolia\AlgoliaSearch\Model\RankingInfo', + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\Search\HighlightResult', + 'snippetResult' => '\Algolia\AlgoliaSearch\Model\Search\SnippetResult', + 'rankingInfo' => '\Algolia\AlgoliaSearch\Model\Search\RankingInfo', 'distinctSeqID' => 'int', ]; @@ -232,7 +232,7 @@ public function setObjectID($objectID) /** * Gets highlightResult * - * @return \Algolia\AlgoliaSearch\Model\HighlightResult|null + * @return \Algolia\AlgoliaSearch\Model\Search\HighlightResult|null */ public function getHighlightResult() { @@ -242,7 +242,7 @@ public function getHighlightResult() /** * Sets highlightResult * - * @param \Algolia\AlgoliaSearch\Model\HighlightResult|null $highlightResult highlightResult + * @param \Algolia\AlgoliaSearch\Model\Search\HighlightResult|null $highlightResult highlightResult * * @return self */ @@ -256,7 +256,7 @@ public function setHighlightResult($highlightResult) /** * Gets snippetResult * - * @return \Algolia\AlgoliaSearch\Model\SnippetResult|null + * @return \Algolia\AlgoliaSearch\Model\Search\SnippetResult|null */ public function getSnippetResult() { @@ -266,7 +266,7 @@ public function getSnippetResult() /** * Sets snippetResult * - * @param \Algolia\AlgoliaSearch\Model\SnippetResult|null $snippetResult snippetResult + * @param \Algolia\AlgoliaSearch\Model\Search\SnippetResult|null $snippetResult snippetResult * * @return self */ @@ -280,7 +280,7 @@ public function setSnippetResult($snippetResult) /** * Gets rankingInfo * - * @return \Algolia\AlgoliaSearch\Model\RankingInfo|null + * @return \Algolia\AlgoliaSearch\Model\Search\RankingInfo|null */ public function getRankingInfo() { @@ -290,7 +290,7 @@ public function getRankingInfo() /** * Sets rankingInfo * - * @param \Algolia\AlgoliaSearch\Model\RankingInfo|null $rankingInfo rankingInfo + * @param \Algolia\AlgoliaSearch\Model\Search\RankingInfo|null $rankingInfo rankingInfo * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/IndexSettings.php b/clients/algoliasearch-client-php/lib/Model/Search/IndexSettings.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/IndexSettings.php rename to clients/algoliasearch-client-php/lib/Model/Search/IndexSettings.php index 66c7494b07..95a21fc0bf 100644 --- a/clients/algoliasearch-client-php/lib/Model/IndexSettings.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/IndexSettings.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\DictionaryLanguage', - 'stopwords' => '\Algolia\AlgoliaSearch\Model\DictionaryLanguage', - 'compounds' => '\Algolia\AlgoliaSearch\Model\DictionaryLanguage', + 'plurals' => '\Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage', + 'stopwords' => '\Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage', + 'compounds' => '\Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage', ]; /** @@ -202,7 +202,7 @@ public function valid() /** * Gets plurals * - * @return \Algolia\AlgoliaSearch\Model\DictionaryLanguage + * @return \Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage */ public function getPlurals() { @@ -212,7 +212,7 @@ public function getPlurals() /** * Sets plurals * - * @param \Algolia\AlgoliaSearch\Model\DictionaryLanguage $plurals plurals + * @param \Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage $plurals plurals * * @return self */ @@ -226,7 +226,7 @@ public function setPlurals($plurals) /** * Gets stopwords * - * @return \Algolia\AlgoliaSearch\Model\DictionaryLanguage + * @return \Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage */ public function getStopwords() { @@ -236,7 +236,7 @@ public function getStopwords() /** * Sets stopwords * - * @param \Algolia\AlgoliaSearch\Model\DictionaryLanguage $stopwords stopwords + * @param \Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage $stopwords stopwords * * @return self */ @@ -250,7 +250,7 @@ public function setStopwords($stopwords) /** * Gets compounds * - * @return \Algolia\AlgoliaSearch\Model\DictionaryLanguage + * @return \Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage */ public function getCompounds() { @@ -260,7 +260,7 @@ public function getCompounds() /** * Sets compounds * - * @param \Algolia\AlgoliaSearch\Model\DictionaryLanguage $compounds compounds + * @param \Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage $compounds compounds * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/ListApiKeysResponse.php similarity index 96% rename from clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php rename to clients/algoliasearch-client-php/lib/Model/Search/ListApiKeysResponse.php index 12a0ca555a..100201f47a 100644 --- a/clients/algoliasearch-client-php/lib/Model/ListApiKeysResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/ListApiKeysResponse.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\Key[]', + 'keys' => '\Algolia\AlgoliaSearch\Model\Search\Key[]', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets keys * - * @return \Algolia\AlgoliaSearch\Model\Key[] + * @return \Algolia\AlgoliaSearch\Model\Search\Key[] */ public function getKeys() { @@ -192,7 +192,7 @@ public function getKeys() /** * Sets keys * - * @param \Algolia\AlgoliaSearch\Model\Key[] $keys list of api keys + * @param \Algolia\AlgoliaSearch\Model\Search\Key[] $keys list of api keys * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/ListClustersResponse.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php rename to clients/algoliasearch-client-php/lib/Model/Search/ListClustersResponse.php index 9f47847915..c69fd9395d 100644 --- a/clients/algoliasearch-client-php/lib/Model/ListClustersResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/ListClustersResponse.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\Indice[]', + 'items' => '\Algolia\AlgoliaSearch\Model\Search\Indice[]', 'nbPages' => 'int', ]; @@ -184,7 +184,7 @@ public function valid() /** * Gets items * - * @return \Algolia\AlgoliaSearch\Model\Indice[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\Indice[]|null */ public function getItems() { @@ -194,7 +194,7 @@ public function getItems() /** * Sets items * - * @param \Algolia\AlgoliaSearch\Model\Indice[]|null $items list of the fetched indices + * @param \Algolia\AlgoliaSearch\Model\Search\Indice[]|null $items list of the fetched indices * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/ListUserIdsResponse.php similarity index 96% rename from clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php rename to clients/algoliasearch-client-php/lib/Model/Search/ListUserIdsResponse.php index d26bb071df..99f3ce5d7f 100644 --- a/clients/algoliasearch-client-php/lib/Model/ListUserIdsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/ListUserIdsResponse.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\UserId[]', + 'userIDs' => '\Algolia\AlgoliaSearch\Model\Search\UserId[]', ]; /** @@ -184,7 +184,7 @@ public function valid() /** * Gets userIDs * - * @return \Algolia\AlgoliaSearch\Model\UserId[] + * @return \Algolia\AlgoliaSearch\Model\Search\UserId[] */ public function getUserIDs() { @@ -194,7 +194,7 @@ public function getUserIDs() /** * Sets userIDs * - * @param \Algolia\AlgoliaSearch\Model\UserId[] $userIDs list of userIDs + * @param \Algolia\AlgoliaSearch\Model\Search\UserId[] $userIDs list of userIDs * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/ModelInterface.php b/clients/algoliasearch-client-php/lib/Model/Search/ModelInterface.php similarity index 93% rename from clients/algoliasearch-client-php/lib/Model/ModelInterface.php rename to clients/algoliasearch-client-php/lib/Model/Search/ModelInterface.php index a9505a67e5..f4f70407c4 100644 --- a/clients/algoliasearch-client-php/lib/Model/ModelInterface.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/ModelInterface.php @@ -1,11 +1,11 @@ 'string', 'query' => 'string', - 'type' => '\Algolia\AlgoliaSearch\Model\MultipleQueriesType', + 'type' => '\Algolia\AlgoliaSearch\Model\Search\MultipleQueriesType', 'facet' => 'string', 'params' => 'string', ]; @@ -254,7 +254,7 @@ public function setQuery($query) /** * Gets type * - * @return \Algolia\AlgoliaSearch\Model\MultipleQueriesType|null + * @return \Algolia\AlgoliaSearch\Model\Search\MultipleQueriesType|null */ public function getType() { @@ -264,7 +264,7 @@ public function getType() /** * Sets type * - * @param \Algolia\AlgoliaSearch\Model\MultipleQueriesType|null $type type + * @param \Algolia\AlgoliaSearch\Model\Search\MultipleQueriesType|null $type type * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesParams.php b/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesParams.php similarity index 92% rename from clients/algoliasearch-client-php/lib/Model/MultipleQueriesParams.php rename to clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesParams.php index cfba5b2975..ec55eb5b9c 100644 --- a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesParams.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesParams.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\MultipleQueries[]', - 'strategy' => '\Algolia\AlgoliaSearch\Model\MultipleQueriesStrategy', + 'requests' => '\Algolia\AlgoliaSearch\Model\Search\MultipleQueries[]', + 'strategy' => '\Algolia\AlgoliaSearch\Model\Search\MultipleQueriesStrategy', ]; /** @@ -188,7 +188,7 @@ public function valid() /** * Gets requests * - * @return \Algolia\AlgoliaSearch\Model\MultipleQueries[] + * @return \Algolia\AlgoliaSearch\Model\Search\MultipleQueries[] */ public function getRequests() { @@ -198,7 +198,7 @@ public function getRequests() /** * Sets requests * - * @param \Algolia\AlgoliaSearch\Model\MultipleQueries[] $requests requests + * @param \Algolia\AlgoliaSearch\Model\Search\MultipleQueries[] $requests requests * * @return self */ @@ -212,7 +212,7 @@ public function setRequests($requests) /** * Gets strategy * - * @return \Algolia\AlgoliaSearch\Model\MultipleQueriesStrategy|null + * @return \Algolia\AlgoliaSearch\Model\Search\MultipleQueriesStrategy|null */ public function getStrategy() { @@ -222,7 +222,7 @@ public function getStrategy() /** * Sets strategy * - * @param \Algolia\AlgoliaSearch\Model\MultipleQueriesStrategy|null $strategy strategy + * @param \Algolia\AlgoliaSearch\Model\Search\MultipleQueriesStrategy|null $strategy strategy * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesResponse.php similarity index 95% rename from clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php rename to clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesResponse.php index 8e9892d174..9824632f1d 100644 --- a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesResponse.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\SearchResponse[]', + 'results' => '\Algolia\AlgoliaSearch\Model\Search\SearchResponse[]', ]; /** @@ -178,7 +178,7 @@ public function valid() /** * Gets results * - * @return \Algolia\AlgoliaSearch\Model\SearchResponse[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\SearchResponse[]|null */ public function getResults() { @@ -188,7 +188,7 @@ public function getResults() /** * Sets results * - * @param \Algolia\AlgoliaSearch\Model\SearchResponse[]|null $results results + * @param \Algolia\AlgoliaSearch\Model\Search\SearchResponse[]|null $results results * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesStrategy.php b/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesStrategy.php similarity index 92% rename from clients/algoliasearch-client-php/lib/Model/MultipleQueriesStrategy.php rename to clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesStrategy.php index 3c4e67950d..cd7d63c38b 100644 --- a/clients/algoliasearch-client-php/lib/Model/MultipleQueriesStrategy.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesStrategy.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\Action', + 'action' => '\Algolia\AlgoliaSearch\Model\Search\Action', 'body' => 'object', 'indexName' => 'string', ]; @@ -190,7 +190,7 @@ public function valid() /** * Gets action * - * @return \Algolia\AlgoliaSearch\Model\Action|null + * @return \Algolia\AlgoliaSearch\Model\Search\Action|null */ public function getAction() { @@ -200,7 +200,7 @@ public function getAction() /** * Sets action * - * @param \Algolia\AlgoliaSearch\Model\Action|null $action action + * @param \Algolia\AlgoliaSearch\Model\Search\Action|null $action action * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/OperationIndexParams.php b/clients/algoliasearch-client-php/lib/Model/Search/OperationIndexParams.php similarity index 92% rename from clients/algoliasearch-client-php/lib/Model/OperationIndexParams.php rename to clients/algoliasearch-client-php/lib/Model/Search/OperationIndexParams.php index 41b530169b..a560dae9f0 100644 --- a/clients/algoliasearch-client-php/lib/Model/OperationIndexParams.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/OperationIndexParams.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\OperationType', + 'operation' => '\Algolia\AlgoliaSearch\Model\Search\OperationType', 'destination' => 'string', - 'scope' => '\Algolia\AlgoliaSearch\Model\ScopeType[]', + 'scope' => '\Algolia\AlgoliaSearch\Model\Search\ScopeType[]', ]; /** @@ -197,7 +197,7 @@ public function valid() /** * Gets operation * - * @return \Algolia\AlgoliaSearch\Model\OperationType + * @return \Algolia\AlgoliaSearch\Model\Search\OperationType */ public function getOperation() { @@ -207,7 +207,7 @@ public function getOperation() /** * Sets operation * - * @param \Algolia\AlgoliaSearch\Model\OperationType $operation operation + * @param \Algolia\AlgoliaSearch\Model\Search\OperationType $operation operation * * @return self */ @@ -245,7 +245,7 @@ public function setDestination($destination) /** * Gets scope * - * @return \Algolia\AlgoliaSearch\Model\ScopeType[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\ScopeType[]|null */ public function getScope() { @@ -255,7 +255,7 @@ public function getScope() /** * Sets scope * - * @param \Algolia\AlgoliaSearch\Model\ScopeType[]|null $scope Scope of the data to copy. When absent, a full copy is performed. When present, only the selected scopes are copied. + * @param \Algolia\AlgoliaSearch\Model\Search\ScopeType[]|null $scope Scope of the data to copy. When absent, a full copy is performed. When present, only the selected scopes are copied. * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/OperationType.php b/clients/algoliasearch-client-php/lib/Model/Search/OperationType.php similarity index 92% rename from clients/algoliasearch-client-php/lib/Model/OperationType.php rename to clients/algoliasearch-client-php/lib/Model/Search/OperationType.php index e9bfef789a..8725c23675 100644 --- a/clients/algoliasearch-client-php/lib/Model/OperationType.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/OperationType.php @@ -1,6 +1,6 @@ 'string', - 'automaticFacetFilters' => '\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]', - 'automaticOptionalFacetFilters' => '\Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]', + 'automaticFacetFilters' => '\Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]', + 'automaticOptionalFacetFilters' => '\Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]', ]; /** @@ -216,7 +216,7 @@ public function setQuery($query) /** * Gets automaticFacetFilters * - * @return \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null */ public function getAutomaticFacetFilters() { @@ -226,7 +226,7 @@ public function getAutomaticFacetFilters() /** * Sets automaticFacetFilters * - * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticFacetFilters names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern + * @param \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null $automaticFacetFilters names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern * * @return self */ @@ -240,7 +240,7 @@ public function setAutomaticFacetFilters($automaticFacetFilters) /** * Gets automaticOptionalFacetFilters * - * @return \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null */ public function getAutomaticOptionalFacetFilters() { @@ -250,7 +250,7 @@ public function getAutomaticOptionalFacetFilters() /** * Sets automaticOptionalFacetFilters * - * @param \Algolia\AlgoliaSearch\Model\AutomaticFacetFilter[]|null $automaticOptionalFacetFilters same syntax as automaticFacetFilters, but the engine treats the filters as optional + * @param \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null $automaticOptionalFacetFilters same syntax as automaticFacetFilters, but the engine treats the filters as optional * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/Promote.php b/clients/algoliasearch-client-php/lib/Model/Search/Promote.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/Promote.php rename to clients/algoliasearch-client-php/lib/Model/Search/Promote.php index 27b86fae58..3f06e62feb 100644 --- a/clients/algoliasearch-client-php/lib/Model/Promote.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/Promote.php @@ -1,6 +1,6 @@ 'int', 'geoDistance' => 'int', 'geoPrecision' => 'int', - 'matchedGeoLocation' => 'array', + 'matchedGeoLocation' => 'array', 'nbExactWords' => 'int', 'nbTypos' => 'int', 'promoted' => 'bool', @@ -334,7 +334,7 @@ public function setGeoPrecision($geoPrecision) /** * Gets matchedGeoLocation * - * @return array|null + * @return array|null */ public function getMatchedGeoLocation() { @@ -344,7 +344,7 @@ public function getMatchedGeoLocation() /** * Sets matchedGeoLocation * - * @param array|null $matchedGeoLocation matchedGeoLocation + * @param array|null $matchedGeoLocation matchedGeoLocation * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php b/clients/algoliasearch-client-php/lib/Model/Search/RankingInfoMatchedGeoLocation.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php rename to clients/algoliasearch-client-php/lib/Model/Search/RankingInfoMatchedGeoLocation.php index cc946d6772..5483c9449b 100644 --- a/clients/algoliasearch-client-php/lib/Model/RankingInfoMatchedGeoLocation.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/RankingInfoMatchedGeoLocation.php @@ -1,6 +1,6 @@ 'string', - 'conditions' => '\Algolia\AlgoliaSearch\Model\Condition[]', - 'consequence' => '\Algolia\AlgoliaSearch\Model\Consequence', + 'conditions' => '\Algolia\AlgoliaSearch\Model\Search\Condition[]', + 'consequence' => '\Algolia\AlgoliaSearch\Model\Search\Consequence', 'description' => 'string', 'enabled' => 'bool', - 'validity' => '\Algolia\AlgoliaSearch\Model\TimeRange[]', + 'validity' => '\Algolia\AlgoliaSearch\Model\Search\TimeRange[]', ]; /** @@ -241,7 +241,7 @@ public function setObjectID($objectID) /** * Gets conditions * - * @return \Algolia\AlgoliaSearch\Model\Condition[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\Condition[]|null */ public function getConditions() { @@ -251,7 +251,7 @@ public function getConditions() /** * Sets conditions * - * @param \Algolia\AlgoliaSearch\Model\Condition[]|null $conditions A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule. + * @param \Algolia\AlgoliaSearch\Model\Search\Condition[]|null $conditions A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule. * * @return self */ @@ -265,7 +265,7 @@ public function setConditions($conditions) /** * Gets consequence * - * @return \Algolia\AlgoliaSearch\Model\Consequence + * @return \Algolia\AlgoliaSearch\Model\Search\Consequence */ public function getConsequence() { @@ -275,7 +275,7 @@ public function getConsequence() /** * Sets consequence * - * @param \Algolia\AlgoliaSearch\Model\Consequence $consequence consequence + * @param \Algolia\AlgoliaSearch\Model\Search\Consequence $consequence consequence * * @return self */ @@ -337,7 +337,7 @@ public function setEnabled($enabled) /** * Gets validity * - * @return \Algolia\AlgoliaSearch\Model\TimeRange[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\TimeRange[]|null */ public function getValidity() { @@ -347,7 +347,7 @@ public function getValidity() /** * Sets validity * - * @param \Algolia\AlgoliaSearch\Model\TimeRange[]|null $validity By default, Rules are permanently valid. When validity periods are specified, the Rule applies only during those periods; it's ignored the rest of the time. The list must not be empty. + * @param \Algolia\AlgoliaSearch\Model\Search\TimeRange[]|null $validity By default, Rules are permanently valid. When validity periods are specified, the Rule applies only during those periods; it's ignored the rest of the time. The list must not be empty. * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/SaveObjectResponse.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php rename to clients/algoliasearch-client-php/lib/Model/Search/SaveObjectResponse.php index c1a43fbf20..abcbc1fcb4 100644 --- a/clients/algoliasearch-client-php/lib/Model/SaveObjectResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SaveObjectResponse.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponseFacetHits[]', + 'facetHits' => '\Algolia\AlgoliaSearch\Model\Search\SearchForFacetValuesResponseFacetHits[]', ]; /** @@ -182,7 +182,7 @@ public function valid() /** * Gets facetHits * - * @return \Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponseFacetHits[] + * @return \Algolia\AlgoliaSearch\Model\Search\SearchForFacetValuesResponseFacetHits[] */ public function getFacetHits() { @@ -192,7 +192,7 @@ public function getFacetHits() /** * Sets facetHits * - * @param \Algolia\AlgoliaSearch\Model\SearchForFacetValuesResponseFacetHits[] $facetHits facetHits + * @param \Algolia\AlgoliaSearch\Model\Search\SearchForFacetValuesResponseFacetHits[] $facetHits facetHits * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacetValuesResponseFacetHits.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php rename to clients/algoliasearch-client-php/lib/Model/Search/SearchForFacetValuesResponseFacetHits.php index f5c7b8bba5..30aab83f87 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchForFacetValuesResponseFacetHits.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacetValuesResponseFacetHits.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\Hit[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\Search\Hit[]', ]; /** @@ -178,7 +178,7 @@ public function valid() /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\Hit[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\Hit[]|null */ public function getHits() { @@ -188,7 +188,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\Hit[]|null $hits hits + * @param \Algolia\AlgoliaSearch\Model\Search\Hit[]|null $hits hits * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SearchParams.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchParams.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/SearchParams.php rename to clients/algoliasearch-client-php/lib/Model/Search/SearchParams.php index ec002c5001..696fd1de87 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchParams.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchParams.php @@ -1,6 +1,6 @@ 'bool', 'exhaustiveTypo' => 'bool', 'facets' => 'array>', - 'facetsStats' => 'array', + 'facetsStats' => 'array', 'hitsPerPage' => 'int', 'index' => 'string', 'indexUsed' => 'string', @@ -55,7 +55,7 @@ class SearchResponse implements ModelInterface, ArrayAccess, \JsonSerializable 'queryAfterRemoval' => 'string', 'serverUsed' => 'string', 'userData' => 'object', - 'hits' => '\Algolia\AlgoliaSearch\Model\Hit[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\Search\Hit[]', ]; /** @@ -553,7 +553,7 @@ public function setFacets($facets) /** * Gets facetsStats * - * @return array|null + * @return array|null */ public function getFacetsStats() { @@ -563,7 +563,7 @@ public function getFacetsStats() /** * Sets facetsStats * - * @param array|null $facetsStats statistics for numerical facets + * @param array|null $facetsStats statistics for numerical facets * * @return self */ @@ -937,7 +937,7 @@ public function setUserData($userData) /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\Hit[] + * @return \Algolia\AlgoliaSearch\Model\Search\Hit[] */ public function getHits() { @@ -947,7 +947,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\Hit[] $hits hits + * @param \Algolia\AlgoliaSearch\Model\Search\Hit[] $hits hits * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchRulesParams.php similarity index 97% rename from clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php rename to clients/algoliasearch-client-php/lib/Model/Search/SearchRulesParams.php index b679355452..0bdb649303 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchRulesParams.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchRulesParams.php @@ -1,6 +1,6 @@ 'string', - 'anchoring' => '\Algolia\AlgoliaSearch\Model\Anchoring', + 'anchoring' => '\Algolia\AlgoliaSearch\Model\Search\Anchoring', 'context' => 'string', 'page' => 'int', 'hitsPerPage' => 'int', @@ -240,7 +240,7 @@ public function setQuery($query) /** * Gets anchoring * - * @return \Algolia\AlgoliaSearch\Model\Anchoring|null + * @return \Algolia\AlgoliaSearch\Model\Search\Anchoring|null */ public function getAnchoring() { @@ -250,7 +250,7 @@ public function getAnchoring() /** * Sets anchoring * - * @param \Algolia\AlgoliaSearch\Model\Anchoring|null $anchoring anchoring + * @param \Algolia\AlgoliaSearch\Model\Search\Anchoring|null $anchoring anchoring * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchRulesResponse.php similarity index 97% rename from clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php rename to clients/algoliasearch-client-php/lib/Model/Search/SearchRulesResponse.php index 7beafbe40c..92f0bc024e 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchRulesResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchRulesResponse.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\Rule[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\Search\Rule[]', 'nbHits' => 'int', 'page' => 'int', 'nbPages' => 'int', @@ -209,7 +209,7 @@ public function valid() /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\Rule[] + * @return \Algolia\AlgoliaSearch\Model\Search\Rule[] */ public function getHits() { @@ -219,7 +219,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\Rule[] $hits fetched rules + * @param \Algolia\AlgoliaSearch\Model\Search\Rule[] $hits fetched rules * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchSynonymsResponse.php similarity index 96% rename from clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php rename to clients/algoliasearch-client-php/lib/Model/Search/SearchSynonymsResponse.php index d4c5c7b785..6ecb838e55 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchSynonymsResponse.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchSynonymsResponse.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\SynonymHit[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\Search\SynonymHit[]', 'nbHits' => 'int', ]; @@ -191,7 +191,7 @@ public function valid() /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\SynonymHit[] + * @return \Algolia\AlgoliaSearch\Model\Search\SynonymHit[] */ public function getHits() { @@ -201,7 +201,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\SynonymHit[] $hits array of synonym objects + * @param \Algolia\AlgoliaSearch\Model\Search\SynonymHit[] $hits array of synonym objects * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsParams.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsParams.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/SearchUserIdsParams.php rename to clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsParams.php index fbf1d74e12..0d182ddcce 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsParams.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsParams.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHits[]', + 'hits' => '\Algolia\AlgoliaSearch\Model\Search\SearchUserIdsResponseHits[]', 'nbHits' => 'int', 'page' => 'int', 'hitsPerPage' => 'int', @@ -220,7 +220,7 @@ public function valid() /** * Gets hits * - * @return \Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHits[] + * @return \Algolia\AlgoliaSearch\Model\Search\SearchUserIdsResponseHits[] */ public function getHits() { @@ -230,7 +230,7 @@ public function getHits() /** * Sets hits * - * @param \Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHits[] $hits list of user object matching the query + * @param \Algolia\AlgoliaSearch\Model\Search\SearchUserIdsResponseHits[] $hits list of user object matching the query * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponseHighlightResult.php similarity index 93% rename from clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php rename to clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponseHighlightResult.php index 70e0bf88c0..79c4154c8b 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHighlightResult.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponseHighlightResult.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\HighlightResult', - 'clusterName' => '\Algolia\AlgoliaSearch\Model\HighlightResult', + 'userID' => '\Algolia\AlgoliaSearch\Model\Search\HighlightResult', + 'clusterName' => '\Algolia\AlgoliaSearch\Model\Search\HighlightResult', ]; /** @@ -191,7 +191,7 @@ public function valid() /** * Gets userID * - * @return \Algolia\AlgoliaSearch\Model\HighlightResult + * @return \Algolia\AlgoliaSearch\Model\Search\HighlightResult */ public function getUserID() { @@ -201,7 +201,7 @@ public function getUserID() /** * Sets userID * - * @param \Algolia\AlgoliaSearch\Model\HighlightResult $userID userID + * @param \Algolia\AlgoliaSearch\Model\Search\HighlightResult $userID userID * * @return self */ @@ -215,7 +215,7 @@ public function setUserID($userID) /** * Gets clusterName * - * @return \Algolia\AlgoliaSearch\Model\HighlightResult + * @return \Algolia\AlgoliaSearch\Model\Search\HighlightResult */ public function getClusterName() { @@ -225,7 +225,7 @@ public function getClusterName() /** * Sets clusterName * - * @param \Algolia\AlgoliaSearch\Model\HighlightResult $clusterName clusterName + * @param \Algolia\AlgoliaSearch\Model\Search\HighlightResult $clusterName clusterName * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponseHits.php similarity index 97% rename from clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php rename to clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponseHits.php index 764d93a24f..25f4a23219 100644 --- a/clients/algoliasearch-client-php/lib/Model/SearchUserIdsResponseHits.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponseHits.php @@ -1,6 +1,6 @@ 'int', 'dataSize' => 'int', 'objectID' => 'string', - 'highlightResult' => '\Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHighlightResult', + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\Search\SearchUserIdsResponseHighlightResult', ]; /** @@ -355,7 +355,7 @@ public function setObjectID($objectID) /** * Gets highlightResult * - * @return \Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHighlightResult + * @return \Algolia\AlgoliaSearch\Model\Search\SearchUserIdsResponseHighlightResult */ public function getHighlightResult() { @@ -365,7 +365,7 @@ public function getHighlightResult() /** * Sets highlightResult * - * @param \Algolia\AlgoliaSearch\Model\SearchUserIdsResponseHighlightResult $highlightResult highlightResult + * @param \Algolia\AlgoliaSearch\Model\Search\SearchUserIdsResponseHighlightResult $highlightResult highlightResult * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SnippetResult.php b/clients/algoliasearch-client-php/lib/Model/Search/SnippetResult.php similarity index 99% rename from clients/algoliasearch-client-php/lib/Model/SnippetResult.php rename to clients/algoliasearch-client-php/lib/Model/Search/SnippetResult.php index 7a700a298d..e507424b3e 100644 --- a/clients/algoliasearch-client-php/lib/Model/SnippetResult.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SnippetResult.php @@ -1,6 +1,6 @@ 'string', - 'type' => '\Algolia\AlgoliaSearch\Model\SynonymType', + 'type' => '\Algolia\AlgoliaSearch\Model\Search\SynonymType', 'synonyms' => 'string[]', 'input' => 'string', 'word' => 'string', 'corrections' => 'string[]', 'placeholder' => 'string', 'replacements' => 'string[]', - 'highlightResult' => '\Algolia\AlgoliaSearch\Model\SynonymHitHighlightResult', + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\Search\SynonymHitHighlightResult', ]; /** @@ -259,7 +259,7 @@ public function setObjectID($objectID) /** * Gets type * - * @return \Algolia\AlgoliaSearch\Model\SynonymType + * @return \Algolia\AlgoliaSearch\Model\Search\SynonymType */ public function getType() { @@ -269,7 +269,7 @@ public function getType() /** * Sets type * - * @param \Algolia\AlgoliaSearch\Model\SynonymType $type type + * @param \Algolia\AlgoliaSearch\Model\Search\SynonymType $type type * * @return self */ @@ -427,7 +427,7 @@ public function setReplacements($replacements) /** * Gets highlightResult * - * @return \Algolia\AlgoliaSearch\Model\SynonymHitHighlightResult|null + * @return \Algolia\AlgoliaSearch\Model\Search\SynonymHitHighlightResult|null */ public function getHighlightResult() { @@ -437,7 +437,7 @@ public function getHighlightResult() /** * Sets highlightResult * - * @param \Algolia\AlgoliaSearch\Model\SynonymHitHighlightResult|null $highlightResult highlightResult + * @param \Algolia\AlgoliaSearch\Model\Search\SynonymHitHighlightResult|null $highlightResult highlightResult * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php b/clients/algoliasearch-client-php/lib/Model/Search/SynonymHitHighlightResult.php similarity index 92% rename from clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php rename to clients/algoliasearch-client-php/lib/Model/Search/SynonymHitHighlightResult.php index fa78b4ce36..669a114dea 100644 --- a/clients/algoliasearch-client-php/lib/Model/SynonymHitHighlightResult.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SynonymHitHighlightResult.php @@ -1,6 +1,6 @@ '\Algolia\AlgoliaSearch\Model\HighlightResult', - 'synonyms' => '\Algolia\AlgoliaSearch\Model\HighlightResult[]', + 'type' => '\Algolia\AlgoliaSearch\Model\Search\HighlightResult', + 'synonyms' => '\Algolia\AlgoliaSearch\Model\Search\HighlightResult[]', ]; /** @@ -186,7 +186,7 @@ public function valid() /** * Gets type * - * @return \Algolia\AlgoliaSearch\Model\HighlightResult|null + * @return \Algolia\AlgoliaSearch\Model\Search\HighlightResult|null */ public function getType() { @@ -196,7 +196,7 @@ public function getType() /** * Sets type * - * @param \Algolia\AlgoliaSearch\Model\HighlightResult|null $type type + * @param \Algolia\AlgoliaSearch\Model\Search\HighlightResult|null $type type * * @return self */ @@ -210,7 +210,7 @@ public function setType($type) /** * Gets synonyms * - * @return \Algolia\AlgoliaSearch\Model\HighlightResult[]|null + * @return \Algolia\AlgoliaSearch\Model\Search\HighlightResult[]|null */ public function getSynonyms() { @@ -220,7 +220,7 @@ public function getSynonyms() /** * Sets synonyms * - * @param \Algolia\AlgoliaSearch\Model\HighlightResult[]|null $synonyms synonyms + * @param \Algolia\AlgoliaSearch\Model\Search\HighlightResult[]|null $synonyms synonyms * * @return self */ diff --git a/clients/algoliasearch-client-php/lib/Model/SynonymType.php b/clients/algoliasearch-client-php/lib/Model/Search/SynonymType.php similarity index 94% rename from clients/algoliasearch-client-php/lib/Model/SynonymType.php rename to clients/algoliasearch-client-php/lib/Model/Search/SynonymType.php index 15deac79dc..c3e816b217 100644 --- a/clients/algoliasearch-client-php/lib/Model/SynonymType.php +++ b/clients/algoliasearch-client-php/lib/Model/Search/SynonymType.php @@ -1,6 +1,6 @@ Date: Thu, 3 Feb 2022 14:58:25 +0100 Subject: [PATCH 20/26] fix: use global ModelInterface to avoid errors in CI --- .../lib/ModelInterface.php | 68 +++++++++++++++++++ .../lib/ObjectSerializer.php | 2 - openapitools.json | 28 ++++++-- templates/php/ObjectSerializer.mustache | 2 +- 4 files changed, 92 insertions(+), 8 deletions(-) create mode 100644 clients/algoliasearch-client-php/lib/ModelInterface.php diff --git a/clients/algoliasearch-client-php/lib/ModelInterface.php b/clients/algoliasearch-client-php/lib/ModelInterface.php new file mode 100644 index 0000000000..a9505a67e5 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/ModelInterface.php @@ -0,0 +1,68 @@ + Date: Thu, 3 Feb 2022 15:48:40 +0100 Subject: [PATCH 21/26] fix: CTS CI --- scripts/formatter.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/formatter.sh b/scripts/formatter.sh index c1bdc22b63..36d531698b 100755 --- a/scripts/formatter.sh +++ b/scripts/formatter.sh @@ -10,6 +10,11 @@ cd ${DIR}/.. LANGUAGE=$1 FOLDER=$2 +if [[ ! -d "$FOLDER"]]; then + echo "Output dolder does not exist for $LANGUAGE, skipping..." + exit 0 +fi + if [[ $LANGUAGE == 'javascript' ]]; then # jsdoc/require-hyphen-before-param-description fails to lint more than # 6 parameters, we re-run the script if failed to lint the rest From df509f87a30a09a183f42245f2db9826c9722e59 Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Thu, 3 Feb 2022 15:50:30 +0100 Subject: [PATCH 22/26] fix: typo --- scripts/formatter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/formatter.sh b/scripts/formatter.sh index 36d531698b..dc123f7504 100755 --- a/scripts/formatter.sh +++ b/scripts/formatter.sh @@ -11,7 +11,7 @@ LANGUAGE=$1 FOLDER=$2 if [[ ! -d "$FOLDER"]]; then - echo "Output dolder does not exist for $LANGUAGE, skipping..." + echo "Output folder does not exist for $LANGUAGE, skipping..." exit 0 fi From fc9dd801594b943a27b976c7eed890cc80f2e11f Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Thu, 3 Feb 2022 16:00:52 +0100 Subject: [PATCH 23/26] fix: CI --- scripts/formatter.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/formatter.sh b/scripts/formatter.sh index dc123f7504..402383a40a 100755 --- a/scripts/formatter.sh +++ b/scripts/formatter.sh @@ -10,7 +10,7 @@ cd ${DIR}/.. LANGUAGE=$1 FOLDER=$2 -if [[ ! -d "$FOLDER"]]; then +if [[ ! -d "$FOLDER" ]]; then echo "Output folder does not exist for $LANGUAGE, skipping..." exit 0 fi From da8d8202a8b61198e50b0073013f6dfaf4be2fa9 Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Thu, 3 Feb 2022 16:34:33 +0100 Subject: [PATCH 24/26] fix: changes after review --- .../.php-cs-fixer.php | 2 +- .../lib/Api/AbtestingApi.php | 4 +- .../lib/Api/AnalyticsApi.php | 178 +++++++++--------- .../lib/Api/SearchApi.php | 54 +++--- templates/php/.php-cs-fixer.php | 2 +- templates/php/api.mustache | 2 +- 6 files changed, 121 insertions(+), 121 deletions(-) diff --git a/clients/algoliasearch-client-php/.php-cs-fixer.php b/clients/algoliasearch-client-php/.php-cs-fixer.php index 96dde31c05..90c95dcf68 100644 --- a/clients/algoliasearch-client-php/.php-cs-fixer.php +++ b/clients/algoliasearch-client-php/.php-cs-fixer.php @@ -22,7 +22,7 @@ 'no_multiline_whitespace_around_double_arrow' => true, 'no_short_bool_cast' => true, 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => false, + 'no_trailing_whitespace_in_comment' => true, 'no_unneeded_control_parentheses' => true, 'no_unreachable_default_argument_value' => true, 'no_unused_imports' => true, diff --git a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php index 6ff4763cc2..87dd265bcc 100644 --- a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php +++ b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php @@ -266,7 +266,7 @@ public function listABTests($offset = 0, $limit = 10) $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($offset !== null) { if ('form' === 'form' && is_array($offset)) { foreach ($offset as $key => $value) { @@ -276,7 +276,7 @@ public function listABTests($offset = 0, $limit = 10) $queryParams['offset'] = $offset; } } - // query params + if ($limit !== null) { if ('form' === 'form' && is_array($limit)) { foreach ($limit as $key => $value) { diff --git a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php index cb5a55318b..60878350d2 100644 --- a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php @@ -128,7 +128,7 @@ public function getAverageClickPosition($index, $startDate = null, $endDate = nu $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -138,7 +138,7 @@ public function getAverageClickPosition($index, $startDate = null, $endDate = nu $queryParams['index'] = $index; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -148,7 +148,7 @@ public function getAverageClickPosition($index, $startDate = null, $endDate = nu $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -158,7 +158,7 @@ public function getAverageClickPosition($index, $startDate = null, $endDate = nu $queryParams['endDate'] = $endDate; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -223,7 +223,7 @@ public function getClickPositions($index, $startDate = null, $endDate = null, $t $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -233,7 +233,7 @@ public function getClickPositions($index, $startDate = null, $endDate = null, $t $queryParams['index'] = $index; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -243,7 +243,7 @@ public function getClickPositions($index, $startDate = null, $endDate = null, $t $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -253,7 +253,7 @@ public function getClickPositions($index, $startDate = null, $endDate = null, $t $queryParams['endDate'] = $endDate; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -318,7 +318,7 @@ public function getClickThroughRate($index, $startDate = null, $endDate = null, $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -328,7 +328,7 @@ public function getClickThroughRate($index, $startDate = null, $endDate = null, $queryParams['index'] = $index; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -338,7 +338,7 @@ public function getClickThroughRate($index, $startDate = null, $endDate = null, $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -348,7 +348,7 @@ public function getClickThroughRate($index, $startDate = null, $endDate = null, $queryParams['endDate'] = $endDate; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -413,7 +413,7 @@ public function getConversationRate($index, $startDate = null, $endDate = null, $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -423,7 +423,7 @@ public function getConversationRate($index, $startDate = null, $endDate = null, $queryParams['index'] = $index; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -433,7 +433,7 @@ public function getConversationRate($index, $startDate = null, $endDate = null, $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -443,7 +443,7 @@ public function getConversationRate($index, $startDate = null, $endDate = null, $queryParams['endDate'] = $endDate; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -508,7 +508,7 @@ public function getNoClickRate($index, $startDate = null, $endDate = null, $tags $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -518,7 +518,7 @@ public function getNoClickRate($index, $startDate = null, $endDate = null, $tags $queryParams['index'] = $index; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -528,7 +528,7 @@ public function getNoClickRate($index, $startDate = null, $endDate = null, $tags $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -538,7 +538,7 @@ public function getNoClickRate($index, $startDate = null, $endDate = null, $tags $queryParams['endDate'] = $endDate; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -603,7 +603,7 @@ public function getNoResultsRate($index, $startDate = null, $endDate = null, $ta $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -613,7 +613,7 @@ public function getNoResultsRate($index, $startDate = null, $endDate = null, $ta $queryParams['index'] = $index; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -623,7 +623,7 @@ public function getNoResultsRate($index, $startDate = null, $endDate = null, $ta $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -633,7 +633,7 @@ public function getNoResultsRate($index, $startDate = null, $endDate = null, $ta $queryParams['endDate'] = $endDate; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -698,7 +698,7 @@ public function getSearchesCount($index, $startDate = null, $endDate = null, $ta $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -708,7 +708,7 @@ public function getSearchesCount($index, $startDate = null, $endDate = null, $ta $queryParams['index'] = $index; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -718,7 +718,7 @@ public function getSearchesCount($index, $startDate = null, $endDate = null, $ta $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -728,7 +728,7 @@ public function getSearchesCount($index, $startDate = null, $endDate = null, $ta $queryParams['endDate'] = $endDate; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -795,7 +795,7 @@ public function getSearchesNoClicks($index, $startDate = null, $endDate = null, $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -805,7 +805,7 @@ public function getSearchesNoClicks($index, $startDate = null, $endDate = null, $queryParams['index'] = $index; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -815,7 +815,7 @@ public function getSearchesNoClicks($index, $startDate = null, $endDate = null, $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -825,7 +825,7 @@ public function getSearchesNoClicks($index, $startDate = null, $endDate = null, $queryParams['endDate'] = $endDate; } } - // query params + if ($limit !== null) { if ('form' === 'form' && is_array($limit)) { foreach ($limit as $key => $value) { @@ -835,7 +835,7 @@ public function getSearchesNoClicks($index, $startDate = null, $endDate = null, $queryParams['limit'] = $limit; } } - // query params + if ($offset !== null) { if ('form' === 'form' && is_array($offset)) { foreach ($offset as $key => $value) { @@ -845,7 +845,7 @@ public function getSearchesNoClicks($index, $startDate = null, $endDate = null, $queryParams['offset'] = $offset; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -912,7 +912,7 @@ public function getSearchesNoResults($index, $startDate = null, $endDate = null, $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -922,7 +922,7 @@ public function getSearchesNoResults($index, $startDate = null, $endDate = null, $queryParams['index'] = $index; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -932,7 +932,7 @@ public function getSearchesNoResults($index, $startDate = null, $endDate = null, $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -942,7 +942,7 @@ public function getSearchesNoResults($index, $startDate = null, $endDate = null, $queryParams['endDate'] = $endDate; } } - // query params + if ($limit !== null) { if ('form' === 'form' && is_array($limit)) { foreach ($limit as $key => $value) { @@ -952,7 +952,7 @@ public function getSearchesNoResults($index, $startDate = null, $endDate = null, $queryParams['limit'] = $limit; } } - // query params + if ($offset !== null) { if ('form' === 'form' && is_array($offset)) { foreach ($offset as $key => $value) { @@ -962,7 +962,7 @@ public function getSearchesNoResults($index, $startDate = null, $endDate = null, $queryParams['offset'] = $offset; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -1017,7 +1017,7 @@ public function getStatus($index) $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -1084,7 +1084,7 @@ public function getTopCountries($index, $startDate = null, $endDate = null, $lim $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -1094,7 +1094,7 @@ public function getTopCountries($index, $startDate = null, $endDate = null, $lim $queryParams['index'] = $index; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -1104,7 +1104,7 @@ public function getTopCountries($index, $startDate = null, $endDate = null, $lim $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -1114,7 +1114,7 @@ public function getTopCountries($index, $startDate = null, $endDate = null, $lim $queryParams['endDate'] = $endDate; } } - // query params + if ($limit !== null) { if ('form' === 'form' && is_array($limit)) { foreach ($limit as $key => $value) { @@ -1124,7 +1124,7 @@ public function getTopCountries($index, $startDate = null, $endDate = null, $lim $queryParams['limit'] = $limit; } } - // query params + if ($offset !== null) { if ('form' === 'form' && is_array($offset)) { foreach ($offset as $key => $value) { @@ -1134,7 +1134,7 @@ public function getTopCountries($index, $startDate = null, $endDate = null, $lim $queryParams['offset'] = $offset; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -1202,7 +1202,7 @@ public function getTopFilterAttributes($index, $search = null, $startDate = null $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -1212,7 +1212,7 @@ public function getTopFilterAttributes($index, $search = null, $startDate = null $queryParams['index'] = $index; } } - // query params + if ($search !== null) { if ('form' === 'form' && is_array($search)) { foreach ($search as $key => $value) { @@ -1222,7 +1222,7 @@ public function getTopFilterAttributes($index, $search = null, $startDate = null $queryParams['search'] = $search; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -1232,7 +1232,7 @@ public function getTopFilterAttributes($index, $search = null, $startDate = null $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -1242,7 +1242,7 @@ public function getTopFilterAttributes($index, $search = null, $startDate = null $queryParams['endDate'] = $endDate; } } - // query params + if ($limit !== null) { if ('form' === 'form' && is_array($limit)) { foreach ($limit as $key => $value) { @@ -1252,7 +1252,7 @@ public function getTopFilterAttributes($index, $search = null, $startDate = null $queryParams['limit'] = $limit; } } - // query params + if ($offset !== null) { if ('form' === 'form' && is_array($offset)) { foreach ($offset as $key => $value) { @@ -1262,7 +1262,7 @@ public function getTopFilterAttributes($index, $search = null, $startDate = null $queryParams['offset'] = $offset; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -1337,7 +1337,7 @@ public function getTopFilterForAttribute($attribute, $index, $search = null, $st $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -1347,7 +1347,7 @@ public function getTopFilterForAttribute($attribute, $index, $search = null, $st $queryParams['index'] = $index; } } - // query params + if ($search !== null) { if ('form' === 'form' && is_array($search)) { foreach ($search as $key => $value) { @@ -1357,7 +1357,7 @@ public function getTopFilterForAttribute($attribute, $index, $search = null, $st $queryParams['search'] = $search; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -1367,7 +1367,7 @@ public function getTopFilterForAttribute($attribute, $index, $search = null, $st $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -1377,7 +1377,7 @@ public function getTopFilterForAttribute($attribute, $index, $search = null, $st $queryParams['endDate'] = $endDate; } } - // query params + if ($limit !== null) { if ('form' === 'form' && is_array($limit)) { foreach ($limit as $key => $value) { @@ -1387,7 +1387,7 @@ public function getTopFilterForAttribute($attribute, $index, $search = null, $st $queryParams['limit'] = $limit; } } - // query params + if ($offset !== null) { if ('form' === 'form' && is_array($offset)) { foreach ($offset as $key => $value) { @@ -1397,7 +1397,7 @@ public function getTopFilterForAttribute($attribute, $index, $search = null, $st $queryParams['offset'] = $offset; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -1473,7 +1473,7 @@ public function getTopFiltersNoResults($index, $search = null, $startDate = null $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -1483,7 +1483,7 @@ public function getTopFiltersNoResults($index, $search = null, $startDate = null $queryParams['index'] = $index; } } - // query params + if ($search !== null) { if ('form' === 'form' && is_array($search)) { foreach ($search as $key => $value) { @@ -1493,7 +1493,7 @@ public function getTopFiltersNoResults($index, $search = null, $startDate = null $queryParams['search'] = $search; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -1503,7 +1503,7 @@ public function getTopFiltersNoResults($index, $search = null, $startDate = null $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -1513,7 +1513,7 @@ public function getTopFiltersNoResults($index, $search = null, $startDate = null $queryParams['endDate'] = $endDate; } } - // query params + if ($limit !== null) { if ('form' === 'form' && is_array($limit)) { foreach ($limit as $key => $value) { @@ -1523,7 +1523,7 @@ public function getTopFiltersNoResults($index, $search = null, $startDate = null $queryParams['limit'] = $limit; } } - // query params + if ($offset !== null) { if ('form' === 'form' && is_array($offset)) { foreach ($offset as $key => $value) { @@ -1533,7 +1533,7 @@ public function getTopFiltersNoResults($index, $search = null, $startDate = null $queryParams['offset'] = $offset; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -1602,7 +1602,7 @@ public function getTopHits($index, $search = null, $clickAnalytics = false, $sta $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -1612,7 +1612,7 @@ public function getTopHits($index, $search = null, $clickAnalytics = false, $sta $queryParams['index'] = $index; } } - // query params + if ($search !== null) { if ('form' === 'form' && is_array($search)) { foreach ($search as $key => $value) { @@ -1622,7 +1622,7 @@ public function getTopHits($index, $search = null, $clickAnalytics = false, $sta $queryParams['search'] = $search; } } - // query params + if ($clickAnalytics !== null) { if ('form' === 'form' && is_array($clickAnalytics)) { foreach ($clickAnalytics as $key => $value) { @@ -1632,7 +1632,7 @@ public function getTopHits($index, $search = null, $clickAnalytics = false, $sta $queryParams['clickAnalytics'] = $clickAnalytics; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -1642,7 +1642,7 @@ public function getTopHits($index, $search = null, $clickAnalytics = false, $sta $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -1652,7 +1652,7 @@ public function getTopHits($index, $search = null, $clickAnalytics = false, $sta $queryParams['endDate'] = $endDate; } } - // query params + if ($limit !== null) { if ('form' === 'form' && is_array($limit)) { foreach ($limit as $key => $value) { @@ -1662,7 +1662,7 @@ public function getTopHits($index, $search = null, $clickAnalytics = false, $sta $queryParams['limit'] = $limit; } } - // query params + if ($offset !== null) { if ('form' === 'form' && is_array($offset)) { foreach ($offset as $key => $value) { @@ -1672,7 +1672,7 @@ public function getTopHits($index, $search = null, $clickAnalytics = false, $sta $queryParams['offset'] = $offset; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -1742,7 +1742,7 @@ public function getTopSearches($index, $clickAnalytics = false, $startDate = nul $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -1752,7 +1752,7 @@ public function getTopSearches($index, $clickAnalytics = false, $startDate = nul $queryParams['index'] = $index; } } - // query params + if ($clickAnalytics !== null) { if ('form' === 'form' && is_array($clickAnalytics)) { foreach ($clickAnalytics as $key => $value) { @@ -1762,7 +1762,7 @@ public function getTopSearches($index, $clickAnalytics = false, $startDate = nul $queryParams['clickAnalytics'] = $clickAnalytics; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -1772,7 +1772,7 @@ public function getTopSearches($index, $clickAnalytics = false, $startDate = nul $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -1782,7 +1782,7 @@ public function getTopSearches($index, $clickAnalytics = false, $startDate = nul $queryParams['endDate'] = $endDate; } } - // query params + if ($orderBy !== null) { if ('form' === 'form' && is_array($orderBy)) { foreach ($orderBy as $key => $value) { @@ -1792,7 +1792,7 @@ public function getTopSearches($index, $clickAnalytics = false, $startDate = nul $queryParams['orderBy'] = $orderBy; } } - // query params + if ($direction !== null) { if ('form' === 'form' && is_array($direction)) { foreach ($direction as $key => $value) { @@ -1802,7 +1802,7 @@ public function getTopSearches($index, $clickAnalytics = false, $startDate = nul $queryParams['direction'] = $direction; } } - // query params + if ($limit !== null) { if ('form' === 'form' && is_array($limit)) { foreach ($limit as $key => $value) { @@ -1812,7 +1812,7 @@ public function getTopSearches($index, $clickAnalytics = false, $startDate = nul $queryParams['limit'] = $limit; } } - // query params + if ($offset !== null) { if ('form' === 'form' && is_array($offset)) { foreach ($offset as $key => $value) { @@ -1822,7 +1822,7 @@ public function getTopSearches($index, $clickAnalytics = false, $startDate = nul $queryParams['offset'] = $offset; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { @@ -1887,7 +1887,7 @@ public function getUsersCount($index, $startDate = null, $endDate = null, $tags $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($index !== null) { if ('form' === 'form' && is_array($index)) { foreach ($index as $key => $value) { @@ -1897,7 +1897,7 @@ public function getUsersCount($index, $startDate = null, $endDate = null, $tags $queryParams['index'] = $index; } } - // query params + if ($startDate !== null) { if ('form' === 'form' && is_array($startDate)) { foreach ($startDate as $key => $value) { @@ -1907,7 +1907,7 @@ public function getUsersCount($index, $startDate = null, $endDate = null, $tags $queryParams['startDate'] = $startDate; } } - // query params + if ($endDate !== null) { if ('form' === 'form' && is_array($endDate)) { foreach ($endDate as $key => $value) { @@ -1917,7 +1917,7 @@ public function getUsersCount($index, $startDate = null, $endDate = null, $tags $queryParams['endDate'] = $endDate; } } - // query params + if ($tags !== null) { if ('form' === 'form' && is_array($tags)) { foreach ($tags as $key => $value) { diff --git a/clients/algoliasearch-client-php/lib/Api/SearchApi.php b/clients/algoliasearch-client-php/lib/Api/SearchApi.php index 7813c157cc..b4bc542349 100644 --- a/clients/algoliasearch-client-php/lib/Api/SearchApi.php +++ b/clients/algoliasearch-client-php/lib/Api/SearchApi.php @@ -304,7 +304,7 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdParams) $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($xAlgoliaUserID !== null) { if ('form' === 'form' && is_array($xAlgoliaUserID)) { foreach ($xAlgoliaUserID as $key => $value) { @@ -436,7 +436,7 @@ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsParams) $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($xAlgoliaUserID !== null) { if ('form' === 'form' && is_array($xAlgoliaUserID)) { foreach ($xAlgoliaUserID as $key => $value) { @@ -566,7 +566,7 @@ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearE $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($forwardToReplicas !== null) { if ('form' === 'form' && is_array($forwardToReplicas)) { foreach ($forwardToReplicas as $key => $value) { @@ -576,7 +576,7 @@ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearE $queryParams['forwardToReplicas'] = $forwardToReplicas; } } - // query params + if ($clearExistingRules !== null) { if ('form' === 'form' && is_array($clearExistingRules)) { foreach ($clearExistingRules as $key => $value) { @@ -700,7 +700,7 @@ public function clearAllSynonyms($indexName, $forwardToReplicas = null) $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($forwardToReplicas !== null) { if ('form' === 'form' && is_array($forwardToReplicas)) { foreach ($forwardToReplicas as $key => $value) { @@ -817,7 +817,7 @@ public function clearRules($indexName, $forwardToReplicas = null) $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($forwardToReplicas !== null) { if ('form' === 'form' && is_array($forwardToReplicas)) { foreach ($forwardToReplicas as $key => $value) { @@ -1125,7 +1125,7 @@ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($forwardToReplicas !== null) { if ('form' === 'form' && is_array($forwardToReplicas)) { foreach ($forwardToReplicas as $key => $value) { @@ -1257,7 +1257,7 @@ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($forwardToReplicas !== null) { if ('form' === 'form' && is_array($forwardToReplicas)) { foreach ($forwardToReplicas as $key => $value) { @@ -1455,7 +1455,7 @@ public function getLogs($offset = 0, $length = 10, $indexName = 'null', $type = $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($offset !== null) { if ('form' === 'form' && is_array($offset)) { foreach ($offset as $key => $value) { @@ -1465,7 +1465,7 @@ public function getLogs($offset = 0, $length = 10, $indexName = 'null', $type = $queryParams['offset'] = $offset; } } - // query params + if ($length !== null) { if ('form' === 'form' && is_array($length)) { foreach ($length as $key => $value) { @@ -1475,7 +1475,7 @@ public function getLogs($offset = 0, $length = 10, $indexName = 'null', $type = $queryParams['length'] = $length; } } - // query params + if ($indexName !== null) { if ('form' === 'form' && is_array($indexName)) { foreach ($indexName as $key => $value) { @@ -1485,7 +1485,7 @@ public function getLogs($offset = 0, $length = 10, $indexName = 'null', $type = $queryParams['indexName'] = $indexName; } } - // query params + if ($type !== null) { if ('form' === 'form' && is_array($type)) { foreach ($type as $key => $value) { @@ -1548,7 +1548,7 @@ public function getObject($indexName, $objectID, $attributesToRetrieve = null) $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($attributesToRetrieve !== null) { if ('form' === 'form' && is_array($attributesToRetrieve)) { foreach ($attributesToRetrieve as $key => $value) { @@ -2047,7 +2047,7 @@ public function hasPendingMappings($getClusters = null) $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($getClusters !== null) { if ('form' === 'form' && is_array($getClusters)) { foreach ($getClusters as $key => $value) { @@ -2169,7 +2169,7 @@ public function listIndices($page = null) $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($page !== null) { if ('form' === 'form' && is_array($page)) { foreach ($page as $key => $value) { @@ -2218,7 +2218,7 @@ public function listUserIds($page = null, $hitsPerPage = 100) $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($page !== null) { if ('form' === 'form' && is_array($page)) { foreach ($page as $key => $value) { @@ -2228,7 +2228,7 @@ public function listUserIds($page = null, $hitsPerPage = 100) $queryParams['page'] = $page; } } - // query params + if ($hitsPerPage !== null) { if ('form' === 'form' && is_array($hitsPerPage)) { foreach ($hitsPerPage as $key => $value) { @@ -2457,7 +2457,7 @@ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuiltInOp $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($createIfNotExists !== null) { if ('form' === 'form' && is_array($createIfNotExists)) { foreach ($createIfNotExists as $key => $value) { @@ -2766,7 +2766,7 @@ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($forwardToReplicas !== null) { if ('form' === 'form' && is_array($forwardToReplicas)) { foreach ($forwardToReplicas as $key => $value) { @@ -2855,7 +2855,7 @@ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplic $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($forwardToReplicas !== null) { if ('form' === 'form' && is_array($forwardToReplicas)) { foreach ($forwardToReplicas as $key => $value) { @@ -2938,7 +2938,7 @@ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($forwardToReplicas !== null) { if ('form' === 'form' && is_array($forwardToReplicas)) { foreach ($forwardToReplicas as $key => $value) { @@ -2948,7 +2948,7 @@ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, $queryParams['forwardToReplicas'] = $forwardToReplicas; } } - // query params + if ($replaceExistingSynonyms !== null) { if ('form' === 'form' && is_array($replaceExistingSynonyms)) { foreach ($replaceExistingSynonyms as $key => $value) { @@ -3279,7 +3279,7 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($query !== null) { if ('form' === 'form' && is_array($query)) { foreach ($query as $key => $value) { @@ -3289,7 +3289,7 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $queryParams['query'] = $query; } } - // query params + if ($type !== null) { if ('form' === 'form' && is_array($type)) { foreach ($type as $key => $value) { @@ -3299,7 +3299,7 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $queryParams['type'] = $type; } } - // query params + if ($page !== null) { if ('form' === 'form' && is_array($page)) { foreach ($page as $key => $value) { @@ -3309,7 +3309,7 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $queryParams['page'] = $page; } } - // query params + if ($hitsPerPage !== null) { if ('form' === 'form' && is_array($hitsPerPage)) { foreach ($hitsPerPage as $key => $value) { @@ -3476,7 +3476,7 @@ public function setSettings($indexName, $indexSettings, $forwardToReplicas = nul $queryParams = []; $headerParams = []; $httpBody = []; - // query params + if ($forwardToReplicas !== null) { if ('form' === 'form' && is_array($forwardToReplicas)) { foreach ($forwardToReplicas as $key => $value) { diff --git a/templates/php/.php-cs-fixer.php b/templates/php/.php-cs-fixer.php index 96dde31c05..90c95dcf68 100644 --- a/templates/php/.php-cs-fixer.php +++ b/templates/php/.php-cs-fixer.php @@ -22,7 +22,7 @@ 'no_multiline_whitespace_around_double_arrow' => true, 'no_short_bool_cast' => true, 'no_trailing_whitespace' => true, - 'no_trailing_whitespace_in_comment' => false, + 'no_trailing_whitespace_in_comment' => true, 'no_unneeded_control_parentheses' => true, 'no_unreachable_default_argument_value' => true, 'no_unused_imports' => true, diff --git a/templates/php/api.mustache b/templates/php/api.mustache index f6d0508239..05e03ac165 100644 --- a/templates/php/api.mustache +++ b/templates/php/api.mustache @@ -229,7 +229,7 @@ use {{invokerPackage}}\RetryStrategy\ClusterHosts; $headerParams = []; $httpBody = []; {{#queryParams}} - // query params + {{#isExplode}} if (${{paramName}} !== null) { {{#style}} From 1d69d81fd1398287f6ad598ab4f5786a63f9ab85 Mon Sep 17 00:00:00 2001 From: Damien Couchez Date: Fri, 4 Feb 2022 11:15:47 +0100 Subject: [PATCH 25/26] fix: update CI + remove composer on playground --- .github/workflows/check.yml | 7 - .gitignore | 2 - playground/php/composer.json | 23 - playground/php/composer.lock | 2782 ---------------------- playground/php/src/abtesting.php | 2 +- playground/php/src/analytics.php | 2 +- playground/php/src/insights.php | 2 +- playground/php/src/personalization.php | 2 +- playground/php/src/query-suggestions.php | 2 +- playground/php/src/recommend.php | 2 +- playground/php/src/search.php | 2 +- 11 files changed, 7 insertions(+), 2821 deletions(-) delete mode 100644 playground/php/composer.json delete mode 100644 playground/php/composer.lock diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index fce66406eb..48573bdbf5 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -155,13 +155,6 @@ jobs: language: php spec: ${{ matrix.client.name }} - - name: Cache ${{ matrix.client.name }} client - id: cache - uses: actions/cache@v2 - with: - path: '/home/runner/work/api-clients-automation/api-clients-automation/${{ matrix.client.folder }}/target' - key: ${{ runner.os }}-1-php-client-${{ matrix.client.name }}-${{ hashFiles(format('{0}/**', matrix.client.folder)) }}-${{ hashFiles(format('specs/dist/{0}.yml', matrix.client.name)) }} }} - - name: Generate ${{ matrix.client.name }} client if: steps.cache.outputs.cache-hit != 'true' run: yarn generate php ${{ matrix.client.name }} diff --git a/.gitignore b/.gitignore index 41e0c5588f..154378c78f 100644 --- a/.gitignore +++ b/.gitignore @@ -15,5 +15,3 @@ yarn-error.log target **/.DS_Store - -playground/php/vendor diff --git a/playground/php/composer.json b/playground/php/composer.json deleted file mode 100644 index 64bcd8f5e9..0000000000 --- a/playground/php/composer.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "playground/php", - "require": { - "php": "^7.3 || ^8.0", - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "guzzlehttp/guzzle": "^7.3", - "guzzlehttp/psr7": "^2.0", - "psr/http-message": "^1.0", - "psr/log": "^1.0 || ^2.0 || ^3.0", - "psr/simple-cache": "^1.0 || ^2.0 || ^3.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.12" - }, - "autoload": { - "psr-4": { - "Playground\\Php\\": "src/", - "Algolia\\AlgoliaSearch\\": "../../clients/algoliasearch-client-php/lib/" - } - } -} diff --git a/playground/php/composer.lock b/playground/php/composer.lock deleted file mode 100644 index c94ccf2de2..0000000000 --- a/playground/php/composer.lock +++ /dev/null @@ -1,2782 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "aa1fa6e2e4607e45ceed43e93281a60a", - "packages": [ - { - "name": "guzzlehttp/guzzle", - "version": "7.4.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79", - "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79", - "shasum": "" - }, - "require": { - "ext-json": "*", - "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.8.3 || ^2.1", - "php": "^7.2.5 || ^8.0", - "psr/http-client": "^1.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" - }, - "provide": { - "psr/http-client-implementation": "1.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "ext-curl": "*", - "php-http/client-integration-tests": "^3.0", - "phpunit/phpunit": "^8.5.5 || ^9.3.5", - "psr/log": "^1.1 || ^2.0 || ^3.0" - }, - "suggest": { - "ext-curl": "Required for CURL handler support", - "ext-intl": "Required for Internationalized Domain Name (IDN) support", - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Jeremy Lindblom", - "email": "jeremeamia@gmail.com", - "homepage": "https://github.com/jeremeamia" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "psr-18", - "psr-7", - "rest", - "web service" - ], - "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", - "type": "tidelift" - } - ], - "time": "2021-12-06T18:43:05+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", - "type": "tidelift" - } - ], - "time": "2021-10-22T20:56:57+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "2.1.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "ralouphie/getallheaders": "^3.0" - }, - "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.8 || ^9.3.10" - }, - "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.1.0" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", - "type": "tidelift" - } - ], - "time": "2021-10-06T17:43:30+00:00" - }, - { - "name": "psr/http-client", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", - "keywords": [ - "http", - "http-client", - "psr", - "psr-18" - ], - "support": { - "source": "https://github.com/php-fig/http-client/tree/master" - }, - "time": "2020-06-29T06:28:15+00:00" - }, - { - "name": "psr/http-factory", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "shasum": "" - }, - "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" - }, - "time": "2019-04-30T12:38:16+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/master" - }, - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "psr/log", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" - }, - "time": "2021-07-14T16:46:02+00:00" - }, - { - "name": "psr/simple-cache", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", - "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\SimpleCache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interfaces for simple caching", - "keywords": [ - "cache", - "caching", - "psr", - "psr-16", - "simple-cache" - ], - "support": { - "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" - }, - "time": "2021-10-29T13:26:27+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "time": "2019-03-08T08:55:37+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", - "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", - "shasum": "" - }, - "require": { - "php": ">=8.0.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-01T23:48:49+00:00" - } - ], - "packages-dev": [ - { - "name": "composer/pcre", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.1" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-01-21T20:24:37+00:00" - }, - { - "name": "composer/semver", - "version": "3.2.7", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "deac27056b57e46faf136fae7b449eeaa71661ee" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/deac27056b57e46faf136fae7b449eeaa71661ee", - "reference": "deac27056b57e46faf136fae7b449eeaa71661ee", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.54", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.7" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-01-04T09:57:54+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", - "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", - "shasum": "" - }, - "require": { - "composer/pcre": "^1", - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.4" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-01-04T17:06:45+00:00" - }, - { - "name": "doctrine/annotations", - "version": "1.13.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.2" - }, - "time": "2021-08-05T19:00:23+00:00" - }, - { - "name": "doctrine/lexer", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", - "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.2" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" - } - ], - "time": "2022-01-12T08:27:12+00:00" - }, - { - "name": "friendsofphp/php-cs-fixer", - "version": "v2.19.3", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/75ac86f33fab4714ea5a39a396784d83ae3b5ed8", - "reference": "75ac86f33fab4714ea5a39a396784d83ae3b5ed8", - "shasum": "" - }, - "require": { - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.2 || ^2.0", - "doctrine/annotations": "^1.2", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^5.6 || ^7.0 || ^8.0", - "php-cs-fixer/diff": "^1.3", - "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", - "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^3.0 || ^4.0 || ^5.0", - "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", - "symfony/polyfill-php70": "^1.0", - "symfony/polyfill-php72": "^1.4", - "symfony/process": "^3.0 || ^4.0 || ^5.0", - "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" - }, - "require-dev": { - "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.4", - "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.4.2", - "php-cs-fixer/accessible-object": "^1.0", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", - "phpunitgoodpractices/polyfill": "^1.5", - "phpunitgoodpractices/traits": "^1.9.1", - "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", - "symfony/phpunit-bridge": "^5.2.1", - "symfony/yaml": "^3.0 || ^4.0 || ^5.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters.", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", - "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." - }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", - "extra": { - "branch-alias": { - "dev-master": "2.19-dev" - } - }, - "autoload": { - "psr-4": { - "PhpCsFixer\\": "src/" - }, - "classmap": [ - "tests/Test/AbstractFixerTestCase.php", - "tests/Test/AbstractIntegrationCaseFactory.php", - "tests/Test/AbstractIntegrationTestCase.php", - "tests/Test/Assert/AssertTokensTrait.php", - "tests/Test/IntegrationCase.php", - "tests/Test/IntegrationCaseFactory.php", - "tests/Test/IntegrationCaseFactoryInterface.php", - "tests/Test/InternalIntegrationCaseFactory.php", - "tests/Test/IsIdenticalConstraint.php", - "tests/Test/TokensWithObservedTransformers.php", - "tests/TestCase.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "support": { - "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v2.19.3" - }, - "funding": [ - { - "url": "https://github.com/keradus", - "type": "github" - } - ], - "time": "2021-11-15T17:17:55+00:00" - }, - { - "name": "php-cs-fixer/diff", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/dbd31aeb251639ac0b9e7e29405c1441907f5759", - "reference": "dbd31aeb251639ac0b9e7e29405c1441907f5759", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "SpacePossum" - } - ], - "description": "sebastian/diff v2 backport support for PHP5.6", - "homepage": "https://github.com/PHP-CS-Fixer", - "keywords": [ - "diff" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v1.3.1" - }, - "time": "2020-10-14T08:39:05+00:00" - }, - { - "name": "psr/cache", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ], - "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" - }, - "time": "2021-02-03T23:26:27+00:00" - }, - { - "name": "psr/container", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" - }, - "time": "2021-11-05T16:50:12+00:00" - }, - { - "name": "psr/event-dispatcher", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\EventDispatcher\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" - }, - "time": "2019-01-08T18:20:26+00:00" - }, - { - "name": "symfony/console", - "version": "v5.2.11", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "2f93c8c64295e029b7ff4d68b9a59c5ad8b7e24a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/2f93c8c64295e029b7ff4d68b9a59c5ad8b7e24a", - "reference": "2f93c8c64295e029b7ff4d68b9a59c5ad8b7e24a", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", - "symfony/service-contracts": "^1.1|^2", - "symfony/string": "^5.1" - }, - "conflict": { - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v5.2.11" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-06-06T09:50:27+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v5.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/27d39ae126352b9fa3be5e196ccf4617897be3eb", - "reference": "27d39ae126352b9fa3be5e196ccf4617897be3eb", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/event-dispatcher-contracts": "^2|^3", - "symfony/polyfill-php80": "^1.16" - }, - "conflict": { - "symfony/dependency-injection": "<4.4" - }, - "provide": { - "psr/event-dispatcher-implementation": "1.0", - "symfony/event-dispatcher-implementation": "2.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/expression-language": "^4.4|^5.0|^6.0", - "symfony/http-foundation": "^4.4|^5.0|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^4.4|^5.0|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-23T10:19:22+00:00" - }, - { - "name": "symfony/event-dispatcher-contracts", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "aa5422287b75594b90ee9cd807caf8f0df491385" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/aa5422287b75594b90ee9cd807caf8f0df491385", - "reference": "aa5422287b75594b90ee9cd807caf8f0df491385", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "psr/event-dispatcher": "^1" - }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to dispatching event", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-07-15T12:33:35+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v5.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/731f917dc31edcffec2c6a777f3698c33bea8f01", - "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-10-28T13:39:27+00:00" - }, - { - "name": "symfony/finder", - "version": "v5.4.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "e77046c252be48c48a40816187ed527703c8f76c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/e77046c252be48c48a40816187ed527703c8f76c", - "reference": "e77046c252be48c48a40816187ed527703c8f76c", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-12-15T11:06:13+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v5.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "b0fb78576487af19c500aaddb269fd36701d4847" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/b0fb78576487af19c500aaddb269fd36701d4847", - "reference": "b0fb78576487af19c500aaddb269fd36701d4847", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php73": "~1.0", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an improved replacement for the array_replace PHP function", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-23T10:19:22+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.24.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-10-20T20:35:02+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.24.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.24.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-23T21:10:46+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.24.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.24.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-02-19T12:13:01+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.24.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-30T18:21:41+00:00" - }, - { - "name": "symfony/polyfill-php70", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/5f03a781d984aae42cebd18e7912fa80f02ee644", - "reference": "5f03a781d984aae42cebd18e7912fa80f02ee644", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "metapackage", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php70/tree/v1.20.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.24.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-05-27T09:17:38+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.24.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-06-05T21:20:04+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.24.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", - "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-09-13T13:58:33+00:00" - }, - { - "name": "symfony/process", - "version": "v5.4.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "2b3ba8722c4aaf3e88011be5e7f48710088fb5e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/2b3ba8722c4aaf3e88011be5e7f48710088fb5e4", - "reference": "2b3ba8722c4aaf3e88011be5e7f48710088fb5e4", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v5.4.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-12-27T21:01:00+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v2.4.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "d664541b99d6fb0247ec5ff32e87238582236204" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d664541b99d6fb0247ec5ff32e87238582236204", - "reference": "d664541b99d6fb0247ec5ff32e87238582236204", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "psr/container": "^1.1" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.4.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-04T16:37:19+00:00" - }, - { - "name": "symfony/stopwatch", - "version": "v5.4.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/208ef96122bfed82a8f3a61458a07113a08bdcfe", - "reference": "208ef96122bfed82a8f3a61458a07113a08bdcfe", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/service-contracts": "^1|^2|^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides a way to profile code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-23T10:19:22+00:00" - }, - { - "name": "symfony/string", - "version": "v5.4.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", - "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" - }, - "conflict": { - "symfony/translation-contracts": ">=3.0" - }, - "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "files": [ - "Resources/functions.php" - ], - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v5.4.2" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-12-16T21:52:00+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7.3 || ^8.0", - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*" - }, - "platform-dev": [], - "plugin-api-version": "2.1.0" -} diff --git a/playground/php/src/abtesting.php b/playground/php/src/abtesting.php index bfb6356276..0ed14a1665 100644 --- a/playground/php/src/abtesting.php +++ b/playground/php/src/abtesting.php @@ -1,6 +1,6 @@ Date: Fri, 4 Feb 2022 15:43:55 +0100 Subject: [PATCH 26/26] fix: code cleaning after review --- Dockerfile | 2 +- .../.openapi-generator-ignore | 2 + .../algoliasearch-client-php/lib/Algolia.php | 17 +- .../lib/Api/AbtestingApi.php | 47 +- .../lib/Api/AnalyticsApi.php | 143 +++--- .../lib/Api/InsightsApi.php | 15 +- .../lib/Api/PersonalizationApi.php | 39 +- .../lib/Api/QuerySuggestionsApi.php | 63 ++- .../lib/Api/RecommendApi.php | 15 +- .../lib/Api/SearchApi.php | 463 +++++++++--------- .../lib/Configuration/Configuration.php | 116 ----- .../lib/HeaderSelector.php | 82 ---- .../lib/Http/CurlHttpClient.php | 131 ----- .../lib/ObjectSerializer.php | 20 +- .../lib/RetryStrategy/ClusterHosts.php | 14 - .../lib/Support/Helpers.php | 82 ---- templates/php/Configuration.mustache | 115 +---- templates/php/HeaderSelector.mustache | 81 --- templates/php/ObjectSerializer.mustache | 20 +- templates/php/README.mustache | 148 ------ templates/php/api.mustache | 15 +- templates/php/php_doc_auth_partial.mustache | 23 - 22 files changed, 380 insertions(+), 1273 deletions(-) delete mode 100644 clients/algoliasearch-client-php/lib/HeaderSelector.php delete mode 100644 clients/algoliasearch-client-php/lib/Http/CurlHttpClient.php delete mode 100644 templates/php/HeaderSelector.mustache delete mode 100644 templates/php/README.mustache delete mode 100644 templates/php/php_doc_auth_partial.mustache diff --git a/Dockerfile b/Dockerfile index 485b81436b..a77397c415 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ ENV JAVA_HOME=/usr/lib/jvm/default-jvm ADD https://github.com/google/google-java-format/releases/download/v1.13.0/google-java-format-1.13.0-all-deps.jar /tmp/java-formatter.jar # PHP dependencies -RUN apk add composer php8 php8-tokenizer +RUN apk add -U composer php8 php8-tokenizer WORKDIR /app diff --git a/clients/algoliasearch-client-php/.openapi-generator-ignore b/clients/algoliasearch-client-php/.openapi-generator-ignore index e0b35c13b6..69d2c37844 100644 --- a/clients/algoliasearch-client-php/.openapi-generator-ignore +++ b/clients/algoliasearch-client-php/.openapi-generator-ignore @@ -12,3 +12,5 @@ phpunit.xml.dist README.md git_push.sh .php_cs + +lib/HeaderSelector.php diff --git a/clients/algoliasearch-client-php/lib/Algolia.php b/clients/algoliasearch-client-php/lib/Algolia.php index 12d02e0e5b..91d4adee66 100644 --- a/clients/algoliasearch-client-php/lib/Algolia.php +++ b/clients/algoliasearch-client-php/lib/Algolia.php @@ -10,7 +10,7 @@ final class Algolia { - const VERSION = '0.0.0'; + const VERSION = '1.0.0'; /** * Holds an instance of the simple cache repository (PSR-16). @@ -86,21 +86,8 @@ public static function setLogger(LoggerInterface $logger) public static function getHttpClient() { - $guzzleVersion = null; - if (interface_exists('\GuzzleHttp\ClientInterface')) { - if (defined('\GuzzleHttp\ClientInterface::VERSION')) { - $guzzleVersion = (int) mb_substr(\GuzzleHttp\Client::VERSION, 0, 1); - } else { - $guzzleVersion = \GuzzleHttp\ClientInterface::MAJOR_VERSION; - } - } - if (null === self::$httpClient) { - if (class_exists('\GuzzleHttp\Client') && 6 <= $guzzleVersion) { - self::setHttpClient(new \Algolia\AlgoliaSearch\Http\GuzzleHttpClient()); - } else { - self::setHttpClient(new \Algolia\AlgoliaSearch\Http\CurlHttpClient()); - } + self::setHttpClient(new \Algolia\AlgoliaSearch\Http\GuzzleHttpClient()); } return self::$httpClient; diff --git a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php index 87dd265bcc..cc49fff7c8 100644 --- a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php +++ b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php @@ -4,7 +4,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\AbTestingConfig; -use Algolia\AlgoliaSearch\HeaderSelector; use Algolia\AlgoliaSearch\ObjectSerializer; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; @@ -28,11 +27,6 @@ class AbtestingApi */ protected $config; - /** - * @var HeaderSelector - */ - protected $headerSelector; - /** * @param AbTestingConfig $config * @param ApiWrapperInterface $apiWrapper @@ -42,7 +36,6 @@ public function __construct(ApiWrapperInterface $apiWrapper, AbTestingConfig $co $this->config = $config; $this->api = $apiWrapper; - $this->headerSelector = new HeaderSelector(); } /** @@ -118,10 +111,10 @@ public function addABTests($addABTestsRequest) $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($addABTestsRequest)) { $httpBody = $addABTestsRequest; } @@ -174,10 +167,10 @@ public function deleteABTest($id) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -227,10 +220,10 @@ public function getABTest($id) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -286,10 +279,10 @@ public function listABTests($offset = 0, $limit = 10) $queryParams['limit'] = $limit; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -339,10 +332,10 @@ public function stopABTest($id) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { diff --git a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php index 60878350d2..02b866ba4a 100644 --- a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php @@ -4,7 +4,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\AnalyticsConfig; -use Algolia\AlgoliaSearch\HeaderSelector; use Algolia\AlgoliaSearch\ObjectSerializer; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; @@ -28,11 +27,6 @@ class AnalyticsApi */ protected $config; - /** - * @var HeaderSelector - */ - protected $headerSelector; - /** * @param AnalyticsConfig $config * @param ApiWrapperInterface $apiWrapper @@ -42,7 +36,6 @@ public function __construct(ApiWrapperInterface $apiWrapper, AnalyticsConfig $co $this->config = $config; $this->api = $apiWrapper; - $this->headerSelector = new HeaderSelector(); } /** @@ -168,10 +161,10 @@ public function getAverageClickPosition($index, $startDate = null, $endDate = nu $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -263,10 +256,10 @@ public function getClickPositions($index, $startDate = null, $endDate = null, $t $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -358,10 +351,10 @@ public function getClickThroughRate($index, $startDate = null, $endDate = null, $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -453,10 +446,10 @@ public function getConversationRate($index, $startDate = null, $endDate = null, $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -548,10 +541,10 @@ public function getNoClickRate($index, $startDate = null, $endDate = null, $tags $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -643,10 +636,10 @@ public function getNoResultsRate($index, $startDate = null, $endDate = null, $ta $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -738,10 +731,10 @@ public function getSearchesCount($index, $startDate = null, $endDate = null, $ta $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -855,10 +848,10 @@ public function getSearchesNoClicks($index, $startDate = null, $endDate = null, $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -972,10 +965,10 @@ public function getSearchesNoResults($index, $startDate = null, $endDate = null, $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1027,10 +1020,10 @@ public function getStatus($index) $queryParams['index'] = $index; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1144,10 +1137,10 @@ public function getTopCountries($index, $startDate = null, $endDate = null, $lim $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1272,10 +1265,10 @@ public function getTopFilterAttributes($index, $search = null, $startDate = null $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1415,10 +1408,10 @@ public function getTopFilterForAttribute($attribute, $index, $search = null, $st $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1543,10 +1536,10 @@ public function getTopFiltersNoResults($index, $search = null, $startDate = null $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1682,10 +1675,10 @@ public function getTopHits($index, $search = null, $clickAnalytics = false, $sta $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1832,10 +1825,10 @@ public function getTopSearches($index, $clickAnalytics = false, $startDate = nul $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1927,10 +1920,10 @@ public function getUsersCount($index, $startDate = null, $endDate = null, $tags $queryParams['tags'] = $tags; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { diff --git a/clients/algoliasearch-client-php/lib/Api/InsightsApi.php b/clients/algoliasearch-client-php/lib/Api/InsightsApi.php index 7e6ac367f7..3d6ac06bd4 100644 --- a/clients/algoliasearch-client-php/lib/Api/InsightsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/InsightsApi.php @@ -4,7 +4,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\InsightsConfig; -use Algolia\AlgoliaSearch\HeaderSelector; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; use Algolia\AlgoliaSearch\RetryStrategy\ClusterHosts; @@ -27,11 +26,6 @@ class InsightsApi */ protected $config; - /** - * @var HeaderSelector - */ - protected $headerSelector; - /** * @param InsightsConfig $config * @param ApiWrapperInterface $apiWrapper @@ -41,7 +35,6 @@ public function __construct(ApiWrapperInterface $apiWrapper, InsightsConfig $con $this->config = $config; $this->api = $apiWrapper; - $this->headerSelector = new HeaderSelector(); } /** @@ -117,10 +110,10 @@ public function pushEvents($insightEvents) $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($insightEvents)) { $httpBody = $insightEvents; } diff --git a/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php b/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php index 327dd3d651..4c94a8e159 100644 --- a/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php +++ b/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php @@ -4,7 +4,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\PersonalizationConfig; -use Algolia\AlgoliaSearch\HeaderSelector; use Algolia\AlgoliaSearch\ObjectSerializer; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; @@ -28,11 +27,6 @@ class PersonalizationApi */ protected $config; - /** - * @var HeaderSelector - */ - protected $headerSelector; - /** * @param PersonalizationConfig $config * @param ApiWrapperInterface $apiWrapper @@ -42,7 +36,6 @@ public function __construct(ApiWrapperInterface $apiWrapper, PersonalizationConf $this->config = $config; $this->api = $apiWrapper; - $this->headerSelector = new HeaderSelector(); } /** @@ -126,10 +119,10 @@ public function deleteUserProfile($userToken) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -163,10 +156,10 @@ public function getPersonalizationStrategy() $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -216,10 +209,10 @@ public function getUserTokenProfile($userToken) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -261,10 +254,10 @@ public function setPersonalizationStrategy($personalizationStrategyParams) $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($personalizationStrategyParams)) { $httpBody = $personalizationStrategyParams; } diff --git a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php index d19923e301..91d4035d0f 100644 --- a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php @@ -4,7 +4,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\QuerySuggestionsConfig; -use Algolia\AlgoliaSearch\HeaderSelector; use Algolia\AlgoliaSearch\ObjectSerializer; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; @@ -28,11 +27,6 @@ class QuerySuggestionsApi */ protected $config; - /** - * @var HeaderSelector - */ - protected $headerSelector; - /** * @param QuerySuggestionsConfig $config * @param ApiWrapperInterface $apiWrapper @@ -42,7 +36,6 @@ public function __construct(ApiWrapperInterface $apiWrapper, QuerySuggestionsCon $this->config = $config; $this->api = $apiWrapper; - $this->headerSelector = new HeaderSelector(); } /** @@ -118,10 +111,10 @@ public function createConfig($querySuggestionsIndexWithIndexParam) $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($querySuggestionsIndexWithIndexParam)) { $httpBody = $querySuggestionsIndexWithIndexParam; } @@ -174,10 +167,10 @@ public function deleteConfig($indexName) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -211,10 +204,10 @@ public function getAllConfigs() $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -264,10 +257,10 @@ public function getConfig($indexName) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -317,10 +310,10 @@ public function getConfigStatus($indexName) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -370,10 +363,10 @@ public function getLogFile($indexName) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -430,10 +423,10 @@ public function updateConfig($indexName, $querySuggestionsIndexParam) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($querySuggestionsIndexParam)) { $httpBody = $querySuggestionsIndexParam; } diff --git a/clients/algoliasearch-client-php/lib/Api/RecommendApi.php b/clients/algoliasearch-client-php/lib/Api/RecommendApi.php index 57d2f64716..a23c1a4d25 100644 --- a/clients/algoliasearch-client-php/lib/Api/RecommendApi.php +++ b/clients/algoliasearch-client-php/lib/Api/RecommendApi.php @@ -4,7 +4,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\RecommendConfig; -use Algolia\AlgoliaSearch\HeaderSelector; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; use Algolia\AlgoliaSearch\RetryStrategy\ClusterHosts; @@ -27,11 +26,6 @@ class RecommendApi */ protected $config; - /** - * @var HeaderSelector - */ - protected $headerSelector; - /** * @param RecommendConfig $config * @param ApiWrapperInterface $apiWrapper @@ -41,7 +35,6 @@ public function __construct(ApiWrapperInterface $apiWrapper, RecommendConfig $co $this->config = $config; $this->api = $apiWrapper; - $this->headerSelector = new HeaderSelector(); } /** @@ -117,10 +110,10 @@ public function getRecommendations($getRecommendations) $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($getRecommendations)) { $httpBody = $getRecommendations; } diff --git a/clients/algoliasearch-client-php/lib/Api/SearchApi.php b/clients/algoliasearch-client-php/lib/Api/SearchApi.php index b4bc542349..a35526eb4d 100644 --- a/clients/algoliasearch-client-php/lib/Api/SearchApi.php +++ b/clients/algoliasearch-client-php/lib/Api/SearchApi.php @@ -4,7 +4,6 @@ use Algolia\AlgoliaSearch\Algolia; use Algolia\AlgoliaSearch\Configuration\SearchConfig; -use Algolia\AlgoliaSearch\HeaderSelector; use Algolia\AlgoliaSearch\ObjectSerializer; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; @@ -28,11 +27,6 @@ class SearchApi */ protected $config; - /** - * @var HeaderSelector - */ - protected $headerSelector; - /** * @param SearchConfig $config * @param ApiWrapperInterface $apiWrapper @@ -42,7 +36,6 @@ public function __construct(ApiWrapperInterface $apiWrapper, SearchConfig $confi $this->config = $config; $this->api = $apiWrapper; - $this->headerSelector = new HeaderSelector(); } /** @@ -119,10 +112,10 @@ public function addApiKey($apiKey) $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($apiKey)) { $httpBody = $apiKey; } @@ -197,10 +190,10 @@ public function addOrUpdateObject($indexName, $objectID, $body) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($body)) { $httpBody = $body; } @@ -245,10 +238,10 @@ public function appendSource($source) $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($source)) { $httpBody = $source; } @@ -314,10 +307,10 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdParams) $queryParams['X-Algolia-User-ID'] = $xAlgoliaUserID; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($assignUserIdParams)) { $httpBody = $assignUserIdParams; } @@ -377,10 +370,10 @@ public function batch($indexName, $batchWriteParams) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($batchWriteParams)) { $httpBody = $batchWriteParams; } @@ -446,10 +439,10 @@ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsParams) $queryParams['X-Algolia-User-ID'] = $xAlgoliaUserID; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($batchAssignUserIdsParams)) { $httpBody = $batchAssignUserIdsParams; } @@ -509,10 +502,10 @@ public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntries) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($batchDictionaryEntries)) { $httpBody = $batchDictionaryEntries; } @@ -594,10 +587,10 @@ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearE $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($rule)) { $httpBody = $rule; } @@ -651,10 +644,10 @@ public function browse($indexName, $browseRequest = null) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($browseRequest)) { $httpBody = $browseRequest; } @@ -718,10 +711,10 @@ public function clearAllSynonyms($indexName, $forwardToReplicas = null) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -771,10 +764,10 @@ public function clearObjects($indexName) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -835,10 +828,10 @@ public function clearRules($indexName, $forwardToReplicas = null) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -888,10 +881,10 @@ public function deleteApiKey($key) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -948,10 +941,10 @@ public function deleteBy($indexName, $searchParams) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($searchParams)) { $httpBody = $searchParams; } @@ -1004,10 +997,10 @@ public function deleteIndex($indexName) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1072,10 +1065,10 @@ public function deleteObject($indexName, $objectID) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1151,10 +1144,10 @@ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1204,10 +1197,10 @@ public function deleteSource($source) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1283,10 +1276,10 @@ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1336,10 +1329,10 @@ public function getApiKey($key) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1373,10 +1366,10 @@ public function getDictionaryLanguages() $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1410,10 +1403,10 @@ public function getDictionarySettings() $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1495,10 +1488,10 @@ public function getLogs($offset = 0, $length = 10, $indexName = 'null', $type = $queryParams['type'] = $type; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1574,10 +1567,10 @@ public function getObject($indexName, $objectID, $attributesToRetrieve = null) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1619,10 +1612,10 @@ public function getObjects($getObjectsParams) $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($getObjectsParams)) { $httpBody = $getObjectsParams; } @@ -1690,10 +1683,10 @@ public function getRule($indexName, $objectID) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1743,10 +1736,10 @@ public function getSettings($indexName) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1780,10 +1773,10 @@ public function getSources() $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1848,10 +1841,10 @@ public function getSynonym($indexName, $objectID) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1916,10 +1909,10 @@ public function getTask($indexName, $taskID) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1953,10 +1946,10 @@ public function getTopUserIds() $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2009,10 +2002,10 @@ public function getUserId($userID) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2057,10 +2050,10 @@ public function hasPendingMappings($getClusters = null) $queryParams['getClusters'] = $getClusters; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2094,10 +2087,10 @@ public function listApiKeys() $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2131,10 +2124,10 @@ public function listClusters() $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2179,10 +2172,10 @@ public function listIndices($page = null) $queryParams['page'] = $page; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2238,10 +2231,10 @@ public function listUserIds($page = null, $hitsPerPage = 100) $queryParams['hitsPerPage'] = $hitsPerPage; } } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2283,10 +2276,10 @@ public function multipleBatch($batchParams) $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($batchParams)) { $httpBody = $batchParams; } @@ -2331,10 +2324,10 @@ public function multipleQueries($multipleQueriesParams) $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($multipleQueriesParams)) { $httpBody = $multipleQueriesParams; } @@ -2394,10 +2387,10 @@ public function operationIndex($indexName, $operationIndexParams) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($operationIndexParams)) { $httpBody = $operationIndexParams; } @@ -2483,10 +2476,10 @@ public function partialUpdateObject($indexName, $objectID, $oneOfStringBuiltInOp $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($oneOfStringBuiltInOperation)) { $httpBody = $oneOfStringBuiltInOperation; } @@ -2542,10 +2535,10 @@ public function removeUserId($userID) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2587,10 +2580,10 @@ public function replaceSources($source) $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($source)) { $httpBody = $source; } @@ -2643,10 +2636,10 @@ public function restoreApiKey($key) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2703,10 +2696,10 @@ public function saveObject($indexName, $body) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($body)) { $httpBody = $body; } @@ -2792,10 +2785,10 @@ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($rule)) { $httpBody = $rule; } @@ -2881,10 +2874,10 @@ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplic $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($synonymHit)) { $httpBody = $synonymHit; } @@ -2966,10 +2959,10 @@ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($synonymHit)) { $httpBody = $synonymHit; } @@ -3029,10 +3022,10 @@ public function search($indexName, $searchParams) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($searchParams)) { $httpBody = $searchParams; } @@ -3092,10 +3085,10 @@ public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntrie $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($searchDictionaryEntries)) { $httpBody = $searchDictionaryEntries; } @@ -3164,10 +3157,10 @@ public function searchForFacetValues($indexName, $facetName, $searchForFacetValu $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($searchForFacetValuesRequest)) { $httpBody = $searchForFacetValuesRequest; } @@ -3227,10 +3220,10 @@ public function searchRules($indexName, $searchRulesParams) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($searchRulesParams)) { $httpBody = $searchRulesParams; } @@ -3327,10 +3320,10 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - [] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -3372,10 +3365,10 @@ public function searchUserIds($searchUserIdsParams) $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($searchUserIdsParams)) { $httpBody = $searchUserIdsParams; } @@ -3420,10 +3413,10 @@ public function setDictionarySettings($dictionarySettingsRequest) $queryParams = []; $headerParams = []; $httpBody = []; - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($dictionarySettingsRequest)) { $httpBody = $dictionarySettingsRequest; } @@ -3494,10 +3487,10 @@ public function setSettings($indexName, $indexSettings, $forwardToReplicas = nul $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($indexSettings)) { $httpBody = $indexSettings; } @@ -3557,10 +3550,10 @@ public function updateApiKey($key, $apiKey) $resourcePath ); } - $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; if (isset($apiKey)) { $httpBody = $apiKey; } diff --git a/clients/algoliasearch-client-php/lib/Configuration/Configuration.php b/clients/algoliasearch-client-php/lib/Configuration/Configuration.php index f8aae6e002..3ff4f0d094 100644 --- a/clients/algoliasearch-client-php/lib/Configuration/Configuration.php +++ b/clients/algoliasearch-client-php/lib/Configuration/Configuration.php @@ -18,13 +18,6 @@ abstract class Configuration */ protected $apiKeys = []; - /** - * Associate array to store API prefix (e.g. Bearer) - * - * @var string[] - */ - protected $apiKeyPrefixes = []; - /** * Access token for OAuth/Bearer authentication * @@ -53,13 +46,6 @@ abstract class Configuration */ protected $debugFile = 'php://output'; - /** - * Debug file location (log to STDOUT by default) - * - * @var string - */ - protected $tempFolderPath; - protected $config; protected $defaultReadTimeout = 5; @@ -70,8 +56,6 @@ abstract class Configuration public function __construct(array $config = []) { - $this->tempFolderPath = sys_get_temp_dir(); - if (isset($config['apiKey'])) { $this->setAlgoliaApiKey($config['apiKey']); $this->setApiKey('X-Algolia-API-Key', $config['apiKey']); @@ -113,57 +97,6 @@ public function getApiKey($apiKeyIdentifier) return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; } - /** - * Sets the prefix for API key (e.g. Bearer) - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * @param string $prefix API key prefix, e.g. Bearer - * - * @return $this - */ - public function setApiKeyPrefix($apiKeyIdentifier, $prefix) - { - $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; - - return $this; - } - - /** - * Gets API key prefix - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * - * @return null|string - */ - public function getApiKeyPrefix($apiKeyIdentifier) - { - return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; - } - - /** - * Sets the access token for OAuth - * - * @param string $accessToken Token for OAuth - * - * @return $this - */ - public function setAccessToken($accessToken) - { - $this->accessToken = $accessToken; - - return $this; - } - - /** - * Gets the access token for OAuth - * - * @return string Access token for OAuth - */ - public function getAccessToken() - { - return $this->accessToken; - } - /** * Sets debug flag * @@ -212,55 +145,6 @@ public function getDebugFile() return $this->debugFile; } - /** - * Sets the temp folder path - * - * @param string $tempFolderPath Temp folder path - * - * @return $this - */ - public function setTempFolderPath($tempFolderPath) - { - $this->tempFolderPath = $tempFolderPath; - - return $this; - } - - /** - * Gets the temp folder path - * - * @return string Temp folder path - */ - public function getTempFolderPath() - { - return $this->tempFolderPath; - } - - /** - * Get API key (with prefix if set) - * - * @param string $apiKeyIdentifier name of apikey - * - * @return null|string API key with the prefix - */ - public function getApiKeyWithPrefix($apiKeyIdentifier) - { - $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); - $apiKey = $this->getApiKey($apiKeyIdentifier); - - if ($apiKey === null) { - return null; - } - - if ($prefix === null) { - $keyWithPrefix = $apiKey; - } else { - $keyWithPrefix = $prefix . ' ' . $apiKey; - } - - return $keyWithPrefix; - } - public function getDefaultConfiguration() { return [ diff --git a/clients/algoliasearch-client-php/lib/HeaderSelector.php b/clients/algoliasearch-client-php/lib/HeaderSelector.php deleted file mode 100644 index c8cdd57128..0000000000 --- a/clients/algoliasearch-client-php/lib/HeaderSelector.php +++ /dev/null @@ -1,82 +0,0 @@ -selectAcceptHeader($accept); - if ($accept !== null) { - $headers['Accept'] = $accept; - } - - $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); - - return $headers; - } - - /** - * @param string[] $accept - * - * @return array - */ - public function selectHeadersForMultipart($accept) - { - $headers = $this->selectHeaders($accept, []); - - unset($headers['Content-Type']); - - return $headers; - } - - /** - * Return the header 'Accept' based on an array of Accept provided - * - * @param string[] $accept Array of header - * - * @return null|string Accept (e.g. application/json) - */ - private function selectAcceptHeader($accept) - { - if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { - return null; - } elseif ($jsonAccept = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept)) { - return implode(',', $jsonAccept); - } - - return implode(',', $accept); - } - - /** - * Return the content type based on an array of content-type provided - * - * @param string[] $contentType Array fo content-type - * - * @return string Content-Type (e.g. application/json) - */ - private function selectContentTypeHeader($contentType) - { - if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { - return 'application/json'; - } elseif (preg_grep("/application\/json/i", $contentType)) { - return 'application/json'; - } - - return implode(',', $contentType); - } -} diff --git a/clients/algoliasearch-client-php/lib/Http/CurlHttpClient.php b/clients/algoliasearch-client-php/lib/Http/CurlHttpClient.php deleted file mode 100644 index 1a1361154f..0000000000 --- a/clients/algoliasearch-client-php/lib/Http/CurlHttpClient.php +++ /dev/null @@ -1,131 +0,0 @@ -curlOptions = $curlOptions; - } - - public function sendRequest(RequestInterface $request, $timeout, $connectTimeout) - { - $curlHandle = curl_init(); - - // set curl options - try { - foreach ($this->curlOptions as $curlOption => $optionValue) { - curl_setopt($curlHandle, constant($curlOption), $optionValue); - } - } catch (\Exception $e) { - $this->invalidOptions($this->curlOptions, $e->getMessage()); - } - - $curlHeaders = []; - foreach ($request->getHeaders() as $key => $values) { - $curlHeaders[] = $key.': '.implode(',', $values); - } - - curl_setopt($curlHandle, CURLOPT_HTTPHEADER, $curlHeaders); - - curl_setopt($curlHandle, CURLOPT_USERAGENT, implode(',', $request->getHeader('User-Agent'))); - //Return the output instead of printing it - curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); - curl_setopt($curlHandle, CURLOPT_FAILONERROR, true); - curl_setopt($curlHandle, CURLOPT_ENCODING, ''); - curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($curlHandle, CURLOPT_SSL_VERIFYHOST, 2); - // TODO: look into cert -// curl_setopt($curlHandle, CURLOPT_CAINFO, $this->caInfoPath); - - curl_setopt($curlHandle, CURLOPT_URL, (string) $request->getUri()); - $version = curl_version(); - if (version_compare($version['version'], '7.16.2', '>=') && $connectTimeout < 1) { - curl_setopt($curlHandle, CURLOPT_CONNECTTIMEOUT_MS, $connectTimeout * 1000); - curl_setopt($curlHandle, CURLOPT_TIMEOUT_MS, $timeout * 1000); - } else { - curl_setopt($curlHandle, CURLOPT_CONNECTTIMEOUT, $connectTimeout); - curl_setopt($curlHandle, CURLOPT_TIMEOUT, $timeout); - } - - // The problem is that on (Li|U)nix, when libcurl uses the standard name resolver, - // a SIGALRM is raised during name resolution which libcurl thinks is the timeout alarm. - curl_setopt($curlHandle, CURLOPT_NOSIGNAL, 1); - curl_setopt($curlHandle, CURLOPT_FAILONERROR, false); - - $method = $request->getMethod(); - if ('GET' === $method) { - curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'GET'); - curl_setopt($curlHandle, CURLOPT_HTTPGET, true); - curl_setopt($curlHandle, CURLOPT_POST, false); - } else { - if ('POST' === $method) { - $body = (string) $request->getBody(); - curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'POST'); - curl_setopt($curlHandle, CURLOPT_POST, true); - curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $body); - } elseif ('DELETE' === $method) { - curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'DELETE'); - curl_setopt($curlHandle, CURLOPT_POST, false); - } elseif ('PUT' === $method) { - $body = (string) $request->getBody(); - curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'PUT'); - curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $body); - curl_setopt($curlHandle, CURLOPT_POST, true); - } - } - $mhandle = $this->getMHandle($curlHandle); - - // Do all the processing. - $running = null; - do { - $mrc = curl_multi_exec($mhandle, $running); - } while (CURLM_CALL_MULTI_PERFORM === $mrc); - - while ($running && CURLM_OK === $mrc) { - if (-1 === curl_multi_select($mhandle, 0.1)) { - usleep(100); - } - do { - $mrc = curl_multi_exec($mhandle, $running); - } while (CURLM_CALL_MULTI_PERFORM === $mrc); - } - - $statusCode = (int) curl_getinfo($curlHandle, CURLINFO_HTTP_CODE); - $responseBody = curl_multi_getcontent($curlHandle); - $error = curl_error($curlHandle); - - $this->releaseMHandle($curlHandle); - curl_close($curlHandle); - - return new Response($statusCode, [], $responseBody, '1.1', $error); - } - - private function getMHandle($curlHandle) - { - if (!is_resource($this->curlMHandle)) { - $this->curlMHandle = curl_multi_init(); - } - curl_multi_add_handle($this->curlMHandle, $curlHandle); - - return $this->curlMHandle; - } - - private function releaseMHandle($curlHandle) - { - curl_multi_remove_handle($this->curlMHandle, $curlHandle); - } - - private function invalidOptions(array $curlOptions = [], $errorMsg = '') - { - throw new \OutOfBoundsException(sprintf('AlgoliaSearch curloptions options keys are invalid. %s given. error message : %s', json_encode($curlOptions), $errorMsg)); - } -} diff --git a/clients/algoliasearch-client-php/lib/ObjectSerializer.php b/clients/algoliasearch-client-php/lib/ObjectSerializer.php index 41cb6a7cc1..e59a9ce0e3 100644 --- a/clients/algoliasearch-client-php/lib/ObjectSerializer.php +++ b/clients/algoliasearch-client-php/lib/ObjectSerializer.php @@ -316,25 +316,7 @@ public static function deserialize($data, $class, $httpHeaders = null) return $data; } - if ($class === '\SplFileObject') { - /** @var \Psr\Http\Message\StreamInterface $data */ - - // determine file name - if (array_key_exists('Content-Disposition', $httpHeaders) && - preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); - } else { - $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); - } - - $file = fopen($filename, 'w'); - while ($chunk = $data->read(200)) { - fwrite($file, $chunk); - } - fclose($file); - - return new \SplFileObject($filename, 'r'); - } elseif (method_exists($class, 'getAllowableEnumValues')) { + if (method_exists($class, 'getAllowableEnumValues')) { if (!in_array($data, $class::getAllowableEnumValues(), true)) { $imploded = implode("', '", $class::getAllowableEnumValues()); diff --git a/clients/algoliasearch-client-php/lib/RetryStrategy/ClusterHosts.php b/clients/algoliasearch-client-php/lib/RetryStrategy/ClusterHosts.php index 57ce7a90a9..9fcc749e23 100644 --- a/clients/algoliasearch-client-php/lib/RetryStrategy/ClusterHosts.php +++ b/clients/algoliasearch-client-php/lib/RetryStrategy/ClusterHosts.php @@ -64,20 +64,6 @@ public static function createFromAppId($applicationId) return static::create($read, $write); } - public static function createForPlaces() - { - $read = $write = [ - 'places-1.algolianet.com' => 0, - 'places-2.algolianet.com' => 0, - 'places-3.algolianet.com' => 0, - ]; - - $read['places-dsn.algolia.net'] = 10; - $write['places.algolia.net'] = 10; - - return static::create($read, $write); - } - public static function createForAnalytics($region) { return static::create('analytics.'.$region.'.algolia.com'); diff --git a/clients/algoliasearch-client-php/lib/Support/Helpers.php b/clients/algoliasearch-client-php/lib/Support/Helpers.php index bfcbc3a0c2..33716920e4 100644 --- a/clients/algoliasearch-client-php/lib/Support/Helpers.php +++ b/clients/algoliasearch-client-php/lib/Support/Helpers.php @@ -2,38 +2,8 @@ namespace Algolia\AlgoliaSearch\Support; -use Algolia\AlgoliaSearch\Exceptions\MissingObjectId; - final class Helpers { - /** - * Use this function to generate API path. It will ensure - * that all parameters are properly urlencoded. - * The function will not double encode if the params are - * already urlencoded - * Signature is the same `sprintf`. - * - * Examples: - * - api_path('1/indexes/%s/search', $indexName) - * - api_path('/1/indexes/%s/synonyms/%s', $indexName, $objectID) - * - * @param string $pathFormat - * @param mixed $args - * @param mixed $_ - * - * @return mixed - */ - public static function apiPath($pathFormat, $args = null, $_ = null) - { - $arguments = array_slice(func_get_args(), 1); - foreach ($arguments as &$arg) { - $arg = urlencode(urldecode($arg)); - } - array_unshift($arguments, $pathFormat); - - return call_user_func_array('sprintf', $arguments); - } - /** * When building a query string, array values must be json_encoded. * This function can be used to turn any array into a Algolia-valid query string. @@ -63,31 +33,6 @@ public static function buildQuery(array $args) return http_build_query($args); } - public static function buildBatch($items, $action) - { - return array_map(function ($item) use ($action) { - return [ - 'action' => $action, - 'body' => $item, - ]; - }, $items); - } - - public static function ensureObjectID($objects, $message = 'ObjectID is required to add a record, a synonym or a query rule.') - { - // In case a single objects is passed - if (isset($objects['objectID'])) { - return; - } - - // In case multiple objects are passed - foreach ($objects as $object) { - if (!isset($object['objectID']) && !isset($object['body']['objectID'])) { - throw new MissingObjectId($message); - } - } - } - /** * Wrapper for json_decode that throws when an error occurs. * @@ -114,31 +59,4 @@ public static function json_decode($json, $assoc = false, $depth = 512) return $data; } - - public static function mapObjectIDs($objectIDKey, $objects) - { - return array_map(function ($object) use ($objectIDKey) { - if (!isset($object[$objectIDKey])) { - throw new MissingObjectId("At least one object is missing the required $objectIDKey key: ".json_encode($object)); - } - $object['objectID'] = $object[$objectIDKey]; - - return $object; - }, $objects); - } - - public static function serializeQueryParameters($parameters) - { - if (is_string($parameters)) { - return $parameters; - } - - foreach ($parameters as $key => $value) { - if (is_array($value)) { - $parameters[$key] = json_encode($value, JSON_THROW_ON_ERROR); - } - } - - return http_build_query($parameters); - } } diff --git a/templates/php/Configuration.mustache b/templates/php/Configuration.mustache index 2e0fb46f4e..2fa87b1468 100644 --- a/templates/php/Configuration.mustache +++ b/templates/php/Configuration.mustache @@ -18,13 +18,6 @@ abstract class Configuration */ protected $apiKeys = []; - /** - * Associate array to store API prefix (e.g. Bearer) - * - * @var string[] - */ - protected $apiKeyPrefixes = []; - /** * Access token for OAuth/Bearer authentication * @@ -53,13 +46,6 @@ abstract class Configuration */ protected $debugFile = 'php://output'; - /** - * Debug file location (log to STDOUT by default) - * - * @var string - */ - protected $tempFolderPath; - protected $config; protected $defaultReadTimeout = 5; @@ -70,8 +56,6 @@ abstract class Configuration public function __construct(array $config = []) { - $this->tempFolderPath = sys_get_temp_dir(); - if(isset($config['apiKey'])) { $this->setAlgoliaApiKey($config['apiKey']); $this->setApiKey('X-Algolia-API-Key', $config['apiKey']); @@ -112,55 +96,6 @@ abstract class Configuration return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; } - /** - * Sets the prefix for API key (e.g. Bearer) - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * @param string $prefix API key prefix, e.g. Bearer - * - * @return $this - */ - public function setApiKeyPrefix($apiKeyIdentifier, $prefix) - { - $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; - return $this; - } - - /** - * Gets API key prefix - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * - * @return null|string - */ - public function getApiKeyPrefix($apiKeyIdentifier) - { - return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; - } - - /** - * Sets the access token for OAuth - * - * @param string $accessToken Token for OAuth - * - * @return $this - */ - public function setAccessToken($accessToken) - { - $this->accessToken = $accessToken; - return $this; - } - - /** - * Gets the access token for OAuth - * - * @return string Access token for OAuth - */ - public function getAccessToken() - { - return $this->accessToken; - } - /** * Sets debug flag * @@ -206,55 +141,7 @@ abstract class Configuration { return $this->debugFile; } - - /** - * Sets the temp folder path - * - * @param string $tempFolderPath Temp folder path - * - * @return $this - */ - public function setTempFolderPath($tempFolderPath) - { - $this->tempFolderPath = $tempFolderPath; - return $this; - } - - /** - * Gets the temp folder path - * - * @return string Temp folder path - */ - public function getTempFolderPath() - { - return $this->tempFolderPath; - } - - /** - * Get API key (with prefix if set) - * - * @param string $apiKeyIdentifier name of apikey - * - * @return null|string API key with the prefix - */ - public function getApiKeyWithPrefix($apiKeyIdentifier) - { - $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); - $apiKey = $this->getApiKey($apiKeyIdentifier); - - if ($apiKey === null) { - return null; - } - - if ($prefix === null) { - $keyWithPrefix = $apiKey; - } else { - $keyWithPrefix = $prefix . ' ' . $apiKey; - } - - return $keyWithPrefix; - } - + public function getDefaultConfiguration() { return [ diff --git a/templates/php/HeaderSelector.mustache b/templates/php/HeaderSelector.mustache deleted file mode 100644 index 8645ef25ff..0000000000 --- a/templates/php/HeaderSelector.mustache +++ /dev/null @@ -1,81 +0,0 @@ -selectAcceptHeader($accept); - if ($accept !== null) { - $headers['Accept'] = $accept; - } - - $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); - return $headers; - } - - /** - * @param string[] $accept - * @return array - */ - public function selectHeadersForMultipart($accept) - { - $headers = $this->selectHeaders($accept, []); - - unset($headers['Content-Type']); - return $headers; - } - - /** - * Return the header 'Accept' based on an array of Accept provided - * - * @param string[] $accept Array of header - * - * @return null|string Accept (e.g. application/json) - */ - private function selectAcceptHeader($accept) - { - if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { - return null; - } elseif ($jsonAccept = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept)) { - return implode(',', $jsonAccept); - } else { - return implode(',', $accept); - } - } - - /** - * Return the content type based on an array of content-type provided - * - * @param string[] $contentType Array fo content-type - * - * @return string Content-Type (e.g. application/json) - */ - private function selectContentTypeHeader($contentType) - { - if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { - return 'application/json'; - } elseif (preg_grep("/application\/json/i", $contentType)) { - return 'application/json'; - } else { - return implode(',', $contentType); - } - } -} diff --git a/templates/php/ObjectSerializer.mustache b/templates/php/ObjectSerializer.mustache index 7d72a2e1b0..47592bc8a3 100644 --- a/templates/php/ObjectSerializer.mustache +++ b/templates/php/ObjectSerializer.mustache @@ -310,25 +310,7 @@ class ObjectSerializer return $data; } - if ($class === '\SplFileObject') { - /** @var \Psr\Http\Message\StreamInterface $data */ - - // determine file name - if (array_key_exists('Content-Disposition', $httpHeaders) && - preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); - } else { - $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); - } - - $file = fopen($filename, 'w'); - while ($chunk = $data->read(200)) { - fwrite($file, $chunk); - } - fclose($file); - - return new \SplFileObject($filename, 'r'); - } elseif (method_exists($class, 'getAllowableEnumValues')) { + if (method_exists($class, 'getAllowableEnumValues')) { if (!in_array($data, $class::getAllowableEnumValues(), true)) { $imploded = implode("', '", $class::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); diff --git a/templates/php/README.mustache b/templates/php/README.mustache deleted file mode 100644 index dada97d670..0000000000 --- a/templates/php/README.mustache +++ /dev/null @@ -1,148 +0,0 @@ -# {{packageName}} - -{{#appDescriptionWithNewLines}} -{{{.}}} -{{/appDescriptionWithNewLines}} - -{{#infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}). -{{/infoUrl}} - -## Installation & Usage - -### Requirements - -PHP 7.3 and later. -Should also work with PHP 8.0 but has not been tested. - -### Composer - -To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: - -```json -{ - "repositories": [ - { - "type": "vcs", - "url": "https://{{gitHost}}/{{gitUserId}}/{{gitRepoId}}.git" - } - ], - "require": { - "{{gitUserId}}/{{gitRepoId}}": "*@dev" - } -} -``` - -Then run `composer install` - -### Manual Installation - -Download the files and include `autoload.php`: - -```php - php_doc_auth_partial}} -$apiInstance = new {{invokerPackage}}\Api\{{classname}}( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(){{#hasAuthMethods}}, - $config{{/hasAuthMethods}} -); -{{#allParams}}${{paramName}} = {{{example}}}; // {{{dataType}}}{{#description}} | {{{.}}}{{/description}} -{{/allParams}} - -try { - {{#returnType}}$result = {{/returnType}}$apiInstance->{{{operationId}}}({{#allParams}}${{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - print_r($result);{{/returnType}} -} catch (Exception $e) { - echo 'Exception when calling {{classname}}->{{operationId}}: ', $e->getMessage(), PHP_EOL; -} -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} -``` - -## API Endpoints - -All URIs are relative to *{{basePath}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} -## Models - -{{#models}}{{#model}}- [{{{classname}}}]({{modelDocPath}}/{{{classname}}}.md){{/model}} -{{/models}} - -## Authorization -{{^authMethods}} -All endpoints do not require authorization. -{{/authMethods}} -{{#authMethods}} -{{#last}} Authentication schemes defined for the API:{{/last}} -### {{{name}}} -{{#isApiKey}} - -- **Type**: API key -- **API key parameter name**: {{{keyParamName}}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} - -{{/isApiKey}} -{{#isBasic}} -{{#isBasicBasic}} - -- **Type**: HTTP basic authentication -{{/isBasicBasic}} -{{#isBasicBearer}} - -- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} -{{/isBasicBearer}} -{{/isBasic}} -{{#isOAuth}} - -- **Type**: `OAuth` -- **Flow**: `{{{flow}}}` -- **Authorization URL**: `{{{authorizationUrl}}}` -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - - **{{{scope}}}**: {{{description}}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} -## Tests - -To run the tests, use: - -```bash -composer install -vendor/bin/phpunit -``` - -## Author - -{{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} -{{/-last}}{{/apis}}{{/apiInfo}} -## About this package - -This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: `{{appVersion}}` -{{#artifactVersion}} - - Package version: `{{.}}` -{{/artifactVersion}} -{{^hideGenerationTimestamp}} - - Build date: `{{generatedDate}}` -{{/hideGenerationTimestamp}} -- Build package: `{{generatorClass}}` diff --git a/templates/php/api.mustache b/templates/php/api.mustache index 05e03ac165..7784cc69df 100644 --- a/templates/php/api.mustache +++ b/templates/php/api.mustache @@ -10,7 +10,6 @@ use GuzzleHttp\Utils; use {{invokerPackage}}\Algolia; use {{invokerPackage}}\ApiException; use {{invokerPackage}}\Configuration\{{configClassname}}; -use {{invokerPackage}}\HeaderSelector; use {{invokerPackage}}\ObjectSerializer; use {{invokerPackage}}\RetryStrategy\ApiWrapper; use {{invokerPackage}}\RetryStrategy\ApiWrapperInterface; @@ -34,11 +33,6 @@ use {{invokerPackage}}\RetryStrategy\ClusterHosts; */ protected $config; - /** - * @var HeaderSelector - */ - protected $headerSelector; - /** * @param {{configClassname}} $config * @param ApiWrapperInterface $apiWrapper @@ -48,7 +42,6 @@ use {{invokerPackage}}\RetryStrategy\ClusterHosts; $this->config = $config; $this->api = $apiWrapper; - $this->headerSelector = new HeaderSelector(); } {{#hasRegionalHost}} @@ -282,10 +275,10 @@ use {{invokerPackage}}\RetryStrategy\ClusterHosts; ); } {{/pathParams}} - $headers = $this->headerSelector->selectHeaders( - [{{#produces}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}], - [{{#consumes}}'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}}] - ); + + $headers = []; + $headers['Accept'] = 'application/json'; + $headers['Content-Type'] = 'application/json'; {{#bodyParams}} if (isset(${{paramName}})) { $httpBody = ${{paramName}}; diff --git a/templates/php/php_doc_auth_partial.mustache b/templates/php/php_doc_auth_partial.mustache deleted file mode 100644 index 282150604c..0000000000 --- a/templates/php/php_doc_auth_partial.mustache +++ /dev/null @@ -1,23 +0,0 @@ -{{#hasAuthMethods}}{{#authMethods}} -{{#isBasic}} -{{#isBasicBasic}} -// Configure HTTP basic authorization: {{{name}}} -$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration() - ->setUsername('YOUR_USERNAME') - ->setPassword('YOUR_PASSWORD'); -{{/isBasicBasic}} -{{#isBasicBearer}} -// Configure Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} authorization: {{{name}}} -$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -{{/isBasicBearer}} -{{/isBasic}} -{{#isApiKey}} -// Configure API key authorization: {{{name}}} -$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKey('{{{keyParamName}}}', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setApiKeyPrefix('{{{keyParamName}}}', 'Bearer'); -{{/isApiKey}} -{{#isOAuth}} -// Configure OAuth2 access token for authorization: {{{name}}} -$config = {{{invokerPackage}}}\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); -{{/isOAuth}}{{/authMethods}}{{/hasAuthMethods}}