From 3f4780506c05df1c467cbd7eb4f2db53c5a2a602 Mon Sep 17 00:00:00 2001 From: algolia-bot Date: Wed, 22 Jan 2025 08:32:43 +0000 Subject: [PATCH] feat(specs): rename composition to composition-full (private) and add composition (public) (generated) https://github.com/algolia/api-clients-automation/pull/4357 Co-authored-by: algolia-bot Co-authored-by: Emmanuel Krebs Co-authored-by: shortcuts Co-authored-by: Pierre Millot --- lib/Api/CompositionClient.php | 239 +++ lib/Configuration/CompositionConfig.php | 24 + lib/Model/Composition/AroundPrecision.php | 190 +++ lib/Model/Composition/AroundRadius.php | 190 +++ lib/Model/Composition/AroundRadiusAll.php | 32 + lib/Model/Composition/Banner.php | 258 ++++ lib/Model/Composition/BannerImage.php | 258 ++++ lib/Model/Composition/BannerImageUrl.php | 226 +++ lib/Model/Composition/BannerLink.php | 226 +++ .../Composition/CompositionIdRankingInfo.php | 265 ++++ .../CompositionRunAppliedRules.php | 230 +++ .../CompositionRunSearchResponse.php | 262 ++++ .../CompositionsSearchResponse.php | 230 +++ lib/Model/Composition/ErrorBase.php | 226 +++ lib/Model/Composition/Exhaustive.php | 354 +++++ lib/Model/Composition/FacetFilters.php | 190 +++ lib/Model/Composition/FacetHits.php | 300 ++++ lib/Model/Composition/FacetOrdering.php | 258 ++++ lib/Model/Composition/FacetStats.php | 320 ++++ lib/Model/Composition/Facets.php | 226 +++ lib/Model/Composition/HighlightResult.php | 332 +++++ .../Composition/HighlightResultOption.php | 334 +++++ lib/Model/Composition/Hit.php | 360 +++++ lib/Model/Composition/HitRankingInfo.php | 658 ++++++++ lib/Model/Composition/InsideBoundingBox.php | 188 +++ lib/Model/Composition/MatchLevel.php | 38 + lib/Model/Composition/MatchedGeoLocation.php | 288 ++++ lib/Model/Composition/NumericFilters.php | 190 +++ lib/Model/Composition/OptionalFilters.php | 190 +++ lib/Model/Composition/Params.php | 1024 +++++++++++++ lib/Model/Composition/Personalization.php | 288 ++++ lib/Model/Composition/Range.php | 258 ++++ lib/Model/Composition/Redirect.php | 226 +++ .../Composition/RedirectRuleIndexData.php | 232 +++ .../Composition/RedirectRuleIndexMetadata.php | 370 +++++ lib/Model/Composition/RedirectURL.php | 226 +++ lib/Model/Composition/RenderingContent.php | 290 ++++ lib/Model/Composition/RequestBody.php | 224 +++ .../ResultsCompositionInfoResponse.php | 230 +++ ...tsInjectedItemAppliedRulesInfoResponse.php | 230 +++ .../ResultsInjectedItemInfoResponse.php | 262 ++++ .../SearchForFacetValuesParams.php | 288 ++++ .../SearchForFacetValuesRequest.php | 224 +++ .../SearchForFacetValuesResponse.php | 224 +++ .../SearchForFacetValuesResults.php | 332 +++++ lib/Model/Composition/SearchResponse.php | 262 ++++ lib/Model/Composition/SearchResultsItem.php | 1322 +++++++++++++++++ lib/Model/Composition/SnippetResult.php | 265 ++++ lib/Model/Composition/SnippetResultOption.php | 267 ++++ lib/Model/Composition/SortRemainingBy.php | 38 + lib/Model/Composition/SupportedLanguage.php | 233 +++ lib/Model/Composition/Value.php | 288 ++++ lib/Model/Composition/Widgets.php | 226 +++ 53 files changed, 14911 insertions(+) create mode 100644 lib/Api/CompositionClient.php create mode 100644 lib/Configuration/CompositionConfig.php create mode 100644 lib/Model/Composition/AroundPrecision.php create mode 100644 lib/Model/Composition/AroundRadius.php create mode 100644 lib/Model/Composition/AroundRadiusAll.php create mode 100644 lib/Model/Composition/Banner.php create mode 100644 lib/Model/Composition/BannerImage.php create mode 100644 lib/Model/Composition/BannerImageUrl.php create mode 100644 lib/Model/Composition/BannerLink.php create mode 100644 lib/Model/Composition/CompositionIdRankingInfo.php create mode 100644 lib/Model/Composition/CompositionRunAppliedRules.php create mode 100644 lib/Model/Composition/CompositionRunSearchResponse.php create mode 100644 lib/Model/Composition/CompositionsSearchResponse.php create mode 100644 lib/Model/Composition/ErrorBase.php create mode 100644 lib/Model/Composition/Exhaustive.php create mode 100644 lib/Model/Composition/FacetFilters.php create mode 100644 lib/Model/Composition/FacetHits.php create mode 100644 lib/Model/Composition/FacetOrdering.php create mode 100644 lib/Model/Composition/FacetStats.php create mode 100644 lib/Model/Composition/Facets.php create mode 100644 lib/Model/Composition/HighlightResult.php create mode 100644 lib/Model/Composition/HighlightResultOption.php create mode 100644 lib/Model/Composition/Hit.php create mode 100644 lib/Model/Composition/HitRankingInfo.php create mode 100644 lib/Model/Composition/InsideBoundingBox.php create mode 100644 lib/Model/Composition/MatchLevel.php create mode 100644 lib/Model/Composition/MatchedGeoLocation.php create mode 100644 lib/Model/Composition/NumericFilters.php create mode 100644 lib/Model/Composition/OptionalFilters.php create mode 100644 lib/Model/Composition/Params.php create mode 100644 lib/Model/Composition/Personalization.php create mode 100644 lib/Model/Composition/Range.php create mode 100644 lib/Model/Composition/Redirect.php create mode 100644 lib/Model/Composition/RedirectRuleIndexData.php create mode 100644 lib/Model/Composition/RedirectRuleIndexMetadata.php create mode 100644 lib/Model/Composition/RedirectURL.php create mode 100644 lib/Model/Composition/RenderingContent.php create mode 100644 lib/Model/Composition/RequestBody.php create mode 100644 lib/Model/Composition/ResultsCompositionInfoResponse.php create mode 100644 lib/Model/Composition/ResultsInjectedItemAppliedRulesInfoResponse.php create mode 100644 lib/Model/Composition/ResultsInjectedItemInfoResponse.php create mode 100644 lib/Model/Composition/SearchForFacetValuesParams.php create mode 100644 lib/Model/Composition/SearchForFacetValuesRequest.php create mode 100644 lib/Model/Composition/SearchForFacetValuesResponse.php create mode 100644 lib/Model/Composition/SearchForFacetValuesResults.php create mode 100644 lib/Model/Composition/SearchResponse.php create mode 100644 lib/Model/Composition/SearchResultsItem.php create mode 100644 lib/Model/Composition/SnippetResult.php create mode 100644 lib/Model/Composition/SnippetResultOption.php create mode 100644 lib/Model/Composition/SortRemainingBy.php create mode 100644 lib/Model/Composition/SupportedLanguage.php create mode 100644 lib/Model/Composition/Value.php create mode 100644 lib/Model/Composition/Widgets.php diff --git a/lib/Api/CompositionClient.php b/lib/Api/CompositionClient.php new file mode 100644 index 00000000..dd7650c6 --- /dev/null +++ b/lib/Api/CompositionClient.php @@ -0,0 +1,239 @@ +config = $config; + $this->api = $apiWrapper; + } + + /** + * Instantiate the client with basic credentials. + * + * @param string $appId Application ID + * @param string $apiKey Algolia API Key + */ + public static function create($appId = null, $apiKey = null) + { + return static::createWithConfig(CompositionConfig::create($appId, $apiKey)); + } + + /** + * Instantiate the client with configuration. + * + * @param CompositionConfig $config Configuration + */ + public static function createWithConfig(CompositionConfig $config) + { + $config = clone $config; + + $apiWrapper = new ApiWrapper( + Algolia::getHttpClient(), + $config, + self::getClusterHosts($config) + ); + + return new static($apiWrapper, $config); + } + + /** + * Gets the cluster hosts depending on the config. + * + * @return ClusterHosts + */ + public static function getClusterHosts(CompositionConfig $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) + ; + } + + return $clusterHosts; + } + + /** + * @return CompositionConfig + */ + public function getClientConfig() + { + return $this->config; + } + + /** + * Stub method setting a new API key to authenticate requests. + * + * @param string $apiKey + */ + public function setClientApiKey($apiKey) + { + $this->config->setClientApiKey($apiKey); + } + + /** + * Runs a query on a single composition and returns matching results. + * + * Required API Key ACLs: + * - search + * + * @param string $compositionID Unique Composition ObjectID. (required) + * @param array $requestBody requestBody (required) + * - $requestBody['params'] => (array) + * + * @see RequestBody + * + * @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions + * + * @return \Algolia\AlgoliaSearch\Model\Composition\SearchResponse|array + */ + public function search($compositionID, $requestBody, $requestOptions = []) + { + // verify the required parameter 'compositionID' is set + if (!isset($compositionID)) { + throw new \InvalidArgumentException( + 'Parameter `compositionID` is required when calling `search`.' + ); + } + // verify the required parameter 'requestBody' is set + if (!isset($requestBody)) { + throw new \InvalidArgumentException( + 'Parameter `requestBody` is required when calling `search`.' + ); + } + + $resourcePath = '/1/compositions/{compositionID}/run'; + $queryParameters = []; + $headers = []; + $httpBody = $requestBody; + + // path params + if (null !== $compositionID) { + $resourcePath = str_replace( + '{compositionID}', + ObjectSerializer::toPathValue($compositionID), + $resourcePath + ); + } + + return $this->sendRequest('POST', $resourcePath, $headers, $queryParameters, $httpBody, $requestOptions, true); + } + + /** + * Searches for values of a specified facet attribute on the composition's main source's index. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn't work if you have **more than 65 searchable facets and searchable attributes combined**. + * + * Required API Key ACLs: + * - search + * + * @param string $compositionID Unique Composition ObjectID. (required) + * @param string $facetName Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier. (required) + * @param array $searchForFacetValuesRequest searchForFacetValuesRequest (optional) + * - $searchForFacetValuesRequest['params'] => (array) + * + * @see SearchForFacetValuesRequest + * + * @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions + * + * @return \Algolia\AlgoliaSearch\Model\Composition\SearchForFacetValuesResponse|array + */ + public function searchForFacetValues($compositionID, $facetName, $searchForFacetValuesRequest = null, $requestOptions = []) + { + // verify the required parameter 'compositionID' is set + if (!isset($compositionID)) { + throw new \InvalidArgumentException( + 'Parameter `compositionID` is required when calling `searchForFacetValues`.' + ); + } + // verify the required parameter 'facetName' is set + if (!isset($facetName)) { + throw new \InvalidArgumentException( + 'Parameter `facetName` is required when calling `searchForFacetValues`.' + ); + } + + $resourcePath = '/1/compositions/{compositionID}/facets/{facetName}/query'; + $queryParameters = []; + $headers = []; + $httpBody = isset($searchForFacetValuesRequest) ? $searchForFacetValuesRequest : []; + + // path params + if (null !== $compositionID) { + $resourcePath = str_replace( + '{compositionID}', + ObjectSerializer::toPathValue($compositionID), + $resourcePath + ); + } + + // path params + if (null !== $facetName) { + $resourcePath = str_replace( + '{facetName}', + ObjectSerializer::toPathValue($facetName), + $resourcePath + ); + } + + return $this->sendRequest('POST', $resourcePath, $headers, $queryParameters, $httpBody, $requestOptions, true); + } + + private function sendRequest($method, $resourcePath, $headers, $queryParameters, $httpBody, $requestOptions, $useReadTransporter = false) + { + if (!isset($requestOptions['headers'])) { + $requestOptions['headers'] = []; + } + if (!isset($requestOptions['queryParameters'])) { + $requestOptions['queryParameters'] = []; + } + + $requestOptions['headers'] = array_merge($headers, $requestOptions['headers']); + $requestOptions['queryParameters'] = array_merge($queryParameters, $requestOptions['queryParameters']); + $query = Query::build($requestOptions['queryParameters']); + + return $this->api->sendRequest( + $method, + $resourcePath.($query ? "?{$query}" : ''), + $httpBody, + $requestOptions, + $useReadTransporter + ); + } +} diff --git a/lib/Configuration/CompositionConfig.php b/lib/Configuration/CompositionConfig.php new file mode 100644 index 00000000..0f8430d1 --- /dev/null +++ b/lib/Configuration/CompositionConfig.php @@ -0,0 +1,24 @@ + '', + 'apiKey' => '', + 'hosts' => null, + 'hasFullHosts' => false, + 'readTimeout' => 5, + 'writeTimeout' => 30, + 'connectTimeout' => 2, + 'defaultHeaders' => [], + ]; + } +} diff --git a/lib/Model/Composition/AroundPrecision.php b/lib/Model/Composition/AroundPrecision.php new file mode 100644 index 00000000..63144045 --- /dev/null +++ b/lib/Model/Composition/AroundPrecision.php @@ -0,0 +1,190 @@ +listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/AroundRadius.php b/lib/Model/Composition/AroundRadius.php new file mode 100644 index 00000000..90884e6a --- /dev/null +++ b/lib/Model/Composition/AroundRadius.php @@ -0,0 +1,190 @@ +listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/AroundRadiusAll.php b/lib/Model/Composition/AroundRadiusAll.php new file mode 100644 index 00000000..6e4313bf --- /dev/null +++ b/lib/Model/Composition/AroundRadiusAll.php @@ -0,0 +1,32 @@ + '\Algolia\AlgoliaSearch\Model\Composition\BannerImage', + 'link' => '\Algolia\AlgoliaSearch\Model\Composition\BannerLink', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'image' => null, + 'link' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'image' => 'image', + 'link' => 'link', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'image' => 'setImage', + 'link' => 'setLink', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'image' => 'getImage', + 'link' => 'getLink', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['image'])) { + $this->container['image'] = $data['image']; + } + if (isset($data['link'])) { + $this->container['link'] = $data['link']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets image. + * + * @return null|BannerImage + */ + public function getImage() + { + return $this->container['image'] ?? null; + } + + /** + * Sets image. + * + * @param null|BannerImage $image image + * + * @return self + */ + public function setImage($image) + { + $this->container['image'] = $image; + + return $this; + } + + /** + * Gets link. + * + * @return null|BannerLink + */ + public function getLink() + { + return $this->container['link'] ?? null; + } + + /** + * Sets link. + * + * @param null|BannerLink $link link + * + * @return self + */ + public function setLink($link) + { + $this->container['link'] = $link; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/BannerImage.php b/lib/Model/Composition/BannerImage.php new file mode 100644 index 00000000..7f065153 --- /dev/null +++ b/lib/Model/Composition/BannerImage.php @@ -0,0 +1,258 @@ + '\Algolia\AlgoliaSearch\Model\Composition\BannerImageUrl[]', + 'title' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'urls' => null, + 'title' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'urls' => 'urls', + 'title' => 'title', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'urls' => 'setUrls', + 'title' => 'setTitle', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'urls' => 'getUrls', + 'title' => 'getTitle', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['urls'])) { + $this->container['urls'] = $data['urls']; + } + if (isset($data['title'])) { + $this->container['title'] = $data['title']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets urls. + * + * @return null|\Algolia\AlgoliaSearch\Model\Composition\BannerImageUrl[] + */ + public function getUrls() + { + return $this->container['urls'] ?? null; + } + + /** + * Sets urls. + * + * @param null|\Algolia\AlgoliaSearch\Model\Composition\BannerImageUrl[] $urls urls + * + * @return self + */ + public function setUrls($urls) + { + $this->container['urls'] = $urls; + + return $this; + } + + /** + * Gets title. + * + * @return null|string + */ + public function getTitle() + { + return $this->container['title'] ?? null; + } + + /** + * Sets title. + * + * @param null|string $title title + * + * @return self + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/BannerImageUrl.php b/lib/Model/Composition/BannerImageUrl.php new file mode 100644 index 00000000..99d837a8 --- /dev/null +++ b/lib/Model/Composition/BannerImageUrl.php @@ -0,0 +1,226 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'url' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'url' => 'url', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'url' => 'setUrl', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'url' => 'getUrl', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['url'])) { + $this->container['url'] = $data['url']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets url. + * + * @return null|string + */ + public function getUrl() + { + return $this->container['url'] ?? null; + } + + /** + * Sets url. + * + * @param null|string $url url + * + * @return self + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/BannerLink.php b/lib/Model/Composition/BannerLink.php new file mode 100644 index 00000000..baac32ad --- /dev/null +++ b/lib/Model/Composition/BannerLink.php @@ -0,0 +1,226 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'url' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'url' => 'url', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'url' => 'setUrl', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'url' => 'getUrl', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['url'])) { + $this->container['url'] = $data['url']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets url. + * + * @return null|string + */ + public function getUrl() + { + return $this->container['url'] ?? null; + } + + /** + * Sets url. + * + * @param null|string $url url + * + * @return self + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/CompositionIdRankingInfo.php b/lib/Model/Composition/CompositionIdRankingInfo.php new file mode 100644 index 00000000..cfa4e530 --- /dev/null +++ b/lib/Model/Composition/CompositionIdRankingInfo.php @@ -0,0 +1,265 @@ + 'string', + 'injectedItemKey' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'index' => null, + 'injectedItemKey' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'index' => 'index', + 'injectedItemKey' => 'injectedItemKey', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'index' => 'setIndex', + 'injectedItemKey' => 'setInjectedItemKey', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'index' => 'getIndex', + 'injectedItemKey' => 'getInjectedItemKey', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['index'])) { + $this->container['index'] = $data['index']; + } + if (isset($data['injectedItemKey'])) { + $this->container['injectedItemKey'] = $data['injectedItemKey']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['index']) || null === $this->container['index']) { + $invalidProperties[] = "'index' can't be null"; + } + if (!isset($this->container['injectedItemKey']) || null === $this->container['injectedItemKey']) { + $invalidProperties[] = "'injectedItemKey' 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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets index. + * + * @return string + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index. + * + * @param string $index index + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets injectedItemKey. + * + * @return string + */ + public function getInjectedItemKey() + { + return $this->container['injectedItemKey'] ?? null; + } + + /** + * Sets injectedItemKey. + * + * @param string $injectedItemKey injectedItemKey + * + * @return self + */ + public function setInjectedItemKey($injectedItemKey) + { + $this->container['injectedItemKey'] = $injectedItemKey; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/CompositionRunAppliedRules.php b/lib/Model/Composition/CompositionRunAppliedRules.php new file mode 100644 index 00000000..55ef7414 --- /dev/null +++ b/lib/Model/Composition/CompositionRunAppliedRules.php @@ -0,0 +1,230 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'objectID' => null, + ]; + + /** + * 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', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['objectID']) || null === $this->container['objectID']) { + $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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets objectID. + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID. + * + * @param string $objectID unique record identifier + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/CompositionRunSearchResponse.php b/lib/Model/Composition/CompositionRunSearchResponse.php new file mode 100644 index 00000000..0a0432b4 --- /dev/null +++ b/lib/Model/Composition/CompositionRunSearchResponse.php @@ -0,0 +1,262 @@ + 'string', + 'appliedRules' => '\Algolia\AlgoliaSearch\Model\Composition\CompositionRunAppliedRules[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'objectID' => null, + 'appliedRules' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'objectID' => 'objectID', + 'appliedRules' => 'appliedRules', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'appliedRules' => 'setAppliedRules', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'appliedRules' => 'getAppliedRules', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + if (isset($data['appliedRules'])) { + $this->container['appliedRules'] = $data['appliedRules']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['objectID']) || null === $this->container['objectID']) { + $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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets objectID. + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID. + * + * @param string $objectID unique record identifier + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets appliedRules. + * + * @return null|\Algolia\AlgoliaSearch\Model\Composition\CompositionRunAppliedRules[] + */ + public function getAppliedRules() + { + return $this->container['appliedRules'] ?? null; + } + + /** + * Sets appliedRules. + * + * @param null|\Algolia\AlgoliaSearch\Model\Composition\CompositionRunAppliedRules[] $appliedRules appliedRules + * + * @return self + */ + public function setAppliedRules($appliedRules) + { + $this->container['appliedRules'] = $appliedRules; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/CompositionsSearchResponse.php b/lib/Model/Composition/CompositionsSearchResponse.php new file mode 100644 index 00000000..30fc58e4 --- /dev/null +++ b/lib/Model/Composition/CompositionsSearchResponse.php @@ -0,0 +1,230 @@ + '\Algolia\AlgoliaSearch\Model\Composition\CompositionRunSearchResponse[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'run' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'run' => 'run', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'run' => 'setRun', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'run' => 'getRun', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['run'])) { + $this->container['run'] = $data['run']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['run']) || null === $this->container['run']) { + $invalidProperties[] = "'run' 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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets run. + * + * @return \Algolia\AlgoliaSearch\Model\Composition\CompositionRunSearchResponse[] + */ + public function getRun() + { + return $this->container['run'] ?? null; + } + + /** + * Sets run. + * + * @param \Algolia\AlgoliaSearch\Model\Composition\CompositionRunSearchResponse[] $run run + * + * @return self + */ + public function setRun($run) + { + $this->container['run'] = $run; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/ErrorBase.php b/lib/Model/Composition/ErrorBase.php new file mode 100644 index 00000000..b3d8e81e --- /dev/null +++ b/lib/Model/Composition/ErrorBase.php @@ -0,0 +1,226 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'message' => null, + ]; + + /** + * 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', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['message'])) { + $this->container['message'] = $data['message']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets message. + * + * @return null|string + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message. + * + * @param null|string $message message + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/Exhaustive.php b/lib/Model/Composition/Exhaustive.php new file mode 100644 index 00000000..c47806e4 --- /dev/null +++ b/lib/Model/Composition/Exhaustive.php @@ -0,0 +1,354 @@ + 'bool', + 'facetValues' => 'bool', + 'nbHits' => 'bool', + 'rulesMatch' => 'bool', + 'typo' => 'bool', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'facetsCount' => null, + 'facetValues' => null, + 'nbHits' => null, + 'rulesMatch' => null, + 'typo' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'facetsCount' => 'facetsCount', + 'facetValues' => 'facetValues', + 'nbHits' => 'nbHits', + 'rulesMatch' => 'rulesMatch', + 'typo' => 'typo', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'facetsCount' => 'setFacetsCount', + 'facetValues' => 'setFacetValues', + 'nbHits' => 'setNbHits', + 'rulesMatch' => 'setRulesMatch', + 'typo' => 'setTypo', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'facetsCount' => 'getFacetsCount', + 'facetValues' => 'getFacetValues', + 'nbHits' => 'getNbHits', + 'rulesMatch' => 'getRulesMatch', + 'typo' => 'getTypo', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['facetsCount'])) { + $this->container['facetsCount'] = $data['facetsCount']; + } + if (isset($data['facetValues'])) { + $this->container['facetValues'] = $data['facetValues']; + } + if (isset($data['nbHits'])) { + $this->container['nbHits'] = $data['nbHits']; + } + if (isset($data['rulesMatch'])) { + $this->container['rulesMatch'] = $data['rulesMatch']; + } + if (isset($data['typo'])) { + $this->container['typo'] = $data['typo']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets facetsCount. + * + * @return null|bool + */ + public function getFacetsCount() + { + return $this->container['facetsCount'] ?? null; + } + + /** + * Sets facetsCount. + * + * @param null|bool $facetsCount Whether the facet count is exhaustive (`true`) or approximate (`false`). See the [related discussion](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-). + * + * @return self + */ + public function setFacetsCount($facetsCount) + { + $this->container['facetsCount'] = $facetsCount; + + return $this; + } + + /** + * Gets facetValues. + * + * @return null|bool + */ + public function getFacetValues() + { + return $this->container['facetValues'] ?? null; + } + + /** + * Sets facetValues. + * + * @param null|bool $facetValues the value is `false` if not all facet values are retrieved + * + * @return self + */ + public function setFacetValues($facetValues) + { + $this->container['facetValues'] = $facetValues; + + return $this; + } + + /** + * Gets nbHits. + * + * @return null|bool + */ + public function getNbHits() + { + return $this->container['nbHits'] ?? null; + } + + /** + * Sets nbHits. + * + * @param null|bool $nbHits Whether the `nbHits` is exhaustive (`true`) or approximate (`false`). When the query takes more than 50ms to be processed, the engine makes an approximation. This can happen when using complex filters on millions of records, when typo-tolerance was not exhaustive, or when enough hits have been retrieved (for example, after the engine finds 10,000 exact matches). `nbHits` is reported as non-exhaustive whenever an approximation is made, even if the approximation didn’t, in the end, impact the exhaustivity of the query. + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets rulesMatch. + * + * @return null|bool + */ + public function getRulesMatch() + { + return $this->container['rulesMatch'] ?? null; + } + + /** + * Sets rulesMatch. + * + * @param null|bool $rulesMatch Rules matching exhaustivity. The value is `false` if rules were enable for this query, and could not be fully processed due a timeout. This is generally caused by the number of alternatives (such as typos) which is too large. + * + * @return self + */ + public function setRulesMatch($rulesMatch) + { + $this->container['rulesMatch'] = $rulesMatch; + + return $this; + } + + /** + * Gets typo. + * + * @return null|bool + */ + public function getTypo() + { + return $this->container['typo'] ?? null; + } + + /** + * Sets typo. + * + * @param null|bool $typo Whether the typo search was exhaustive (`true`) or approximate (`false`). An approximation is done when the typo search query part takes more than 10% of the query budget (ie. 5ms by default) to be processed (this can happen when a lot of typo alternatives exist for the query). This field will not be included when typo-tolerance is entirely disabled. + * + * @return self + */ + public function setTypo($typo) + { + $this->container['typo'] = $typo; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/FacetFilters.php b/lib/Model/Composition/FacetFilters.php new file mode 100644 index 00000000..bbefe4e7 --- /dev/null +++ b/lib/Model/Composition/FacetFilters.php @@ -0,0 +1,190 @@ +listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/FacetHits.php b/lib/Model/Composition/FacetHits.php new file mode 100644 index 00000000..ccafbcb5 --- /dev/null +++ b/lib/Model/Composition/FacetHits.php @@ -0,0 +1,300 @@ + 'string', + 'highlighted' => 'string', + 'count' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'value' => null, + 'highlighted' => null, + 'count' => null, + ]; + + /** + * 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', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['value'])) { + $this->container['value'] = $data['value']; + } + if (isset($data['highlighted'])) { + $this->container['highlighted'] = $data['highlighted']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['value']) || null === $this->container['value']) { + $invalidProperties[] = "'value' can't be null"; + } + if (!isset($this->container['highlighted']) || null === $this->container['highlighted']) { + $invalidProperties[] = "'highlighted' can't be null"; + } + if (!isset($this->container['count']) || null === $this->container['count']) { + $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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets value. + * + * @return string + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value. + * + * @param string $value facet value + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets highlighted. + * + * @return string + */ + public function getHighlighted() + { + return $this->container['highlighted'] ?? null; + } + + /** + * Sets highlighted. + * + * @param string $highlighted highlighted attribute value, including HTML tags + * + * @return self + */ + public function setHighlighted($highlighted) + { + $this->container['highlighted'] = $highlighted; + + return $this; + } + + /** + * Gets count. + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count. + * + * @param int $count Number of records with this facet value. [The count may be approximated](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-). + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/FacetOrdering.php b/lib/Model/Composition/FacetOrdering.php new file mode 100644 index 00000000..51088a09 --- /dev/null +++ b/lib/Model/Composition/FacetOrdering.php @@ -0,0 +1,258 @@ + '\Algolia\AlgoliaSearch\Model\Composition\Facets', + 'values' => 'array', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'facets' => null, + 'values' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'facets' => 'facets', + 'values' => 'values', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'facets' => 'setFacets', + 'values' => 'setValues', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'facets' => 'getFacets', + 'values' => 'getValues', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['facets'])) { + $this->container['facets'] = $data['facets']; + } + if (isset($data['values'])) { + $this->container['values'] = $data['values']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets facets. + * + * @return null|Facets + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets. + * + * @param null|Facets $facets facets + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets values. + * + * @return null|array + */ + public function getValues() + { + return $this->container['values'] ?? null; + } + + /** + * Sets values. + * + * @param null|array $values Order of facet values. One object for each facet. + * + * @return self + */ + public function setValues($values) + { + $this->container['values'] = $values; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/FacetStats.php b/lib/Model/Composition/FacetStats.php new file mode 100644 index 00000000..79790b17 --- /dev/null +++ b/lib/Model/Composition/FacetStats.php @@ -0,0 +1,320 @@ + 'float', + 'max' => 'float', + 'avg' => 'float', + 'sum' => 'float', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'min' => 'double', + 'max' => 'double', + 'avg' => 'double', + 'sum' => 'double', + ]; + + /** + * 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', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['min'])) { + $this->container['min'] = $data['min']; + } + if (isset($data['max'])) { + $this->container['max'] = $data['max']; + } + if (isset($data['avg'])) { + $this->container['avg'] = $data['avg']; + } + if (isset($data['sum'])) { + $this->container['sum'] = $data['sum']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets min. + * + * @return null|float + */ + public function getMin() + { + return $this->container['min'] ?? null; + } + + /** + * Sets min. + * + * @param null|float $min minimum value in the results + * + * @return self + */ + public function setMin($min) + { + $this->container['min'] = $min; + + return $this; + } + + /** + * Gets max. + * + * @return null|float + */ + public function getMax() + { + return $this->container['max'] ?? null; + } + + /** + * Sets max. + * + * @param null|float $max maximum value in the results + * + * @return self + */ + public function setMax($max) + { + $this->container['max'] = $max; + + return $this; + } + + /** + * Gets avg. + * + * @return null|float + */ + public function getAvg() + { + return $this->container['avg'] ?? null; + } + + /** + * Sets avg. + * + * @param null|float $avg average facet value in the results + * + * @return self + */ + public function setAvg($avg) + { + $this->container['avg'] = $avg; + + return $this; + } + + /** + * Gets sum. + * + * @return null|float + */ + public function getSum() + { + return $this->container['sum'] ?? null; + } + + /** + * Sets sum. + * + * @param null|float $sum sum of all values in the results + * + * @return self + */ + public function setSum($sum) + { + $this->container['sum'] = $sum; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/Facets.php b/lib/Model/Composition/Facets.php new file mode 100644 index 00000000..b04e1aee --- /dev/null +++ b/lib/Model/Composition/Facets.php @@ -0,0 +1,226 @@ + 'string[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'order' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'order' => 'order', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'order' => 'setOrder', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'order' => 'getOrder', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['order'])) { + $this->container['order'] = $data['order']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets order. + * + * @return null|string[] + */ + public function getOrder() + { + return $this->container['order'] ?? null; + } + + /** + * Sets order. + * + * @param null|string[] $order Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at the top of the list. + * + * @return self + */ + public function setOrder($order) + { + $this->container['order'] = $order; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/HighlightResult.php b/lib/Model/Composition/HighlightResult.php new file mode 100644 index 00000000..30fd9458 --- /dev/null +++ b/lib/Model/Composition/HighlightResult.php @@ -0,0 +1,332 @@ + 'string', + 'matchLevel' => '\Algolia\AlgoliaSearch\Model\Composition\MatchLevel', + 'matchedWords' => 'string[]', + 'fullyHighlighted' => 'bool', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'value' => null, + 'matchLevel' => null, + 'matchedWords' => null, + 'fullyHighlighted' => null, + ]; + + /** + * 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', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['value'])) { + $this->container['value'] = $data['value']; + } + if (isset($data['matchLevel'])) { + $this->container['matchLevel'] = $data['matchLevel']; + } + if (isset($data['matchedWords'])) { + $this->container['matchedWords'] = $data['matchedWords']; + } + if (isset($data['fullyHighlighted'])) { + $this->container['fullyHighlighted'] = $data['fullyHighlighted']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['value']) || null === $this->container['value']) { + $invalidProperties[] = "'value' can't be null"; + } + if (!isset($this->container['matchLevel']) || null === $this->container['matchLevel']) { + $invalidProperties[] = "'matchLevel' can't be null"; + } + if (!isset($this->container['matchedWords']) || null === $this->container['matchedWords']) { + $invalidProperties[] = "'matchedWords' 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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets value. + * + * @return string + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value. + * + * @param string $value highlighted attribute value, including HTML tags + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matchLevel. + * + * @return MatchLevel + */ + public function getMatchLevel() + { + return $this->container['matchLevel'] ?? null; + } + + /** + * Sets matchLevel. + * + * @param MatchLevel $matchLevel matchLevel + * + * @return self + */ + public function setMatchLevel($matchLevel) + { + $this->container['matchLevel'] = $matchLevel; + + return $this; + } + + /** + * Gets matchedWords. + * + * @return string[] + */ + public function getMatchedWords() + { + return $this->container['matchedWords'] ?? null; + } + + /** + * Sets matchedWords. + * + * @param string[] $matchedWords list of matched words from the search query + * + * @return self + */ + public function setMatchedWords($matchedWords) + { + $this->container['matchedWords'] = $matchedWords; + + return $this; + } + + /** + * Gets fullyHighlighted. + * + * @return null|bool + */ + public function getFullyHighlighted() + { + return $this->container['fullyHighlighted'] ?? null; + } + + /** + * Sets fullyHighlighted. + * + * @param null|bool $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 + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/HighlightResultOption.php b/lib/Model/Composition/HighlightResultOption.php new file mode 100644 index 00000000..44fc31e7 --- /dev/null +++ b/lib/Model/Composition/HighlightResultOption.php @@ -0,0 +1,334 @@ + 'string', + 'matchLevel' => '\Algolia\AlgoliaSearch\Model\Composition\MatchLevel', + 'matchedWords' => 'string[]', + 'fullyHighlighted' => 'bool', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'value' => null, + 'matchLevel' => null, + 'matchedWords' => null, + 'fullyHighlighted' => null, + ]; + + /** + * 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', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['value'])) { + $this->container['value'] = $data['value']; + } + if (isset($data['matchLevel'])) { + $this->container['matchLevel'] = $data['matchLevel']; + } + if (isset($data['matchedWords'])) { + $this->container['matchedWords'] = $data['matchedWords']; + } + if (isset($data['fullyHighlighted'])) { + $this->container['fullyHighlighted'] = $data['fullyHighlighted']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['value']) || null === $this->container['value']) { + $invalidProperties[] = "'value' can't be null"; + } + if (!isset($this->container['matchLevel']) || null === $this->container['matchLevel']) { + $invalidProperties[] = "'matchLevel' can't be null"; + } + if (!isset($this->container['matchedWords']) || null === $this->container['matchedWords']) { + $invalidProperties[] = "'matchedWords' 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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets value. + * + * @return string + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value. + * + * @param string $value highlighted attribute value, including HTML tags + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matchLevel. + * + * @return MatchLevel + */ + public function getMatchLevel() + { + return $this->container['matchLevel'] ?? null; + } + + /** + * Sets matchLevel. + * + * @param MatchLevel $matchLevel matchLevel + * + * @return self + */ + public function setMatchLevel($matchLevel) + { + $this->container['matchLevel'] = $matchLevel; + + return $this; + } + + /** + * Gets matchedWords. + * + * @return string[] + */ + public function getMatchedWords() + { + return $this->container['matchedWords'] ?? null; + } + + /** + * Sets matchedWords. + * + * @param string[] $matchedWords list of matched words from the search query + * + * @return self + */ + public function setMatchedWords($matchedWords) + { + $this->container['matchedWords'] = $matchedWords; + + return $this; + } + + /** + * Gets fullyHighlighted. + * + * @return null|bool + */ + public function getFullyHighlighted() + { + return $this->container['fullyHighlighted'] ?? null; + } + + /** + * Sets fullyHighlighted. + * + * @param null|bool $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 + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/Hit.php b/lib/Model/Composition/Hit.php new file mode 100644 index 00000000..c480c493 --- /dev/null +++ b/lib/Model/Composition/Hit.php @@ -0,0 +1,360 @@ + 'string', + 'highlightResult' => 'array', + 'snippetResult' => 'array', + 'rankingInfo' => '\Algolia\AlgoliaSearch\Model\Composition\HitRankingInfo', + 'distinctSeqID' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'objectID' => null, + 'highlightResult' => null, + 'snippetResult' => null, + 'rankingInfo' => null, + 'distinctSeqID' => null, + ]; + + /** + * 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', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + if (isset($data['highlightResult'])) { + $this->container['highlightResult'] = $data['highlightResult']; + } + if (isset($data['snippetResult'])) { + $this->container['snippetResult'] = $data['snippetResult']; + } + if (isset($data['rankingInfo'])) { + $this->container['rankingInfo'] = $data['rankingInfo']; + } + if (isset($data['distinctSeqID'])) { + $this->container['distinctSeqID'] = $data['distinctSeqID']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['objectID']) || null === $this->container['objectID']) { + $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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets objectID. + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID. + * + * @param string $objectID unique record identifier + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets highlightResult. + * + * @return null|array + */ + public function getHighlightResult() + { + return $this->container['highlightResult'] ?? null; + } + + /** + * Sets highlightResult. + * + * @param null|array $highlightResult surround words that match the query with HTML tags for highlighting + * + * @return self + */ + public function setHighlightResult($highlightResult) + { + $this->container['highlightResult'] = $highlightResult; + + return $this; + } + + /** + * Gets snippetResult. + * + * @return null|array + */ + public function getSnippetResult() + { + return $this->container['snippetResult'] ?? null; + } + + /** + * Sets snippetResult. + * + * @param null|array $snippetResult snippets that show the context around a matching search query + * + * @return self + */ + public function setSnippetResult($snippetResult) + { + $this->container['snippetResult'] = $snippetResult; + + return $this; + } + + /** + * Gets rankingInfo. + * + * @return null|HitRankingInfo + */ + public function getRankingInfo() + { + return $this->container['rankingInfo'] ?? null; + } + + /** + * Sets rankingInfo. + * + * @param null|HitRankingInfo $rankingInfo rankingInfo + * + * @return self + */ + public function setRankingInfo($rankingInfo) + { + $this->container['rankingInfo'] = $rankingInfo; + + return $this; + } + + /** + * Gets distinctSeqID. + * + * @return null|int + */ + public function getDistinctSeqID() + { + return $this->container['distinctSeqID'] ?? null; + } + + /** + * Sets distinctSeqID. + * + * @param null|int $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 + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/HitRankingInfo.php b/lib/Model/Composition/HitRankingInfo.php new file mode 100644 index 00000000..3c725813 --- /dev/null +++ b/lib/Model/Composition/HitRankingInfo.php @@ -0,0 +1,658 @@ + 'int', + 'firstMatchedWord' => 'int', + 'geoDistance' => 'int', + 'geoPrecision' => 'int', + 'matchedGeoLocation' => '\Algolia\AlgoliaSearch\Model\Composition\MatchedGeoLocation', + 'personalization' => '\Algolia\AlgoliaSearch\Model\Composition\Personalization', + 'nbExactWords' => 'int', + 'nbTypos' => 'int', + 'promoted' => 'bool', + 'proximityDistance' => 'int', + 'userScore' => 'int', + 'words' => 'int', + 'promotedByReRanking' => 'bool', + 'composed' => 'array', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'filters' => null, + 'firstMatchedWord' => null, + 'geoDistance' => null, + 'geoPrecision' => null, + 'matchedGeoLocation' => null, + 'personalization' => null, + 'nbExactWords' => null, + 'nbTypos' => null, + 'promoted' => null, + 'proximityDistance' => null, + 'userScore' => null, + 'words' => null, + 'promotedByReRanking' => null, + 'composed' => null, + ]; + + /** + * 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', + 'personalization' => 'personalization', + 'nbExactWords' => 'nbExactWords', + 'nbTypos' => 'nbTypos', + 'promoted' => 'promoted', + 'proximityDistance' => 'proximityDistance', + 'userScore' => 'userScore', + 'words' => 'words', + 'promotedByReRanking' => 'promotedByReRanking', + 'composed' => 'composed', + ]; + + /** + * 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', + 'personalization' => 'setPersonalization', + 'nbExactWords' => 'setNbExactWords', + 'nbTypos' => 'setNbTypos', + 'promoted' => 'setPromoted', + 'proximityDistance' => 'setProximityDistance', + 'userScore' => 'setUserScore', + 'words' => 'setWords', + 'promotedByReRanking' => 'setPromotedByReRanking', + 'composed' => 'setComposed', + ]; + + /** + * 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', + 'personalization' => 'getPersonalization', + 'nbExactWords' => 'getNbExactWords', + 'nbTypos' => 'getNbTypos', + 'promoted' => 'getPromoted', + 'proximityDistance' => 'getProximityDistance', + 'userScore' => 'getUserScore', + 'words' => 'getWords', + 'promotedByReRanking' => 'getPromotedByReRanking', + 'composed' => 'getComposed', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['filters'])) { + $this->container['filters'] = $data['filters']; + } + if (isset($data['firstMatchedWord'])) { + $this->container['firstMatchedWord'] = $data['firstMatchedWord']; + } + if (isset($data['geoDistance'])) { + $this->container['geoDistance'] = $data['geoDistance']; + } + if (isset($data['geoPrecision'])) { + $this->container['geoPrecision'] = $data['geoPrecision']; + } + if (isset($data['matchedGeoLocation'])) { + $this->container['matchedGeoLocation'] = $data['matchedGeoLocation']; + } + if (isset($data['personalization'])) { + $this->container['personalization'] = $data['personalization']; + } + if (isset($data['nbExactWords'])) { + $this->container['nbExactWords'] = $data['nbExactWords']; + } + if (isset($data['nbTypos'])) { + $this->container['nbTypos'] = $data['nbTypos']; + } + if (isset($data['promoted'])) { + $this->container['promoted'] = $data['promoted']; + } + if (isset($data['proximityDistance'])) { + $this->container['proximityDistance'] = $data['proximityDistance']; + } + if (isset($data['userScore'])) { + $this->container['userScore'] = $data['userScore']; + } + if (isset($data['words'])) { + $this->container['words'] = $data['words']; + } + if (isset($data['promotedByReRanking'])) { + $this->container['promotedByReRanking'] = $data['promotedByReRanking']; + } + if (isset($data['composed'])) { + $this->container['composed'] = $data['composed']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['firstMatchedWord']) || null === $this->container['firstMatchedWord']) { + $invalidProperties[] = "'firstMatchedWord' can't be null"; + } + if (!isset($this->container['geoDistance']) || null === $this->container['geoDistance']) { + $invalidProperties[] = "'geoDistance' can't be null"; + } + if (!isset($this->container['nbExactWords']) || null === $this->container['nbExactWords']) { + $invalidProperties[] = "'nbExactWords' can't be null"; + } + if (!isset($this->container['nbTypos']) || null === $this->container['nbTypos']) { + $invalidProperties[] = "'nbTypos' can't be null"; + } + if (!isset($this->container['userScore']) || null === $this->container['userScore']) { + $invalidProperties[] = "'userScore' 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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets filters. + * + * @return null|int + */ + public function getFilters() + { + return $this->container['filters'] ?? null; + } + + /** + * Sets filters. + * + * @param null|int $filters whether a filter matched the query + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets firstMatchedWord. + * + * @return int + */ + public function getFirstMatchedWord() + { + return $this->container['firstMatchedWord'] ?? null; + } + + /** + * Sets firstMatchedWord. + * + * @param int $firstMatchedWord position of the first matched word in the best matching attribute of the record + * + * @return self + */ + public function setFirstMatchedWord($firstMatchedWord) + { + $this->container['firstMatchedWord'] = $firstMatchedWord; + + return $this; + } + + /** + * Gets geoDistance. + * + * @return int + */ + public function getGeoDistance() + { + return $this->container['geoDistance'] ?? null; + } + + /** + * Sets geoDistance. + * + * @param int $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 null|int + */ + public function getGeoPrecision() + { + return $this->container['geoPrecision'] ?? null; + } + + /** + * Sets geoPrecision. + * + * @param null|int $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 null|MatchedGeoLocation + */ + public function getMatchedGeoLocation() + { + return $this->container['matchedGeoLocation'] ?? null; + } + + /** + * Sets matchedGeoLocation. + * + * @param null|MatchedGeoLocation $matchedGeoLocation matchedGeoLocation + * + * @return self + */ + public function setMatchedGeoLocation($matchedGeoLocation) + { + $this->container['matchedGeoLocation'] = $matchedGeoLocation; + + return $this; + } + + /** + * Gets personalization. + * + * @return null|Personalization + */ + public function getPersonalization() + { + return $this->container['personalization'] ?? null; + } + + /** + * Sets personalization. + * + * @param null|Personalization $personalization personalization + * + * @return self + */ + public function setPersonalization($personalization) + { + $this->container['personalization'] = $personalization; + + return $this; + } + + /** + * Gets nbExactWords. + * + * @return int + */ + public function getNbExactWords() + { + return $this->container['nbExactWords'] ?? null; + } + + /** + * Sets nbExactWords. + * + * @param int $nbExactWords number of exactly matched words + * + * @return self + */ + public function setNbExactWords($nbExactWords) + { + $this->container['nbExactWords'] = $nbExactWords; + + return $this; + } + + /** + * Gets nbTypos. + * + * @return int + */ + public function getNbTypos() + { + return $this->container['nbTypos'] ?? null; + } + + /** + * Sets nbTypos. + * + * @param int $nbTypos number of typos encountered when matching the record + * + * @return self + */ + public function setNbTypos($nbTypos) + { + $this->container['nbTypos'] = $nbTypos; + + return $this; + } + + /** + * Gets promoted. + * + * @return null|bool + */ + public function getPromoted() + { + return $this->container['promoted'] ?? null; + } + + /** + * Sets promoted. + * + * @param null|bool $promoted whether the record was promoted by a rule + * + * @return self + */ + public function setPromoted($promoted) + { + $this->container['promoted'] = $promoted; + + return $this; + } + + /** + * Gets proximityDistance. + * + * @return null|int + */ + public function getProximityDistance() + { + return $this->container['proximityDistance'] ?? null; + } + + /** + * Sets proximityDistance. + * + * @param null|int $proximityDistance Number of words between multiple matches in the query plus 1. For single word queries, `proximityDistance` is 0. + * + * @return self + */ + public function setProximityDistance($proximityDistance) + { + $this->container['proximityDistance'] = $proximityDistance; + + return $this; + } + + /** + * Gets userScore. + * + * @return int + */ + public function getUserScore() + { + return $this->container['userScore'] ?? null; + } + + /** + * Sets userScore. + * + * @param int $userScore Overall ranking of the record, expressed as a single integer. This attribute is internal. + * + * @return self + */ + public function setUserScore($userScore) + { + $this->container['userScore'] = $userScore; + + return $this; + } + + /** + * Gets words. + * + * @return null|int + */ + public function getWords() + { + return $this->container['words'] ?? null; + } + + /** + * Sets words. + * + * @param null|int $words number of matched words + * + * @return self + */ + public function setWords($words) + { + $this->container['words'] = $words; + + return $this; + } + + /** + * Gets promotedByReRanking. + * + * @return null|bool + */ + public function getPromotedByReRanking() + { + return $this->container['promotedByReRanking'] ?? null; + } + + /** + * Sets promotedByReRanking. + * + * @param null|bool $promotedByReRanking whether the record is re-ranked + * + * @return self + */ + public function setPromotedByReRanking($promotedByReRanking) + { + $this->container['promotedByReRanking'] = $promotedByReRanking; + + return $this; + } + + /** + * Gets composed. + * + * @return null|array + */ + public function getComposed() + { + return $this->container['composed'] ?? null; + } + + /** + * Sets composed. + * + * @param null|array $composed composed + * + * @return self + */ + public function setComposed($composed) + { + $this->container['composed'] = $composed; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/InsideBoundingBox.php b/lib/Model/Composition/InsideBoundingBox.php new file mode 100644 index 00000000..d46d39f8 --- /dev/null +++ b/lib/Model/Composition/InsideBoundingBox.php @@ -0,0 +1,188 @@ +listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/MatchLevel.php b/lib/Model/Composition/MatchLevel.php new file mode 100644 index 00000000..69f34ad3 --- /dev/null +++ b/lib/Model/Composition/MatchLevel.php @@ -0,0 +1,38 @@ + 'float', + 'lng' => 'float', + 'distance' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'lat' => 'double', + 'lng' => 'double', + 'distance' => null, + ]; + + /** + * 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', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['lat'])) { + $this->container['lat'] = $data['lat']; + } + if (isset($data['lng'])) { + $this->container['lng'] = $data['lng']; + } + if (isset($data['distance'])) { + $this->container['distance'] = $data['distance']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets lat. + * + * @return null|float + */ + public function getLat() + { + return $this->container['lat'] ?? null; + } + + /** + * Sets lat. + * + * @param null|float $lat latitude of the matched location + * + * @return self + */ + public function setLat($lat) + { + $this->container['lat'] = $lat; + + return $this; + } + + /** + * Gets lng. + * + * @return null|float + */ + public function getLng() + { + return $this->container['lng'] ?? null; + } + + /** + * Sets lng. + * + * @param null|float $lng longitude of the matched location + * + * @return self + */ + public function setLng($lng) + { + $this->container['lng'] = $lng; + + return $this; + } + + /** + * Gets distance. + * + * @return null|int + */ + public function getDistance() + { + return $this->container['distance'] ?? null; + } + + /** + * Sets distance. + * + * @param null|int $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 + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/NumericFilters.php b/lib/Model/Composition/NumericFilters.php new file mode 100644 index 00000000..6c177f61 --- /dev/null +++ b/lib/Model/Composition/NumericFilters.php @@ -0,0 +1,190 @@ +`, `>=`. Comparisons are precise up to 3 decimals. You can also provide ranges: `facet: TO `. The range includes the lower and upper boundaries. The same combination rules apply as for `facetFilters`. + */ +class NumericFilters extends AbstractModel implements ModelInterface, \ArrayAccess, \JsonSerializable +{ + /** + * Array of property to type mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelTypes = [ + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + */ + public function __construct() {} + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/OptionalFilters.php b/lib/Model/Composition/OptionalFilters.php new file mode 100644 index 00000000..72915683 --- /dev/null +++ b/lib/Model/Composition/OptionalFilters.php @@ -0,0 +1,190 @@ +listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/Params.php b/lib/Model/Composition/Params.php new file mode 100644 index 00000000..4f3488d5 --- /dev/null +++ b/lib/Model/Composition/Params.php @@ -0,0 +1,1024 @@ + 'string', + 'filters' => 'string', + 'page' => 'int', + 'getRankingInfo' => 'bool', + 'relevancyStrictness' => 'int', + 'facetFilters' => '\Algolia\AlgoliaSearch\Model\Composition\FacetFilters', + 'optionalFilters' => '\Algolia\AlgoliaSearch\Model\Composition\OptionalFilters', + 'numericFilters' => '\Algolia\AlgoliaSearch\Model\Composition\NumericFilters', + 'hitsPerPage' => 'int', + 'aroundLatLng' => 'string', + 'aroundLatLngViaIP' => 'bool', + 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Composition\AroundRadius', + 'aroundPrecision' => '\Algolia\AlgoliaSearch\Model\Composition\AroundPrecision', + 'minimumAroundRadius' => 'int', + 'insideBoundingBox' => '\Algolia\AlgoliaSearch\Model\Composition\InsideBoundingBox', + 'insidePolygon' => 'float[][]', + 'queryLanguages' => '\Algolia\AlgoliaSearch\Model\Composition\SupportedLanguage[]', + 'naturalLanguages' => '\Algolia\AlgoliaSearch\Model\Composition\SupportedLanguage[]', + 'enableRules' => 'bool', + 'ruleContexts' => 'string[]', + 'userToken' => 'string', + 'clickAnalytics' => 'bool', + 'analytics' => 'bool', + 'analyticsTags' => 'string[]', + 'enableABTest' => 'bool', + 'enableReRanking' => 'bool', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'query' => null, + 'filters' => null, + 'page' => null, + 'getRankingInfo' => null, + 'relevancyStrictness' => null, + 'facetFilters' => null, + 'optionalFilters' => null, + 'numericFilters' => null, + 'hitsPerPage' => null, + 'aroundLatLng' => null, + 'aroundLatLngViaIP' => null, + 'aroundRadius' => null, + 'aroundPrecision' => null, + 'minimumAroundRadius' => null, + 'insideBoundingBox' => null, + 'insidePolygon' => 'double', + 'queryLanguages' => null, + 'naturalLanguages' => null, + 'enableRules' => null, + 'ruleContexts' => null, + 'userToken' => null, + 'clickAnalytics' => null, + 'analytics' => null, + 'analyticsTags' => null, + 'enableABTest' => null, + 'enableReRanking' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'query' => 'query', + 'filters' => 'filters', + 'page' => 'page', + 'getRankingInfo' => 'getRankingInfo', + 'relevancyStrictness' => 'relevancyStrictness', + 'facetFilters' => 'facetFilters', + 'optionalFilters' => 'optionalFilters', + 'numericFilters' => 'numericFilters', + 'hitsPerPage' => 'hitsPerPage', + 'aroundLatLng' => 'aroundLatLng', + 'aroundLatLngViaIP' => 'aroundLatLngViaIP', + 'aroundRadius' => 'aroundRadius', + 'aroundPrecision' => 'aroundPrecision', + 'minimumAroundRadius' => 'minimumAroundRadius', + 'insideBoundingBox' => 'insideBoundingBox', + 'insidePolygon' => 'insidePolygon', + 'queryLanguages' => 'queryLanguages', + 'naturalLanguages' => 'naturalLanguages', + 'enableRules' => 'enableRules', + 'ruleContexts' => 'ruleContexts', + 'userToken' => 'userToken', + 'clickAnalytics' => 'clickAnalytics', + 'analytics' => 'analytics', + 'analyticsTags' => 'analyticsTags', + 'enableABTest' => 'enableABTest', + 'enableReRanking' => 'enableReRanking', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'filters' => 'setFilters', + 'page' => 'setPage', + 'getRankingInfo' => 'setGetRankingInfo', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'facetFilters' => 'setFacetFilters', + 'optionalFilters' => 'setOptionalFilters', + 'numericFilters' => 'setNumericFilters', + 'hitsPerPage' => 'setHitsPerPage', + 'aroundLatLng' => 'setAroundLatLng', + 'aroundLatLngViaIP' => 'setAroundLatLngViaIP', + 'aroundRadius' => 'setAroundRadius', + 'aroundPrecision' => 'setAroundPrecision', + 'minimumAroundRadius' => 'setMinimumAroundRadius', + 'insideBoundingBox' => 'setInsideBoundingBox', + 'insidePolygon' => 'setInsidePolygon', + 'queryLanguages' => 'setQueryLanguages', + 'naturalLanguages' => 'setNaturalLanguages', + 'enableRules' => 'setEnableRules', + 'ruleContexts' => 'setRuleContexts', + 'userToken' => 'setUserToken', + 'clickAnalytics' => 'setClickAnalytics', + 'analytics' => 'setAnalytics', + 'analyticsTags' => 'setAnalyticsTags', + 'enableABTest' => 'setEnableABTest', + 'enableReRanking' => 'setEnableReRanking', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'filters' => 'getFilters', + 'page' => 'getPage', + 'getRankingInfo' => 'getGetRankingInfo', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'facetFilters' => 'getFacetFilters', + 'optionalFilters' => 'getOptionalFilters', + 'numericFilters' => 'getNumericFilters', + 'hitsPerPage' => 'getHitsPerPage', + 'aroundLatLng' => 'getAroundLatLng', + 'aroundLatLngViaIP' => 'getAroundLatLngViaIP', + 'aroundRadius' => 'getAroundRadius', + 'aroundPrecision' => 'getAroundPrecision', + 'minimumAroundRadius' => 'getMinimumAroundRadius', + 'insideBoundingBox' => 'getInsideBoundingBox', + 'insidePolygon' => 'getInsidePolygon', + 'queryLanguages' => 'getQueryLanguages', + 'naturalLanguages' => 'getNaturalLanguages', + 'enableRules' => 'getEnableRules', + 'ruleContexts' => 'getRuleContexts', + 'userToken' => 'getUserToken', + 'clickAnalytics' => 'getClickAnalytics', + 'analytics' => 'getAnalytics', + 'analyticsTags' => 'getAnalyticsTags', + 'enableABTest' => 'getEnableABTest', + 'enableReRanking' => 'getEnableReRanking', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['filters'])) { + $this->container['filters'] = $data['filters']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['getRankingInfo'])) { + $this->container['getRankingInfo'] = $data['getRankingInfo']; + } + if (isset($data['relevancyStrictness'])) { + $this->container['relevancyStrictness'] = $data['relevancyStrictness']; + } + if (isset($data['facetFilters'])) { + $this->container['facetFilters'] = $data['facetFilters']; + } + if (isset($data['optionalFilters'])) { + $this->container['optionalFilters'] = $data['optionalFilters']; + } + if (isset($data['numericFilters'])) { + $this->container['numericFilters'] = $data['numericFilters']; + } + if (isset($data['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + if (isset($data['aroundLatLng'])) { + $this->container['aroundLatLng'] = $data['aroundLatLng']; + } + if (isset($data['aroundLatLngViaIP'])) { + $this->container['aroundLatLngViaIP'] = $data['aroundLatLngViaIP']; + } + if (isset($data['aroundRadius'])) { + $this->container['aroundRadius'] = $data['aroundRadius']; + } + if (isset($data['aroundPrecision'])) { + $this->container['aroundPrecision'] = $data['aroundPrecision']; + } + if (isset($data['minimumAroundRadius'])) { + $this->container['minimumAroundRadius'] = $data['minimumAroundRadius']; + } + if (isset($data['insideBoundingBox'])) { + $this->container['insideBoundingBox'] = $data['insideBoundingBox']; + } + if (isset($data['insidePolygon'])) { + $this->container['insidePolygon'] = $data['insidePolygon']; + } + if (isset($data['queryLanguages'])) { + $this->container['queryLanguages'] = $data['queryLanguages']; + } + if (isset($data['naturalLanguages'])) { + $this->container['naturalLanguages'] = $data['naturalLanguages']; + } + if (isset($data['enableRules'])) { + $this->container['enableRules'] = $data['enableRules']; + } + if (isset($data['ruleContexts'])) { + $this->container['ruleContexts'] = $data['ruleContexts']; + } + if (isset($data['userToken'])) { + $this->container['userToken'] = $data['userToken']; + } + if (isset($data['clickAnalytics'])) { + $this->container['clickAnalytics'] = $data['clickAnalytics']; + } + if (isset($data['analytics'])) { + $this->container['analytics'] = $data['analytics']; + } + if (isset($data['analyticsTags'])) { + $this->container['analyticsTags'] = $data['analyticsTags']; + } + if (isset($data['enableABTest'])) { + $this->container['enableABTest'] = $data['enableABTest']; + } + if (isset($data['enableReRanking'])) { + $this->container['enableReRanking'] = $data['enableReRanking']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets query. + * + * @return null|string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query. + * + * @param null|string $query search query + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets filters. + * + * @return null|string + */ + public function getFilters() + { + return $this->container['filters'] ?? null; + } + + /** + * Sets filters. + * + * @param null|string $filters Filter expression to only include items that match the filter criteria in the response. You can use these filter expressions: - **Numeric filters.** ` `, where `` is one of `<`, `<=`, `=`, `!=`, `>`, `>=`. - **Ranges.** `: TO ` where `` and `` are the lower and upper limits of the range (inclusive). - **Facet filters.** `:` where `` is a facet attribute (case-sensitive) and `` a facet value. - **Tag filters.** `_tags:` or just `` (case-sensitive). - **Boolean filters.** `: true | false`. You can combine filters with `AND`, `OR`, and `NOT` operators with the following restrictions: - You can only combine filters of the same type with `OR`. **Not supported:** `facet:value OR num > 3`. - You can't use `NOT` with combinations of filters. **Not supported:** `NOT(facet:value OR facet:value)` - You can't combine conjunctions (`AND`) with `OR`. **Not supported:** `facet:value OR (facet:value AND facet:value)` Use quotes around your filters, if the facet attribute name or facet value has spaces, keywords (`OR`, `AND`, `NOT`), or quotes. If a facet attribute is an array, the filter matches if it matches at least one element of the array. For more information, see [Filters](https://www.algolia.com/doc/guides/managing-results/refine-results/filtering/). + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets page. + * + * @return null|int + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page. + * + * @param null|int $page page of search results to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets getRankingInfo. + * + * @return null|bool + */ + public function getGetRankingInfo() + { + return $this->container['getRankingInfo'] ?? null; + } + + /** + * Sets getRankingInfo. + * + * @param null|bool $getRankingInfo whether the search response should include detailed ranking information + * + * @return self + */ + public function setGetRankingInfo($getRankingInfo) + { + $this->container['getRankingInfo'] = $getRankingInfo; + + return $this; + } + + /** + * Gets relevancyStrictness. + * + * @return null|int + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness'] ?? null; + } + + /** + * Sets relevancyStrictness. + * + * @param null|int $relevancyStrictness relevancyStrictness + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets facetFilters. + * + * @return null|FacetFilters + */ + public function getFacetFilters() + { + return $this->container['facetFilters'] ?? null; + } + + /** + * Sets facetFilters. + * + * @param null|FacetFilters $facetFilters facetFilters + * + * @return self + */ + public function setFacetFilters($facetFilters) + { + $this->container['facetFilters'] = $facetFilters; + + return $this; + } + + /** + * Gets optionalFilters. + * + * @return null|OptionalFilters + */ + public function getOptionalFilters() + { + return $this->container['optionalFilters'] ?? null; + } + + /** + * Sets optionalFilters. + * + * @param null|OptionalFilters $optionalFilters optionalFilters + * + * @return self + */ + public function setOptionalFilters($optionalFilters) + { + $this->container['optionalFilters'] = $optionalFilters; + + return $this; + } + + /** + * Gets numericFilters. + * + * @return null|NumericFilters + */ + public function getNumericFilters() + { + return $this->container['numericFilters'] ?? null; + } + + /** + * Sets numericFilters. + * + * @param null|NumericFilters $numericFilters numericFilters + * + * @return self + */ + public function setNumericFilters($numericFilters) + { + $this->container['numericFilters'] = $numericFilters; + + return $this; + } + + /** + * Gets hitsPerPage. + * + * @return null|int + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage. + * + * @param null|int $hitsPerPage number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets aroundLatLng. + * + * @return null|string + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng'] ?? null; + } + + /** + * Sets aroundLatLng. + * + * @param null|string $aroundLatLng Coordinates for the center of a circle, expressed as a comma-separated string of latitude and longitude. Only records included within a circle around this central location are included in the results. The radius of the circle is determined by the `aroundRadius` and `minimumAroundRadius` settings. This parameter is ignored if you also specify `insidePolygon` or `insideBoundingBox`. + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets aroundLatLngViaIP. + * + * @return null|bool + */ + public function getAroundLatLngViaIP() + { + return $this->container['aroundLatLngViaIP'] ?? null; + } + + /** + * Sets aroundLatLngViaIP. + * + * @param null|bool $aroundLatLngViaIP whether to obtain the coordinates from the request's IP address + * + * @return self + */ + public function setAroundLatLngViaIP($aroundLatLngViaIP) + { + $this->container['aroundLatLngViaIP'] = $aroundLatLngViaIP; + + return $this; + } + + /** + * Gets aroundRadius. + * + * @return null|AroundRadius + */ + public function getAroundRadius() + { + return $this->container['aroundRadius'] ?? null; + } + + /** + * Sets aroundRadius. + * + * @param null|AroundRadius $aroundRadius aroundRadius + * + * @return self + */ + public function setAroundRadius($aroundRadius) + { + $this->container['aroundRadius'] = $aroundRadius; + + return $this; + } + + /** + * Gets aroundPrecision. + * + * @return null|AroundPrecision + */ + public function getAroundPrecision() + { + return $this->container['aroundPrecision'] ?? null; + } + + /** + * Sets aroundPrecision. + * + * @param null|AroundPrecision $aroundPrecision aroundPrecision + * + * @return self + */ + public function setAroundPrecision($aroundPrecision) + { + $this->container['aroundPrecision'] = $aroundPrecision; + + return $this; + } + + /** + * Gets minimumAroundRadius. + * + * @return null|int + */ + public function getMinimumAroundRadius() + { + return $this->container['minimumAroundRadius'] ?? null; + } + + /** + * Sets minimumAroundRadius. + * + * @param null|int $minimumAroundRadius minimum radius (in meters) for a search around a location when `aroundRadius` isn't set + * + * @return self + */ + public function setMinimumAroundRadius($minimumAroundRadius) + { + $this->container['minimumAroundRadius'] = $minimumAroundRadius; + + return $this; + } + + /** + * Gets insideBoundingBox. + * + * @return null|InsideBoundingBox + */ + public function getInsideBoundingBox() + { + return $this->container['insideBoundingBox'] ?? null; + } + + /** + * Sets insideBoundingBox. + * + * @param null|InsideBoundingBox $insideBoundingBox insideBoundingBox + * + * @return self + */ + public function setInsideBoundingBox($insideBoundingBox) + { + $this->container['insideBoundingBox'] = $insideBoundingBox; + + return $this; + } + + /** + * Gets insidePolygon. + * + * @return null|float[][] + */ + public function getInsidePolygon() + { + return $this->container['insidePolygon'] ?? null; + } + + /** + * Sets insidePolygon. + * + * @param null|float[][] $insidePolygon Coordinates of a polygon in which to search. Polygons are defined by 3 to 10,000 points. Each point is represented by its latitude and longitude. Provide multiple polygons as nested arrays. For more information, see [filtering inside polygons](https://www.algolia.com/doc/guides/managing-results/refine-results/geolocation/#filtering-inside-rectangular-or-polygonal-areas). This parameter is ignored if you also specify `insideBoundingBox`. + * + * @return self + */ + public function setInsidePolygon($insidePolygon) + { + $this->container['insidePolygon'] = $insidePolygon; + + return $this; + } + + /** + * Gets queryLanguages. + * + * @return null|\Algolia\AlgoliaSearch\Model\Composition\SupportedLanguage[] + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages'] ?? null; + } + + /** + * Sets queryLanguages. + * + * @param null|\Algolia\AlgoliaSearch\Model\Composition\SupportedLanguage[] $queryLanguages Languages for language-specific query processing steps such as plurals, stop-word removal, and word-detection dictionaries. This setting sets a default list of languages used by the `removeStopWords` and `ignorePlurals` settings. This setting also sets a dictionary for word detection in the logogram-based [CJK](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#normalization-for-logogram-based-languages-cjk) languages. To support this, you must place the CJK language **first**. **You should always specify a query language.** If you don't specify an indexing language, the search engine uses all [supported languages](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/supported-languages/), or the languages you specified with the `ignorePlurals` or `removeStopWords` parameters. This can lead to unexpected search results. For more information, see [Language-specific configuration](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/language-specific-configurations/). + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets naturalLanguages. + * + * @return null|\Algolia\AlgoliaSearch\Model\Composition\SupportedLanguage[] + */ + public function getNaturalLanguages() + { + return $this->container['naturalLanguages'] ?? null; + } + + /** + * Sets naturalLanguages. + * + * @param null|\Algolia\AlgoliaSearch\Model\Composition\SupportedLanguage[] $naturalLanguages ISO language codes that adjust settings that are useful for processing natural language queries (as opposed to keyword searches): - Sets `removeStopWords` and `ignorePlurals` to the list of provided languages. - Sets `removeWordsIfNoResults` to `allOptional`. - Adds a `natural_language` attribute to `ruleContexts` and `analyticsTags`. + * + * @return self + */ + public function setNaturalLanguages($naturalLanguages) + { + $this->container['naturalLanguages'] = $naturalLanguages; + + return $this; + } + + /** + * Gets enableRules. + * + * @return null|bool + */ + public function getEnableRules() + { + return $this->container['enableRules'] ?? null; + } + + /** + * Sets enableRules. + * + * @param null|bool $enableRules whether to enable rules + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets ruleContexts. + * + * @return null|string[] + */ + public function getRuleContexts() + { + return $this->container['ruleContexts'] ?? null; + } + + /** + * Sets ruleContexts. + * + * @param null|string[] $ruleContexts Assigns a rule context to the search query. [Rule contexts](https://www.algolia.com/doc/guides/managing-results/rules/rules-overview/how-to/customize-search-results-by-platform/#whats-a-context) are strings that you can use to trigger matching rules. + * + * @return self + */ + public function setRuleContexts($ruleContexts) + { + $this->container['ruleContexts'] = $ruleContexts; + + return $this; + } + + /** + * Gets userToken. + * + * @return null|string + */ + public function getUserToken() + { + return $this->container['userToken'] ?? null; + } + + /** + * Sets userToken. + * + * @param null|string $userToken Unique pseudonymous or anonymous user identifier. This helps with analytics and click and conversion events. For more information, see [user token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets clickAnalytics. + * + * @return null|bool + */ + public function getClickAnalytics() + { + return $this->container['clickAnalytics'] ?? null; + } + + /** + * Sets clickAnalytics. + * + * @param null|bool $clickAnalytics Whether to include a `queryID` attribute in the response. The query ID is a unique identifier for a search query and is required for tracking [click and conversion events](https://www.algolia.com/guides/sending-events/getting-started/). + * + * @return self + */ + public function setClickAnalytics($clickAnalytics) + { + $this->container['clickAnalytics'] = $clickAnalytics; + + return $this; + } + + /** + * Gets analytics. + * + * @return null|bool + */ + public function getAnalytics() + { + return $this->container['analytics'] ?? null; + } + + /** + * Sets analytics. + * + * @param null|bool $analytics whether this search will be included in Analytics + * + * @return self + */ + public function setAnalytics($analytics) + { + $this->container['analytics'] = $analytics; + + return $this; + } + + /** + * Gets analyticsTags. + * + * @return null|string[] + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags'] ?? null; + } + + /** + * Sets analyticsTags. + * + * @param null|string[] $analyticsTags Tags to apply to the query for [segmenting analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/). + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets enableABTest. + * + * @return null|bool + */ + public function getEnableABTest() + { + return $this->container['enableABTest'] ?? null; + } + + /** + * Sets enableABTest. + * + * @param null|bool $enableABTest whether to enable A/B testing for this search + * + * @return self + */ + public function setEnableABTest($enableABTest) + { + $this->container['enableABTest'] = $enableABTest; + + return $this; + } + + /** + * Gets enableReRanking. + * + * @return null|bool + */ + public function getEnableReRanking() + { + return $this->container['enableReRanking'] ?? null; + } + + /** + * Sets enableReRanking. + * + * @param null|bool $enableReRanking Whether this search will use [Dynamic Re-Ranking](https://www.algolia.com/doc/guides/algolia-ai/re-ranking/). This setting only has an effect if you activated Dynamic Re-Ranking for this index in the Algolia dashboard. + * + * @return self + */ + public function setEnableReRanking($enableReRanking) + { + $this->container['enableReRanking'] = $enableReRanking; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/Personalization.php b/lib/Model/Composition/Personalization.php new file mode 100644 index 00000000..21401be9 --- /dev/null +++ b/lib/Model/Composition/Personalization.php @@ -0,0 +1,288 @@ + 'int', + 'rankingScore' => 'int', + 'score' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'filtersScore' => null, + 'rankingScore' => null, + 'score' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'filtersScore' => 'filtersScore', + 'rankingScore' => 'rankingScore', + 'score' => 'score', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'filtersScore' => 'setFiltersScore', + 'rankingScore' => 'setRankingScore', + 'score' => 'setScore', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'filtersScore' => 'getFiltersScore', + 'rankingScore' => 'getRankingScore', + 'score' => 'getScore', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['filtersScore'])) { + $this->container['filtersScore'] = $data['filtersScore']; + } + if (isset($data['rankingScore'])) { + $this->container['rankingScore'] = $data['rankingScore']; + } + if (isset($data['score'])) { + $this->container['score'] = $data['score']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets filtersScore. + * + * @return null|int + */ + public function getFiltersScore() + { + return $this->container['filtersScore'] ?? null; + } + + /** + * Sets filtersScore. + * + * @param null|int $filtersScore the score of the filters + * + * @return self + */ + public function setFiltersScore($filtersScore) + { + $this->container['filtersScore'] = $filtersScore; + + return $this; + } + + /** + * Gets rankingScore. + * + * @return null|int + */ + public function getRankingScore() + { + return $this->container['rankingScore'] ?? null; + } + + /** + * Sets rankingScore. + * + * @param null|int $rankingScore the score of the ranking + * + * @return self + */ + public function setRankingScore($rankingScore) + { + $this->container['rankingScore'] = $rankingScore; + + return $this; + } + + /** + * Gets score. + * + * @return null|int + */ + public function getScore() + { + return $this->container['score'] ?? null; + } + + /** + * Sets score. + * + * @param null|int $score the score of the event + * + * @return self + */ + public function setScore($score) + { + $this->container['score'] = $score; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/Range.php b/lib/Model/Composition/Range.php new file mode 100644 index 00000000..5d4ba906 --- /dev/null +++ b/lib/Model/Composition/Range.php @@ -0,0 +1,258 @@ + 'int', + 'value' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'from' => null, + 'value' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'from' => 'from', + 'value' => 'value', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'from' => 'setFrom', + 'value' => 'setValue', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'from' => 'getFrom', + 'value' => 'getValue', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['from'])) { + $this->container['from'] = $data['from']; + } + if (isset($data['value'])) { + $this->container['value'] = $data['value']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets from. + * + * @return null|int + */ + public function getFrom() + { + return $this->container['from'] ?? null; + } + + /** + * Sets from. + * + * @param null|int $from Lower boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal. + * + * @return self + */ + public function setFrom($from) + { + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets value. + * + * @return null|int + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value. + * + * @param null|int $value Upper boundary of a range in meters. The Geo ranking criterion considers all records within the range to be equal. + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/Redirect.php b/lib/Model/Composition/Redirect.php new file mode 100644 index 00000000..a2ad642c --- /dev/null +++ b/lib/Model/Composition/Redirect.php @@ -0,0 +1,226 @@ + '\Algolia\AlgoliaSearch\Model\Composition\RedirectRuleIndexMetadata[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'index' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'index' => 'index', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'index' => 'setIndex', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'index' => 'getIndex', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['index'])) { + $this->container['index'] = $data['index']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets index. + * + * @return null|\Algolia\AlgoliaSearch\Model\Composition\RedirectRuleIndexMetadata[] + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index. + * + * @param null|\Algolia\AlgoliaSearch\Model\Composition\RedirectRuleIndexMetadata[] $index index + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/RedirectRuleIndexData.php b/lib/Model/Composition/RedirectRuleIndexData.php new file mode 100644 index 00000000..5ec04821 --- /dev/null +++ b/lib/Model/Composition/RedirectRuleIndexData.php @@ -0,0 +1,232 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'ruleObjectID' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'ruleObjectID' => 'ruleObjectID', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'ruleObjectID' => 'setRuleObjectID', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'ruleObjectID' => 'getRuleObjectID', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['ruleObjectID'])) { + $this->container['ruleObjectID'] = $data['ruleObjectID']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['ruleObjectID']) || null === $this->container['ruleObjectID']) { + $invalidProperties[] = "'ruleObjectID' 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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets ruleObjectID. + * + * @return string + */ + public function getRuleObjectID() + { + return $this->container['ruleObjectID'] ?? null; + } + + /** + * Sets ruleObjectID. + * + * @param string $ruleObjectID ruleObjectID + * + * @return self + */ + public function setRuleObjectID($ruleObjectID) + { + $this->container['ruleObjectID'] = $ruleObjectID; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/RedirectRuleIndexMetadata.php b/lib/Model/Composition/RedirectRuleIndexMetadata.php new file mode 100644 index 00000000..652592e4 --- /dev/null +++ b/lib/Model/Composition/RedirectRuleIndexMetadata.php @@ -0,0 +1,370 @@ + 'string', + 'dest' => 'string', + 'reason' => 'string', + 'succeed' => 'bool', + 'data' => '\Algolia\AlgoliaSearch\Model\Composition\RedirectRuleIndexData', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'source' => null, + 'dest' => null, + 'reason' => null, + 'succeed' => null, + 'data' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'source' => 'source', + 'dest' => 'dest', + 'reason' => 'reason', + 'succeed' => 'succeed', + 'data' => 'data', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'source' => 'setSource', + 'dest' => 'setDest', + 'reason' => 'setReason', + 'succeed' => 'setSucceed', + 'data' => 'setData', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'source' => 'getSource', + 'dest' => 'getDest', + 'reason' => 'getReason', + 'succeed' => 'getSucceed', + 'data' => 'getData', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['source'])) { + $this->container['source'] = $data['source']; + } + if (isset($data['dest'])) { + $this->container['dest'] = $data['dest']; + } + if (isset($data['reason'])) { + $this->container['reason'] = $data['reason']; + } + if (isset($data['succeed'])) { + $this->container['succeed'] = $data['succeed']; + } + if (isset($data['data'])) { + $this->container['data'] = $data['data']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['source']) || null === $this->container['source']) { + $invalidProperties[] = "'source' can't be null"; + } + if (!isset($this->container['dest']) || null === $this->container['dest']) { + $invalidProperties[] = "'dest' can't be null"; + } + if (!isset($this->container['reason']) || null === $this->container['reason']) { + $invalidProperties[] = "'reason' can't be null"; + } + if (!isset($this->container['succeed']) || null === $this->container['succeed']) { + $invalidProperties[] = "'succeed' can't be null"; + } + if (!isset($this->container['data']) || null === $this->container['data']) { + $invalidProperties[] = "'data' 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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets source. + * + * @return string + */ + public function getSource() + { + return $this->container['source'] ?? null; + } + + /** + * Sets source. + * + * @param string $source source index for the redirect rule + * + * @return self + */ + public function setSource($source) + { + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets dest. + * + * @return string + */ + public function getDest() + { + return $this->container['dest'] ?? null; + } + + /** + * Sets dest. + * + * @param string $dest destination index for the redirect rule + * + * @return self + */ + public function setDest($dest) + { + $this->container['dest'] = $dest; + + return $this; + } + + /** + * Gets reason. + * + * @return string + */ + public function getReason() + { + return $this->container['reason'] ?? null; + } + + /** + * Sets reason. + * + * @param string $reason reason for the redirect rule + * + * @return self + */ + public function setReason($reason) + { + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets succeed. + * + * @return bool + */ + public function getSucceed() + { + return $this->container['succeed'] ?? null; + } + + /** + * Sets succeed. + * + * @param bool $succeed redirect rule status + * + * @return self + */ + public function setSucceed($succeed) + { + $this->container['succeed'] = $succeed; + + return $this; + } + + /** + * Gets data. + * + * @return RedirectRuleIndexData + */ + public function getData() + { + return $this->container['data'] ?? null; + } + + /** + * Sets data. + * + * @param RedirectRuleIndexData $data data + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/RedirectURL.php b/lib/Model/Composition/RedirectURL.php new file mode 100644 index 00000000..09112954 --- /dev/null +++ b/lib/Model/Composition/RedirectURL.php @@ -0,0 +1,226 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'url' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'url' => 'url', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'url' => 'setUrl', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'url' => 'getUrl', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['url'])) { + $this->container['url'] = $data['url']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets url. + * + * @return null|string + */ + public function getUrl() + { + return $this->container['url'] ?? null; + } + + /** + * Sets url. + * + * @param null|string $url url + * + * @return self + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/RenderingContent.php b/lib/Model/Composition/RenderingContent.php new file mode 100644 index 00000000..4412408a --- /dev/null +++ b/lib/Model/Composition/RenderingContent.php @@ -0,0 +1,290 @@ + '\Algolia\AlgoliaSearch\Model\Composition\FacetOrdering', + 'redirect' => '\Algolia\AlgoliaSearch\Model\Composition\RedirectURL', + 'widgets' => '\Algolia\AlgoliaSearch\Model\Composition\Widgets', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'facetOrdering' => null, + 'redirect' => null, + 'widgets' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'facetOrdering' => 'facetOrdering', + 'redirect' => 'redirect', + 'widgets' => 'widgets', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'facetOrdering' => 'setFacetOrdering', + 'redirect' => 'setRedirect', + 'widgets' => 'setWidgets', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'facetOrdering' => 'getFacetOrdering', + 'redirect' => 'getRedirect', + 'widgets' => 'getWidgets', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['facetOrdering'])) { + $this->container['facetOrdering'] = $data['facetOrdering']; + } + if (isset($data['redirect'])) { + $this->container['redirect'] = $data['redirect']; + } + if (isset($data['widgets'])) { + $this->container['widgets'] = $data['widgets']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets facetOrdering. + * + * @return null|FacetOrdering + */ + public function getFacetOrdering() + { + return $this->container['facetOrdering'] ?? null; + } + + /** + * Sets facetOrdering. + * + * @param null|FacetOrdering $facetOrdering facetOrdering + * + * @return self + */ + public function setFacetOrdering($facetOrdering) + { + $this->container['facetOrdering'] = $facetOrdering; + + return $this; + } + + /** + * Gets redirect. + * + * @return null|RedirectURL + */ + public function getRedirect() + { + return $this->container['redirect'] ?? null; + } + + /** + * Sets redirect. + * + * @param null|RedirectURL $redirect redirect + * + * @return self + */ + public function setRedirect($redirect) + { + $this->container['redirect'] = $redirect; + + return $this; + } + + /** + * Gets widgets. + * + * @return null|Widgets + */ + public function getWidgets() + { + return $this->container['widgets'] ?? null; + } + + /** + * Sets widgets. + * + * @param null|Widgets $widgets widgets + * + * @return self + */ + public function setWidgets($widgets) + { + $this->container['widgets'] = $widgets; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/RequestBody.php b/lib/Model/Composition/RequestBody.php new file mode 100644 index 00000000..826e0e15 --- /dev/null +++ b/lib/Model/Composition/RequestBody.php @@ -0,0 +1,224 @@ + '\Algolia\AlgoliaSearch\Model\Composition\Params', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'params' => null, + ]; + + /** + * 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', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['params'])) { + $this->container['params'] = $data['params']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets params. + * + * @return null|Params + */ + public function getParams() + { + return $this->container['params'] ?? null; + } + + /** + * Sets params. + * + * @param null|Params $params params + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/ResultsCompositionInfoResponse.php b/lib/Model/Composition/ResultsCompositionInfoResponse.php new file mode 100644 index 00000000..3177db37 --- /dev/null +++ b/lib/Model/Composition/ResultsCompositionInfoResponse.php @@ -0,0 +1,230 @@ + '\Algolia\AlgoliaSearch\Model\Composition\ResultsInjectedItemInfoResponse[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'injectedItems' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'injectedItems' => 'injectedItems', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'injectedItems' => 'setInjectedItems', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'injectedItems' => 'getInjectedItems', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['injectedItems'])) { + $this->container['injectedItems'] = $data['injectedItems']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['injectedItems']) || null === $this->container['injectedItems']) { + $invalidProperties[] = "'injectedItems' 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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets injectedItems. + * + * @return \Algolia\AlgoliaSearch\Model\Composition\ResultsInjectedItemInfoResponse[] + */ + public function getInjectedItems() + { + return $this->container['injectedItems'] ?? null; + } + + /** + * Sets injectedItems. + * + * @param \Algolia\AlgoliaSearch\Model\Composition\ResultsInjectedItemInfoResponse[] $injectedItems injectedItems + * + * @return self + */ + public function setInjectedItems($injectedItems) + { + $this->container['injectedItems'] = $injectedItems; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/ResultsInjectedItemAppliedRulesInfoResponse.php b/lib/Model/Composition/ResultsInjectedItemAppliedRulesInfoResponse.php new file mode 100644 index 00000000..7d883608 --- /dev/null +++ b/lib/Model/Composition/ResultsInjectedItemAppliedRulesInfoResponse.php @@ -0,0 +1,230 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'objectID' => null, + ]; + + /** + * 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', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['objectID']) || null === $this->container['objectID']) { + $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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets objectID. + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID. + * + * @param string $objectID unique record identifier + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/ResultsInjectedItemInfoResponse.php b/lib/Model/Composition/ResultsInjectedItemInfoResponse.php new file mode 100644 index 00000000..4778d3e2 --- /dev/null +++ b/lib/Model/Composition/ResultsInjectedItemInfoResponse.php @@ -0,0 +1,262 @@ + 'string', + 'appliedRules' => '\Algolia\AlgoliaSearch\Model\Composition\ResultsInjectedItemAppliedRulesInfoResponse[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'key' => null, + 'appliedRules' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'key' => 'key', + 'appliedRules' => 'appliedRules', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'key' => 'setKey', + 'appliedRules' => 'setAppliedRules', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'key' => 'getKey', + 'appliedRules' => 'getAppliedRules', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['key'])) { + $this->container['key'] = $data['key']; + } + if (isset($data['appliedRules'])) { + $this->container['appliedRules'] = $data['appliedRules']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['key']) || null === $this->container['key']) { + $invalidProperties[] = "'key' 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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets key. + * + * @return string + */ + public function getKey() + { + return $this->container['key'] ?? null; + } + + /** + * Sets key. + * + * @param string $key key + * + * @return self + */ + public function setKey($key) + { + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets appliedRules. + * + * @return null|\Algolia\AlgoliaSearch\Model\Composition\ResultsInjectedItemAppliedRulesInfoResponse[] + */ + public function getAppliedRules() + { + return $this->container['appliedRules'] ?? null; + } + + /** + * Sets appliedRules. + * + * @param null|\Algolia\AlgoliaSearch\Model\Composition\ResultsInjectedItemAppliedRulesInfoResponse[] $appliedRules appliedRules + * + * @return self + */ + public function setAppliedRules($appliedRules) + { + $this->container['appliedRules'] = $appliedRules; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/SearchForFacetValuesParams.php b/lib/Model/Composition/SearchForFacetValuesParams.php new file mode 100644 index 00000000..8ffcf6f2 --- /dev/null +++ b/lib/Model/Composition/SearchForFacetValuesParams.php @@ -0,0 +1,288 @@ + 'string', + 'maxFacetHits' => 'int', + 'searchQuery' => '\Algolia\AlgoliaSearch\Model\Composition\Params', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'query' => null, + 'maxFacetHits' => null, + 'searchQuery' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'query' => 'query', + 'maxFacetHits' => 'maxFacetHits', + 'searchQuery' => 'searchQuery', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'maxFacetHits' => 'setMaxFacetHits', + 'searchQuery' => 'setSearchQuery', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'maxFacetHits' => 'getMaxFacetHits', + 'searchQuery' => 'getSearchQuery', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } + if (isset($data['searchQuery'])) { + $this->container['searchQuery'] = $data['searchQuery']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets query. + * + * @return null|string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query. + * + * @param null|string $query search query + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets maxFacetHits. + * + * @return null|int + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits. + * + * @param null|int $maxFacetHits Maximum number of facet values to return when [searching for facet values](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#search-for-facet-values). + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets searchQuery. + * + * @return null|Params + */ + public function getSearchQuery() + { + return $this->container['searchQuery'] ?? null; + } + + /** + * Sets searchQuery. + * + * @param null|Params $searchQuery searchQuery + * + * @return self + */ + public function setSearchQuery($searchQuery) + { + $this->container['searchQuery'] = $searchQuery; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/SearchForFacetValuesRequest.php b/lib/Model/Composition/SearchForFacetValuesRequest.php new file mode 100644 index 00000000..04205671 --- /dev/null +++ b/lib/Model/Composition/SearchForFacetValuesRequest.php @@ -0,0 +1,224 @@ + '\Algolia\AlgoliaSearch\Model\Composition\SearchForFacetValuesParams', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'params' => null, + ]; + + /** + * 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', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['params'])) { + $this->container['params'] = $data['params']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets params. + * + * @return null|SearchForFacetValuesParams + */ + public function getParams() + { + return $this->container['params'] ?? null; + } + + /** + * Sets params. + * + * @param null|SearchForFacetValuesParams $params params + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/SearchForFacetValuesResponse.php b/lib/Model/Composition/SearchForFacetValuesResponse.php new file mode 100644 index 00000000..278fe65f --- /dev/null +++ b/lib/Model/Composition/SearchForFacetValuesResponse.php @@ -0,0 +1,224 @@ + '\Algolia\AlgoliaSearch\Model\Composition\SearchForFacetValuesResults[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'results' => null, + ]; + + /** + * 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', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['results'])) { + $this->container['results'] = $data['results']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets results. + * + * @return null|\Algolia\AlgoliaSearch\Model\Composition\SearchForFacetValuesResults[] + */ + public function getResults() + { + return $this->container['results'] ?? null; + } + + /** + * Sets results. + * + * @param null|\Algolia\AlgoliaSearch\Model\Composition\SearchForFacetValuesResults[] $results search for facet values results + * + * @return self + */ + public function setResults($results) + { + $this->container['results'] = $results; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/SearchForFacetValuesResults.php b/lib/Model/Composition/SearchForFacetValuesResults.php new file mode 100644 index 00000000..ea1d6368 --- /dev/null +++ b/lib/Model/Composition/SearchForFacetValuesResults.php @@ -0,0 +1,332 @@ + 'string', + 'facetHits' => '\Algolia\AlgoliaSearch\Model\Composition\FacetHits[]', + 'exhaustiveFacetsCount' => 'bool', + 'processingTimeMS' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'indexName' => null, + 'facetHits' => null, + 'exhaustiveFacetsCount' => null, + 'processingTimeMS' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'indexName' => 'indexName', + 'facetHits' => 'facetHits', + 'exhaustiveFacetsCount' => 'exhaustiveFacetsCount', + 'processingTimeMS' => 'processingTimeMS', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + 'facetHits' => 'setFacetHits', + 'exhaustiveFacetsCount' => 'setExhaustiveFacetsCount', + 'processingTimeMS' => 'setProcessingTimeMS', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'indexName' => 'getIndexName', + 'facetHits' => 'getFacetHits', + 'exhaustiveFacetsCount' => 'getExhaustiveFacetsCount', + 'processingTimeMS' => 'getProcessingTimeMS', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + if (isset($data['facetHits'])) { + $this->container['facetHits'] = $data['facetHits']; + } + if (isset($data['exhaustiveFacetsCount'])) { + $this->container['exhaustiveFacetsCount'] = $data['exhaustiveFacetsCount']; + } + if (isset($data['processingTimeMS'])) { + $this->container['processingTimeMS'] = $data['processingTimeMS']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['indexName']) || null === $this->container['indexName']) { + $invalidProperties[] = "'indexName' can't be null"; + } + if (!isset($this->container['facetHits']) || null === $this->container['facetHits']) { + $invalidProperties[] = "'facetHits' can't be null"; + } + if (!isset($this->container['exhaustiveFacetsCount']) || null === $this->container['exhaustiveFacetsCount']) { + $invalidProperties[] = "'exhaustiveFacetsCount' 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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets indexName. + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName. + * + * @param string $indexName indexName + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets facetHits. + * + * @return \Algolia\AlgoliaSearch\Model\Composition\FacetHits[] + */ + public function getFacetHits() + { + return $this->container['facetHits'] ?? null; + } + + /** + * Sets facetHits. + * + * @param \Algolia\AlgoliaSearch\Model\Composition\FacetHits[] $facetHits matching facet values + * + * @return self + */ + public function setFacetHits($facetHits) + { + $this->container['facetHits'] = $facetHits; + + return $this; + } + + /** + * Gets exhaustiveFacetsCount. + * + * @return bool + */ + public function getExhaustiveFacetsCount() + { + return $this->container['exhaustiveFacetsCount'] ?? null; + } + + /** + * Sets exhaustiveFacetsCount. + * + * @param bool $exhaustiveFacetsCount Whether the facet count is exhaustive (true) or approximate (false). For more information, see [Why are my facet and hit counts not accurate](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-). + * + * @return self + */ + public function setExhaustiveFacetsCount($exhaustiveFacetsCount) + { + $this->container['exhaustiveFacetsCount'] = $exhaustiveFacetsCount; + + return $this; + } + + /** + * Gets processingTimeMS. + * + * @return null|int + */ + public function getProcessingTimeMS() + { + return $this->container['processingTimeMS'] ?? null; + } + + /** + * Sets processingTimeMS. + * + * @param null|int $processingTimeMS time the server took to process the request, in milliseconds + * + * @return self + */ + public function setProcessingTimeMS($processingTimeMS) + { + $this->container['processingTimeMS'] = $processingTimeMS; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/SearchResponse.php b/lib/Model/Composition/SearchResponse.php new file mode 100644 index 00000000..c46ee295 --- /dev/null +++ b/lib/Model/Composition/SearchResponse.php @@ -0,0 +1,262 @@ + '\Algolia\AlgoliaSearch\Model\Composition\CompositionsSearchResponse', + 'results' => '\Algolia\AlgoliaSearch\Model\Composition\SearchResultsItem[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'compositions' => null, + 'results' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'compositions' => 'compositions', + 'results' => 'results', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'compositions' => 'setCompositions', + 'results' => 'setResults', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'compositions' => 'getCompositions', + 'results' => 'getResults', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['compositions'])) { + $this->container['compositions'] = $data['compositions']; + } + if (isset($data['results'])) { + $this->container['results'] = $data['results']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['results']) || null === $this->container['results']) { + $invalidProperties[] = "'results' 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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets compositions. + * + * @return null|CompositionsSearchResponse + */ + public function getCompositions() + { + return $this->container['compositions'] ?? null; + } + + /** + * Sets compositions. + * + * @param null|CompositionsSearchResponse $compositions compositions + * + * @return self + */ + public function setCompositions($compositions) + { + $this->container['compositions'] = $compositions; + + return $this; + } + + /** + * Gets results. + * + * @return \Algolia\AlgoliaSearch\Model\Composition\SearchResultsItem[] + */ + public function getResults() + { + return $this->container['results'] ?? null; + } + + /** + * Sets results. + * + * @param \Algolia\AlgoliaSearch\Model\Composition\SearchResultsItem[] $results search results + * + * @return self + */ + public function setResults($results) + { + $this->container['results'] = $results; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/SearchResultsItem.php b/lib/Model/Composition/SearchResultsItem.php new file mode 100644 index 00000000..623469a8 --- /dev/null +++ b/lib/Model/Composition/SearchResultsItem.php @@ -0,0 +1,1322 @@ + 'int', + 'abTestVariantID' => 'int', + 'aroundLatLng' => 'string', + 'automaticRadius' => 'string', + 'exhaustive' => '\Algolia\AlgoliaSearch\Model\Composition\Exhaustive', + 'appliedRules' => 'object[]', + 'exhaustiveFacetsCount' => 'bool', + 'exhaustiveNbHits' => 'bool', + 'exhaustiveTypo' => 'bool', + 'facets' => 'array>', + 'facetsStats' => 'array', + 'index' => 'string', + 'indexUsed' => 'string', + 'message' => 'string', + 'nbSortedHits' => 'int', + 'parsedQuery' => 'string', + 'processingTimeMS' => 'int', + 'processingTimingsMS' => 'object', + 'queryAfterRemoval' => 'string', + 'redirect' => '\Algolia\AlgoliaSearch\Model\Composition\Redirect', + 'renderingContent' => '\Algolia\AlgoliaSearch\Model\Composition\RenderingContent', + 'serverTimeMS' => 'int', + 'serverUsed' => 'string', + 'userData' => 'object', + 'queryID' => 'string', + 'automaticInsights' => 'bool', + 'page' => 'int', + 'nbHits' => 'int', + 'nbPages' => 'int', + 'hitsPerPage' => 'int', + 'hits' => '\Algolia\AlgoliaSearch\Model\Composition\Hit[]', + 'query' => 'string', + 'params' => 'string', + 'compositions' => 'array', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'abTestID' => null, + 'abTestVariantID' => null, + 'aroundLatLng' => null, + 'automaticRadius' => null, + 'exhaustive' => null, + 'appliedRules' => null, + 'exhaustiveFacetsCount' => null, + 'exhaustiveNbHits' => null, + 'exhaustiveTypo' => null, + 'facets' => null, + 'facetsStats' => null, + 'index' => null, + 'indexUsed' => null, + 'message' => null, + 'nbSortedHits' => null, + 'parsedQuery' => null, + 'processingTimeMS' => null, + 'processingTimingsMS' => null, + 'queryAfterRemoval' => null, + 'redirect' => null, + 'renderingContent' => null, + 'serverTimeMS' => null, + 'serverUsed' => null, + 'userData' => null, + 'queryID' => null, + 'automaticInsights' => null, + 'page' => null, + 'nbHits' => null, + 'nbPages' => null, + 'hitsPerPage' => null, + 'hits' => null, + 'query' => null, + 'params' => null, + 'compositions' => null, + ]; + + /** + * 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', + 'exhaustive' => 'exhaustive', + 'appliedRules' => 'appliedRules', + 'exhaustiveFacetsCount' => 'exhaustiveFacetsCount', + 'exhaustiveNbHits' => 'exhaustiveNbHits', + 'exhaustiveTypo' => 'exhaustiveTypo', + 'facets' => 'facets', + 'facetsStats' => 'facets_stats', + 'index' => 'index', + 'indexUsed' => 'indexUsed', + 'message' => 'message', + 'nbSortedHits' => 'nbSortedHits', + 'parsedQuery' => 'parsedQuery', + 'processingTimeMS' => 'processingTimeMS', + 'processingTimingsMS' => 'processingTimingsMS', + 'queryAfterRemoval' => 'queryAfterRemoval', + 'redirect' => 'redirect', + 'renderingContent' => 'renderingContent', + 'serverTimeMS' => 'serverTimeMS', + 'serverUsed' => 'serverUsed', + 'userData' => 'userData', + 'queryID' => 'queryID', + 'automaticInsights' => '_automaticInsights', + 'page' => 'page', + 'nbHits' => 'nbHits', + 'nbPages' => 'nbPages', + 'hitsPerPage' => 'hitsPerPage', + 'hits' => 'hits', + 'query' => 'query', + 'params' => 'params', + 'compositions' => 'compositions', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'abTestID' => 'setAbTestID', + 'abTestVariantID' => 'setAbTestVariantID', + 'aroundLatLng' => 'setAroundLatLng', + 'automaticRadius' => 'setAutomaticRadius', + 'exhaustive' => 'setExhaustive', + 'appliedRules' => 'setAppliedRules', + 'exhaustiveFacetsCount' => 'setExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'setExhaustiveNbHits', + 'exhaustiveTypo' => 'setExhaustiveTypo', + 'facets' => 'setFacets', + 'facetsStats' => 'setFacetsStats', + 'index' => 'setIndex', + 'indexUsed' => 'setIndexUsed', + 'message' => 'setMessage', + 'nbSortedHits' => 'setNbSortedHits', + 'parsedQuery' => 'setParsedQuery', + 'processingTimeMS' => 'setProcessingTimeMS', + 'processingTimingsMS' => 'setProcessingTimingsMS', + 'queryAfterRemoval' => 'setQueryAfterRemoval', + 'redirect' => 'setRedirect', + 'renderingContent' => 'setRenderingContent', + 'serverTimeMS' => 'setServerTimeMS', + 'serverUsed' => 'setServerUsed', + 'userData' => 'setUserData', + 'queryID' => 'setQueryID', + 'automaticInsights' => 'setAutomaticInsights', + 'page' => 'setPage', + 'nbHits' => 'setNbHits', + 'nbPages' => 'setNbPages', + 'hitsPerPage' => 'setHitsPerPage', + 'hits' => 'setHits', + 'query' => 'setQuery', + 'params' => 'setParams', + 'compositions' => 'setCompositions', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'abTestID' => 'getAbTestID', + 'abTestVariantID' => 'getAbTestVariantID', + 'aroundLatLng' => 'getAroundLatLng', + 'automaticRadius' => 'getAutomaticRadius', + 'exhaustive' => 'getExhaustive', + 'appliedRules' => 'getAppliedRules', + 'exhaustiveFacetsCount' => 'getExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'getExhaustiveNbHits', + 'exhaustiveTypo' => 'getExhaustiveTypo', + 'facets' => 'getFacets', + 'facetsStats' => 'getFacetsStats', + 'index' => 'getIndex', + 'indexUsed' => 'getIndexUsed', + 'message' => 'getMessage', + 'nbSortedHits' => 'getNbSortedHits', + 'parsedQuery' => 'getParsedQuery', + 'processingTimeMS' => 'getProcessingTimeMS', + 'processingTimingsMS' => 'getProcessingTimingsMS', + 'queryAfterRemoval' => 'getQueryAfterRemoval', + 'redirect' => 'getRedirect', + 'renderingContent' => 'getRenderingContent', + 'serverTimeMS' => 'getServerTimeMS', + 'serverUsed' => 'getServerUsed', + 'userData' => 'getUserData', + 'queryID' => 'getQueryID', + 'automaticInsights' => 'getAutomaticInsights', + 'page' => 'getPage', + 'nbHits' => 'getNbHits', + 'nbPages' => 'getNbPages', + 'hitsPerPage' => 'getHitsPerPage', + 'hits' => 'getHits', + 'query' => 'getQuery', + 'params' => 'getParams', + 'compositions' => 'getCompositions', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['abTestID'])) { + $this->container['abTestID'] = $data['abTestID']; + } + if (isset($data['abTestVariantID'])) { + $this->container['abTestVariantID'] = $data['abTestVariantID']; + } + if (isset($data['aroundLatLng'])) { + $this->container['aroundLatLng'] = $data['aroundLatLng']; + } + if (isset($data['automaticRadius'])) { + $this->container['automaticRadius'] = $data['automaticRadius']; + } + if (isset($data['exhaustive'])) { + $this->container['exhaustive'] = $data['exhaustive']; + } + if (isset($data['appliedRules'])) { + $this->container['appliedRules'] = $data['appliedRules']; + } + if (isset($data['exhaustiveFacetsCount'])) { + $this->container['exhaustiveFacetsCount'] = $data['exhaustiveFacetsCount']; + } + if (isset($data['exhaustiveNbHits'])) { + $this->container['exhaustiveNbHits'] = $data['exhaustiveNbHits']; + } + if (isset($data['exhaustiveTypo'])) { + $this->container['exhaustiveTypo'] = $data['exhaustiveTypo']; + } + if (isset($data['facets'])) { + $this->container['facets'] = $data['facets']; + } + if (isset($data['facetsStats'])) { + $this->container['facetsStats'] = $data['facetsStats']; + } + if (isset($data['index'])) { + $this->container['index'] = $data['index']; + } + if (isset($data['indexUsed'])) { + $this->container['indexUsed'] = $data['indexUsed']; + } + if (isset($data['message'])) { + $this->container['message'] = $data['message']; + } + if (isset($data['nbSortedHits'])) { + $this->container['nbSortedHits'] = $data['nbSortedHits']; + } + if (isset($data['parsedQuery'])) { + $this->container['parsedQuery'] = $data['parsedQuery']; + } + if (isset($data['processingTimeMS'])) { + $this->container['processingTimeMS'] = $data['processingTimeMS']; + } + if (isset($data['processingTimingsMS'])) { + $this->container['processingTimingsMS'] = $data['processingTimingsMS']; + } + if (isset($data['queryAfterRemoval'])) { + $this->container['queryAfterRemoval'] = $data['queryAfterRemoval']; + } + if (isset($data['redirect'])) { + $this->container['redirect'] = $data['redirect']; + } + if (isset($data['renderingContent'])) { + $this->container['renderingContent'] = $data['renderingContent']; + } + if (isset($data['serverTimeMS'])) { + $this->container['serverTimeMS'] = $data['serverTimeMS']; + } + if (isset($data['serverUsed'])) { + $this->container['serverUsed'] = $data['serverUsed']; + } + if (isset($data['userData'])) { + $this->container['userData'] = $data['userData']; + } + if (isset($data['queryID'])) { + $this->container['queryID'] = $data['queryID']; + } + if (isset($data['automaticInsights'])) { + $this->container['automaticInsights'] = $data['automaticInsights']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['nbHits'])) { + $this->container['nbHits'] = $data['nbHits']; + } + if (isset($data['nbPages'])) { + $this->container['nbPages'] = $data['nbPages']; + } + if (isset($data['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + if (isset($data['hits'])) { + $this->container['hits'] = $data['hits']; + } + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['params'])) { + $this->container['params'] = $data['params']; + } + if (isset($data['compositions'])) { + $this->container['compositions'] = $data['compositions']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['processingTimeMS']) || null === $this->container['processingTimeMS']) { + $invalidProperties[] = "'processingTimeMS' can't be null"; + } + if (!isset($this->container['page']) || null === $this->container['page']) { + $invalidProperties[] = "'page' can't be null"; + } + if (!isset($this->container['nbHits']) || null === $this->container['nbHits']) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if (!isset($this->container['nbPages']) || null === $this->container['nbPages']) { + $invalidProperties[] = "'nbPages' can't be null"; + } + if (!isset($this->container['hitsPerPage']) || null === $this->container['hitsPerPage']) { + $invalidProperties[] = "'hitsPerPage' can't be null"; + } + if (!isset($this->container['hits']) || null === $this->container['hits']) { + $invalidProperties[] = "'hits' can't be null"; + } + if (!isset($this->container['query']) || null === $this->container['query']) { + $invalidProperties[] = "'query' can't be null"; + } + if (!isset($this->container['params']) || null === $this->container['params']) { + $invalidProperties[] = "'params' can't be null"; + } + if (!isset($this->container['compositions']) || null === $this->container['compositions']) { + $invalidProperties[] = "'compositions' 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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets abTestID. + * + * @return null|int + */ + public function getAbTestID() + { + return $this->container['abTestID'] ?? null; + } + + /** + * Sets abTestID. + * + * @param null|int $abTestID A/B test ID. This is only included in the response for indices that are part of an A/B test. + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets abTestVariantID. + * + * @return null|int + */ + public function getAbTestVariantID() + { + return $this->container['abTestVariantID'] ?? null; + } + + /** + * Sets abTestVariantID. + * + * @param null|int $abTestVariantID Variant ID. This is only included in the response for indices that are part of an A/B test. + * + * @return self + */ + public function setAbTestVariantID($abTestVariantID) + { + $this->container['abTestVariantID'] = $abTestVariantID; + + return $this; + } + + /** + * Gets aroundLatLng. + * + * @return null|string + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng'] ?? null; + } + + /** + * Sets aroundLatLng. + * + * @param null|string $aroundLatLng computed geographical location + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets automaticRadius. + * + * @return null|string + */ + public function getAutomaticRadius() + { + return $this->container['automaticRadius'] ?? null; + } + + /** + * Sets automaticRadius. + * + * @param null|string $automaticRadius distance from a central coordinate provided by `aroundLatLng` + * + * @return self + */ + public function setAutomaticRadius($automaticRadius) + { + $this->container['automaticRadius'] = $automaticRadius; + + return $this; + } + + /** + * Gets exhaustive. + * + * @return null|Exhaustive + */ + public function getExhaustive() + { + return $this->container['exhaustive'] ?? null; + } + + /** + * Sets exhaustive. + * + * @param null|Exhaustive $exhaustive exhaustive + * + * @return self + */ + public function setExhaustive($exhaustive) + { + $this->container['exhaustive'] = $exhaustive; + + return $this; + } + + /** + * Gets appliedRules. + * + * @return null|object[] + */ + public function getAppliedRules() + { + return $this->container['appliedRules'] ?? null; + } + + /** + * Sets appliedRules. + * + * @param null|object[] $appliedRules rules applied to the query + * + * @return self + */ + public function setAppliedRules($appliedRules) + { + $this->container['appliedRules'] = $appliedRules; + + return $this; + } + + /** + * Gets exhaustiveFacetsCount. + * + * @return null|bool + * + * @deprecated + */ + public function getExhaustiveFacetsCount() + { + return $this->container['exhaustiveFacetsCount'] ?? null; + } + + /** + * Sets exhaustiveFacetsCount. + * + * @param null|bool $exhaustiveFacetsCount see the `facetsCount` field of the `exhaustive` object in the response + * + * @return self + * + * @deprecated + */ + public function setExhaustiveFacetsCount($exhaustiveFacetsCount) + { + $this->container['exhaustiveFacetsCount'] = $exhaustiveFacetsCount; + + return $this; + } + + /** + * Gets exhaustiveNbHits. + * + * @return null|bool + * + * @deprecated + */ + public function getExhaustiveNbHits() + { + return $this->container['exhaustiveNbHits'] ?? null; + } + + /** + * Sets exhaustiveNbHits. + * + * @param null|bool $exhaustiveNbHits see the `nbHits` field of the `exhaustive` object in the response + * + * @return self + * + * @deprecated + */ + public function setExhaustiveNbHits($exhaustiveNbHits) + { + $this->container['exhaustiveNbHits'] = $exhaustiveNbHits; + + return $this; + } + + /** + * Gets exhaustiveTypo. + * + * @return null|bool + * + * @deprecated + */ + public function getExhaustiveTypo() + { + return $this->container['exhaustiveTypo'] ?? null; + } + + /** + * Sets exhaustiveTypo. + * + * @param null|bool $exhaustiveTypo see the `typo` field of the `exhaustive` object in the response + * + * @return self + * + * @deprecated + */ + public function setExhaustiveTypo($exhaustiveTypo) + { + $this->container['exhaustiveTypo'] = $exhaustiveTypo; + + return $this; + } + + /** + * Gets facets. + * + * @return null|array> + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets. + * + * @param null|array> $facets facet counts + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets facetsStats. + * + * @return null|array + */ + public function getFacetsStats() + { + return $this->container['facetsStats'] ?? null; + } + + /** + * Sets facetsStats. + * + * @param null|array $facetsStats statistics for numerical facets + * + * @return self + */ + public function setFacetsStats($facetsStats) + { + $this->container['facetsStats'] = $facetsStats; + + return $this; + } + + /** + * Gets index. + * + * @return null|string + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index. + * + * @param null|string $index index name used for the query + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets indexUsed. + * + * @return null|string + */ + public function getIndexUsed() + { + return $this->container['indexUsed'] ?? null; + } + + /** + * Sets indexUsed. + * + * @param null|string $indexUsed Index name used for the query. During A/B testing, 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 null|string + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message. + * + * @param null|string $message warnings about the query + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets nbSortedHits. + * + * @return null|int + */ + public function getNbSortedHits() + { + return $this->container['nbSortedHits'] ?? null; + } + + /** + * Sets nbSortedHits. + * + * @param null|int $nbSortedHits number of hits selected and sorted by the relevant sort algorithm + * + * @return self + */ + public function setNbSortedHits($nbSortedHits) + { + $this->container['nbSortedHits'] = $nbSortedHits; + + return $this; + } + + /** + * Gets parsedQuery. + * + * @return null|string + */ + public function getParsedQuery() + { + return $this->container['parsedQuery'] ?? null; + } + + /** + * Sets parsedQuery. + * + * @param null|string $parsedQuery Post-[normalization](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#what-does-normalization-mean) query string that will be searched. + * + * @return self + */ + public function setParsedQuery($parsedQuery) + { + $this->container['parsedQuery'] = $parsedQuery; + + return $this; + } + + /** + * Gets processingTimeMS. + * + * @return int + */ + public function getProcessingTimeMS() + { + return $this->container['processingTimeMS'] ?? null; + } + + /** + * 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 processingTimingsMS. + * + * @return null|object + */ + public function getProcessingTimingsMS() + { + return $this->container['processingTimingsMS'] ?? null; + } + + /** + * Sets processingTimingsMS. + * + * @param null|object $processingTimingsMS Experimental. List of processing steps and their times, in milliseconds. You can use this list to investigate performance issues. + * + * @return self + */ + public function setProcessingTimingsMS($processingTimingsMS) + { + $this->container['processingTimingsMS'] = $processingTimingsMS; + + return $this; + } + + /** + * Gets queryAfterRemoval. + * + * @return null|string + */ + public function getQueryAfterRemoval() + { + return $this->container['queryAfterRemoval'] ?? null; + } + + /** + * Sets queryAfterRemoval. + * + * @param null|string $queryAfterRemoval markup text indicating which parts of the original query have been removed to retrieve a non-empty result set + * + * @return self + */ + public function setQueryAfterRemoval($queryAfterRemoval) + { + $this->container['queryAfterRemoval'] = $queryAfterRemoval; + + return $this; + } + + /** + * Gets redirect. + * + * @return null|Redirect + */ + public function getRedirect() + { + return $this->container['redirect'] ?? null; + } + + /** + * Sets redirect. + * + * @param null|Redirect $redirect redirect + * + * @return self + */ + public function setRedirect($redirect) + { + $this->container['redirect'] = $redirect; + + return $this; + } + + /** + * Gets renderingContent. + * + * @return null|RenderingContent + */ + public function getRenderingContent() + { + return $this->container['renderingContent'] ?? null; + } + + /** + * Sets renderingContent. + * + * @param null|RenderingContent $renderingContent renderingContent + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + return $this; + } + + /** + * Gets serverTimeMS. + * + * @return null|int + */ + public function getServerTimeMS() + { + return $this->container['serverTimeMS'] ?? null; + } + + /** + * Sets serverTimeMS. + * + * @param null|int $serverTimeMS time the server took to process the request, in milliseconds + * + * @return self + */ + public function setServerTimeMS($serverTimeMS) + { + $this->container['serverTimeMS'] = $serverTimeMS; + + return $this; + } + + /** + * Gets serverUsed. + * + * @return null|string + */ + public function getServerUsed() + { + return $this->container['serverUsed'] ?? null; + } + + /** + * Sets serverUsed. + * + * @param null|string $serverUsed host name of the server that processed the request + * + * @return self + */ + public function setServerUsed($serverUsed) + { + $this->container['serverUsed'] = $serverUsed; + + return $this; + } + + /** + * Gets userData. + * + * @return null|object + */ + public function getUserData() + { + return $this->container['userData'] ?? null; + } + + /** + * Sets userData. + * + * @param null|object $userData An object with custom data. You can store up to 32kB as custom data. + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + + /** + * Gets queryID. + * + * @return null|string + */ + public function getQueryID() + { + return $this->container['queryID'] ?? null; + } + + /** + * Sets queryID. + * + * @param null|string $queryID Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/). + * + * @return self + */ + public function setQueryID($queryID) + { + $this->container['queryID'] = $queryID; + + return $this; + } + + /** + * Gets automaticInsights. + * + * @return null|bool + */ + public function getAutomaticInsights() + { + return $this->container['automaticInsights'] ?? null; + } + + /** + * Sets automaticInsights. + * + * @param null|bool $automaticInsights whether automatic events collection is enabled for the application + * + * @return self + */ + public function setAutomaticInsights($automaticInsights) + { + $this->container['automaticInsights'] = $automaticInsights; + + return $this; + } + + /** + * Gets page. + * + * @return int + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page. + * + * @param int $page page of search results to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets nbHits. + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits'] ?? null; + } + + /** + * Sets nbHits. + * + * @param int $nbHits number of results (hits) + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets nbPages. + * + * @return int + */ + public function getNbPages() + { + return $this->container['nbPages'] ?? null; + } + + /** + * Sets nbPages. + * + * @param int $nbPages number of pages of results + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + + /** + * Gets hitsPerPage. + * + * @return int + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage. + * + * @param int $hitsPerPage number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets hits. + * + * @return \Algolia\AlgoliaSearch\Model\Composition\Hit[] + */ + public function getHits() + { + return $this->container['hits'] ?? null; + } + + /** + * Sets hits. + * + * @param \Algolia\AlgoliaSearch\Model\Composition\Hit[] $hits Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting. + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + + /** + * Gets query. + * + * @return string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query. + * + * @param string $query search query + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets params. + * + * @return string + */ + public function getParams() + { + return $this->container['params'] ?? null; + } + + /** + * Sets params. + * + * @param string $params URL-encoded string of all search parameters + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets compositions. + * + * @return array + */ + public function getCompositions() + { + return $this->container['compositions'] ?? null; + } + + /** + * Sets compositions. + * + * @param array $compositions compositions + * + * @return self + */ + public function setCompositions($compositions) + { + $this->container['compositions'] = $compositions; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/SnippetResult.php b/lib/Model/Composition/SnippetResult.php new file mode 100644 index 00000000..bc0024a6 --- /dev/null +++ b/lib/Model/Composition/SnippetResult.php @@ -0,0 +1,265 @@ + 'string', + 'matchLevel' => '\Algolia\AlgoliaSearch\Model\Composition\MatchLevel', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'value' => null, + 'matchLevel' => null, + ]; + + /** + * 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', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['value'])) { + $this->container['value'] = $data['value']; + } + if (isset($data['matchLevel'])) { + $this->container['matchLevel'] = $data['matchLevel']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['value']) || null === $this->container['value']) { + $invalidProperties[] = "'value' can't be null"; + } + if (!isset($this->container['matchLevel']) || null === $this->container['matchLevel']) { + $invalidProperties[] = "'matchLevel' 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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets value. + * + * @return string + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value. + * + * @param string $value highlighted attribute value, including HTML tags + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matchLevel. + * + * @return MatchLevel + */ + public function getMatchLevel() + { + return $this->container['matchLevel'] ?? null; + } + + /** + * Sets matchLevel. + * + * @param MatchLevel $matchLevel matchLevel + * + * @return self + */ + public function setMatchLevel($matchLevel) + { + $this->container['matchLevel'] = $matchLevel; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/SnippetResultOption.php b/lib/Model/Composition/SnippetResultOption.php new file mode 100644 index 00000000..57709dc5 --- /dev/null +++ b/lib/Model/Composition/SnippetResultOption.php @@ -0,0 +1,267 @@ + 'string', + 'matchLevel' => '\Algolia\AlgoliaSearch\Model\Composition\MatchLevel', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'value' => null, + 'matchLevel' => null, + ]; + + /** + * 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', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['value'])) { + $this->container['value'] = $data['value']; + } + if (isset($data['matchLevel'])) { + $this->container['matchLevel'] = $data['matchLevel']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['value']) || null === $this->container['value']) { + $invalidProperties[] = "'value' can't be null"; + } + if (!isset($this->container['matchLevel']) || null === $this->container['matchLevel']) { + $invalidProperties[] = "'matchLevel' 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 0 === count($this->listInvalidProperties()); + } + + /** + * Gets value. + * + * @return string + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value. + * + * @param string $value highlighted attribute value, including HTML tags + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matchLevel. + * + * @return MatchLevel + */ + public function getMatchLevel() + { + return $this->container['matchLevel'] ?? null; + } + + /** + * Sets matchLevel. + * + * @param MatchLevel $matchLevel matchLevel + * + * @return self + */ + public function setMatchLevel($matchLevel) + { + $this->container['matchLevel'] = $matchLevel; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/SortRemainingBy.php b/lib/Model/Composition/SortRemainingBy.php new file mode 100644 index 00000000..df624609 --- /dev/null +++ b/lib/Model/Composition/SortRemainingBy.php @@ -0,0 +1,38 @@ + 'string[]', + 'sortRemainingBy' => '\Algolia\AlgoliaSearch\Model\Composition\SortRemainingBy', + 'hide' => 'string[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'order' => null, + 'sortRemainingBy' => null, + 'hide' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'order' => 'order', + 'sortRemainingBy' => 'sortRemainingBy', + 'hide' => 'hide', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'order' => 'setOrder', + 'sortRemainingBy' => 'setSortRemainingBy', + 'hide' => 'setHide', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'order' => 'getOrder', + 'sortRemainingBy' => 'getSortRemainingBy', + 'hide' => 'getHide', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['order'])) { + $this->container['order'] = $data['order']; + } + if (isset($data['sortRemainingBy'])) { + $this->container['sortRemainingBy'] = $data['sortRemainingBy']; + } + if (isset($data['hide'])) { + $this->container['hide'] = $data['hide']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets order. + * + * @return null|string[] + */ + public function getOrder() + { + return $this->container['order'] ?? null; + } + + /** + * Sets order. + * + * @param null|string[] $order Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at the top of the list. + * + * @return self + */ + public function setOrder($order) + { + $this->container['order'] = $order; + + return $this; + } + + /** + * Gets sortRemainingBy. + * + * @return null|SortRemainingBy + */ + public function getSortRemainingBy() + { + return $this->container['sortRemainingBy'] ?? null; + } + + /** + * Sets sortRemainingBy. + * + * @param null|SortRemainingBy $sortRemainingBy sortRemainingBy + * + * @return self + */ + public function setSortRemainingBy($sortRemainingBy) + { + $this->container['sortRemainingBy'] = $sortRemainingBy; + + return $this; + } + + /** + * Gets hide. + * + * @return null|string[] + */ + public function getHide() + { + return $this->container['hide'] ?? null; + } + + /** + * Sets hide. + * + * @param null|string[] $hide hide facet values + * + * @return self + */ + public function setHide($hide) + { + $this->container['hide'] = $hide; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/lib/Model/Composition/Widgets.php b/lib/Model/Composition/Widgets.php new file mode 100644 index 00000000..f28a8006 --- /dev/null +++ b/lib/Model/Composition/Widgets.php @@ -0,0 +1,226 @@ + '\Algolia\AlgoliaSearch\Model\Composition\Banner[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static $modelFormats = [ + 'banners' => null, + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static $attributeMap = [ + 'banners' => 'banners', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static $setters = [ + 'banners' => 'setBanners', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static $getters = [ + 'banners' => 'getBanners', + ]; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(?array $data = null) + { + if (isset($data['banners'])) { + $this->container['banners'] = $data['banners']; + } + } + + /** + * 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 property to type mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @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; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid() + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets banners. + * + * @return null|\Algolia\AlgoliaSearch\Model\Composition\Banner[] + */ + public function getBanners() + { + return $this->container['banners'] ?? null; + } + + /** + * Sets banners. + * + * @param null|\Algolia\AlgoliaSearch\Model\Composition\Banner[] $banners banners defined in the Merchandising Studio for a given search + * + * @return self + */ + public function setBanners($banners) + { + $this->container['banners'] = $banners; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +}