diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java index 2a89b58b9b..c89c77f4e9 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java @@ -2,6 +2,7 @@ import com.algolia.exceptions.*; import com.algolia.utils.Requester; +import com.algolia.utils.UserAgent; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.lang.reflect.Type; @@ -28,8 +29,21 @@ public class ApiClient { /* * Constructor for ApiClient with custom Requester */ - public ApiClient(String appId, String apiKey, Requester requester) { - setUserAgent("OpenAPI-Generator/0.1.0/java"); + public ApiClient( + String appId, + String apiKey, + Requester requester, + String clientName, + UserAgent.Segment[] segments + ) { + UserAgent ua = new UserAgent("0.0.1"); + ua.addSegment(new UserAgent.Segment(clientName, "0.0.1")); + if (segments != null) { + for (UserAgent.Segment segment : segments) { + ua.addSegment(segment); + } + } + setUserAgent(ua.toString()); this.appId = appId; this.apiKey = apiKey; diff --git a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java index 6f79f3077f..6e9e68a20c 100644 --- a/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java +++ b/clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java @@ -26,11 +26,33 @@ public class SearchApi extends ApiClient { public SearchApi(String appId, String apiKey) { - super(appId, apiKey, new HttpRequester(getDefaultHosts(appId))); + this(appId, apiKey, new HttpRequester(getDefaultHosts(appId)), null); + } + + public SearchApi( + String appId, + String apiKey, + UserAgent.Segment[] userAgentSegments + ) { + this( + appId, + apiKey, + new HttpRequester(getDefaultHosts(appId)), + userAgentSegments + ); } public SearchApi(String appId, String apiKey, Requester requester) { - super(appId, apiKey, requester); + this(appId, apiKey, requester, null); + } + + public SearchApi( + String appId, + String apiKey, + Requester requester, + UserAgent.Segment[] userAgentSegments + ) { + super(appId, apiKey, requester, "Search", userAgentSegments); } private static List getDefaultHosts(String appId) { diff --git a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php index 13217305b2..3b75351120 100644 --- a/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php +++ b/clients/algoliasearch-client-php/lib/Api/AbtestingApi.php @@ -54,7 +54,7 @@ public static function create($appId = null, $apiKey = null, $region = null) } /** - * Instantiate the client with congiguration + * Instantiate the client with configuration * * @param AbtestingConfig $config Configuration */ @@ -90,8 +90,13 @@ public function getClientConfig() * Creates a new A/B test with provided configuration. * * @param array $addABTestsRequest addABTestsRequest (required) + * - $addABTestsRequest['name'] => (string) A/B test name. (required) + * - $addABTestsRequest['variant'] => (array) List of 2 variants for the A/B test. (required) + * - $addABTestsRequest['endAt'] => (string) End date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ. (required) * - * @return array + * @see \Algolia\AlgoliaSearch\Model\Abtesting\AddABTestsRequest + * + * @return array|\Algolia\AlgoliaSearch\Model\Abtesting\ABTestResponse */ public function addABTests($addABTestsRequest) { @@ -120,7 +125,7 @@ public function addABTests($addABTestsRequest) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function del($path, $parameters = null, $body = null) { @@ -149,7 +154,7 @@ public function del($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -166,7 +171,7 @@ public function del($path, $parameters = null, $body = null) * * @param int $id The A/B test ID. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Abtesting\ABTestResponse */ public function deleteABTest($id) { @@ -199,7 +204,7 @@ public function deleteABTest($id) * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) * @param array $parameters Query parameters to be applied to the current query. (optional) * - * @return array + * @return array|object */ public function get($path, $parameters = null) { @@ -228,7 +233,7 @@ public function get($path, $parameters = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -241,7 +246,7 @@ public function get($path, $parameters = null) * * @param int $id The A/B test ID. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Abtesting\ABTest */ public function getABTest($id) { @@ -274,7 +279,7 @@ public function getABTest($id) * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Abtesting\ListABTestsResponse */ public function listABTests($offset = 0, $limit = 10) { @@ -312,7 +317,7 @@ public function listABTests($offset = 0, $limit = 10) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function post($path, $parameters = null, $body = null) { @@ -341,7 +346,7 @@ public function post($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -360,7 +365,7 @@ public function post($path, $parameters = null, $body = null) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function put($path, $parameters = null, $body = null) { @@ -389,7 +394,7 @@ public function put($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -406,7 +411,7 @@ public function put($path, $parameters = null, $body = null) * * @param int $id The A/B test ID. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Abtesting\ABTestResponse */ public function stopABTest($id) { diff --git a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php index 3e02fc3cf6..34a97bb6d5 100644 --- a/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/AnalyticsApi.php @@ -54,7 +54,7 @@ public static function create($appId = null, $apiKey = null, $region = null) } /** - * Instantiate the client with congiguration + * Instantiate the client with configuration * * @param AnalyticsConfig $config Configuration */ @@ -93,7 +93,7 @@ public function getClientConfig() * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function del($path, $parameters = null, $body = null) { @@ -122,7 +122,7 @@ public function del($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -140,7 +140,7 @@ public function del($path, $parameters = null, $body = null) * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) * @param array $parameters Query parameters to be applied to the current query. (optional) * - * @return array + * @return array|object */ public function get($path, $parameters = null) { @@ -169,7 +169,7 @@ public function get($path, $parameters = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -185,7 +185,7 @@ public function get($path, $parameters = null) * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetAverageClickPositionResponse */ public function getAverageClickPosition($index, $startDate = null, $endDate = null, $tags = null) { @@ -258,7 +258,7 @@ public function getAverageClickPosition($index, $startDate = null, $endDate = nu * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetClickPositionsResponse */ public function getClickPositions($index, $startDate = null, $endDate = null, $tags = null) { @@ -331,7 +331,7 @@ public function getClickPositions($index, $startDate = null, $endDate = null, $t * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetClickThroughRateResponse */ public function getClickThroughRate($index, $startDate = null, $endDate = null, $tags = null) { @@ -404,7 +404,7 @@ public function getClickThroughRate($index, $startDate = null, $endDate = null, * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetConversationRateResponse */ public function getConversationRate($index, $startDate = null, $endDate = null, $tags = null) { @@ -477,7 +477,7 @@ public function getConversationRate($index, $startDate = null, $endDate = null, * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetNoClickRateResponse */ public function getNoClickRate($index, $startDate = null, $endDate = null, $tags = null) { @@ -550,7 +550,7 @@ public function getNoClickRate($index, $startDate = null, $endDate = null, $tags * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetNoResultsRateResponse */ public function getNoResultsRate($index, $startDate = null, $endDate = null, $tags = null) { @@ -623,7 +623,7 @@ public function getNoResultsRate($index, $startDate = null, $endDate = null, $ta * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetSearchesCountResponse */ public function getSearchesCount($index, $startDate = null, $endDate = null, $tags = null) { @@ -698,7 +698,7 @@ public function getSearchesCount($index, $startDate = null, $endDate = null, $ta * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoClicksResponse */ public function getSearchesNoClicks($index, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) { @@ -793,7 +793,7 @@ public function getSearchesNoClicks($index, $startDate = null, $endDate = null, * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoResultsResponse */ public function getSearchesNoResults($index, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) { @@ -883,7 +883,7 @@ public function getSearchesNoResults($index, $startDate = null, $endDate = null, * * @param string $index The index name to target. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetStatusResponse */ public function getStatus($index) { @@ -921,7 +921,7 @@ public function getStatus($index) * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetTopCountriesResponse */ public function getTopCountries($index, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) { @@ -1017,7 +1017,7 @@ public function getTopCountries($index, $startDate = null, $endDate = null, $lim * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterAttributesResponse */ public function getTopFilterAttributes($index, $search = null, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) { @@ -1124,7 +1124,7 @@ public function getTopFilterAttributes($index, $search = null, $startDate = null * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterForAttributeResponse */ public function getTopFilterForAttribute($attribute, $index, $search = null, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) { @@ -1245,7 +1245,7 @@ public function getTopFilterForAttribute($attribute, $index, $search = null, $st * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetTopFiltersNoResultsResponse */ public function getTopFiltersNoResults($index, $search = null, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) { @@ -1345,14 +1345,14 @@ public function getTopFiltersNoResults($index, $search = null, $startDate = null * * @param string $index The index name to target. (required) * @param string $search The query term to search for. Must match the exact user input. (optional) - * @param array $clickAnalytics Whether to include the click-through and conversion rates for a search. (optional, default to false) + * @param bool $clickAnalytics Whether to include the click-through and conversion rates for a search. (optional, default to false) * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) * @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10) * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetTopHitsResponse */ public function getTopHits($index, $search = null, $clickAnalytics = false, $startDate = null, $endDate = null, $limit = 10, $offset = 0, $tags = null) { @@ -1461,7 +1461,7 @@ public function getTopHits($index, $search = null, $clickAnalytics = false, $sta * Returns top searches. * * @param string $index The index name to target. (required) - * @param array $clickAnalytics Whether to include the click-through and conversion rates for a search. (optional, default to false) + * @param bool $clickAnalytics Whether to include the click-through and conversion rates for a search. (optional, default to false) * @param string $startDate The lower bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) * @param string $orderBy Reorder the results. (optional, default to 'searchCount') @@ -1470,7 +1470,7 @@ public function getTopHits($index, $search = null, $clickAnalytics = false, $sta * @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetTopSearchesResponse */ public function getTopSearches($index, $clickAnalytics = false, $startDate = null, $endDate = null, $orderBy = 'searchCount', $direction = 'asc', $limit = 10, $offset = 0, $tags = null) { @@ -1593,7 +1593,7 @@ public function getTopSearches($index, $clickAnalytics = false, $startDate = nul * @param string $endDate The upper bound timestamp (a date, a string like \"2006-01-02\") of the period to analyze. (optional) * @param string $tags Filter metrics on the provided tags. Each tag must correspond to an analyticsTags set at search time. Multiple tags can be combined with the operators OR and AND. If a tag contains characters like spaces or parentheses, it should be URL encoded. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Analytics\GetUsersCountResponse */ public function getUsersCount($index, $startDate = null, $endDate = null, $tags = null) { @@ -1665,7 +1665,7 @@ public function getUsersCount($index, $startDate = null, $endDate = null, $tags * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function post($path, $parameters = null, $body = null) { @@ -1694,7 +1694,7 @@ public function post($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -1713,7 +1713,7 @@ public function post($path, $parameters = null, $body = null) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function put($path, $parameters = null, $body = null) { @@ -1742,7 +1742,7 @@ public function put($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } diff --git a/clients/algoliasearch-client-php/lib/Api/InsightsApi.php b/clients/algoliasearch-client-php/lib/Api/InsightsApi.php index fe7180ca3c..870f9c9fd7 100644 --- a/clients/algoliasearch-client-php/lib/Api/InsightsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/InsightsApi.php @@ -53,7 +53,7 @@ public static function create($appId = null, $apiKey = null, $region = null) } /** - * Instantiate the client with congiguration + * Instantiate the client with configuration * * @param InsightsConfig $config Configuration */ @@ -92,7 +92,7 @@ public function getClientConfig() * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function del($path, $parameters = null, $body = null) { @@ -121,7 +121,7 @@ public function del($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -139,7 +139,7 @@ public function del($path, $parameters = null, $body = null) * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) * @param array $parameters Query parameters to be applied to the current query. (optional) * - * @return array + * @return array|object */ public function get($path, $parameters = null) { @@ -168,7 +168,7 @@ public function get($path, $parameters = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -183,7 +183,7 @@ public function get($path, $parameters = null) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function post($path, $parameters = null, $body = null) { @@ -212,7 +212,7 @@ public function post($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -228,8 +228,11 @@ public function post($path, $parameters = null, $body = null) * Pushes an array of events. * * @param array $insightEvents insightEvents (required) + * - $insightEvents['events'] => (array) Array of events sent. (required) * - * @return array + * @see \Algolia\AlgoliaSearch\Model\Insights\InsightEvents + * + * @return array|\Algolia\AlgoliaSearch\Model\Insights\PushEventsResponse */ public function pushEvents($insightEvents) { @@ -258,7 +261,7 @@ public function pushEvents($insightEvents) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function put($path, $parameters = null, $body = null) { @@ -287,7 +290,7 @@ public function put($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } diff --git a/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php b/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php index ecf80c0fb4..f5f6e95994 100644 --- a/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php +++ b/clients/algoliasearch-client-php/lib/Api/PersonalizationApi.php @@ -54,7 +54,7 @@ public static function create($appId = null, $apiKey = null, $region = null) } /** - * Instantiate the client with congiguration + * Instantiate the client with configuration * * @param PersonalizationConfig $config Configuration */ @@ -93,7 +93,7 @@ public function getClientConfig() * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function del($path, $parameters = null, $body = null) { @@ -122,7 +122,7 @@ public function del($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -139,7 +139,7 @@ public function del($path, $parameters = null, $body = null) * * @param string $userToken userToken representing the user for which to fetch the Personalization profile. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Personalization\DeleteUserProfileResponse */ public function deleteUserProfile($userToken) { @@ -172,7 +172,7 @@ public function deleteUserProfile($userToken) * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) * @param array $parameters Query parameters to be applied to the current query. (optional) * - * @return array + * @return array|object */ public function get($path, $parameters = null) { @@ -201,7 +201,7 @@ public function get($path, $parameters = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -213,7 +213,7 @@ public function get($path, $parameters = null) * Get the current personalization strategy. * * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Personalization\PersonalizationStrategyParams */ public function getPersonalizationStrategy() { @@ -229,7 +229,7 @@ public function getPersonalizationStrategy() * * @param string $userToken userToken representing the user for which to fetch the Personalization profile. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Personalization\GetUserTokenResponse */ public function getUserTokenProfile($userToken) { @@ -263,7 +263,7 @@ public function getUserTokenProfile($userToken) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function post($path, $parameters = null, $body = null) { @@ -292,7 +292,7 @@ public function post($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -311,7 +311,7 @@ public function post($path, $parameters = null, $body = null) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function put($path, $parameters = null, $body = null) { @@ -340,7 +340,7 @@ public function put($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -356,8 +356,13 @@ public function put($path, $parameters = null, $body = null) * Set a new personalization strategy. * * @param array $personalizationStrategyParams personalizationStrategyParams (required) + * - $personalizationStrategyParams['eventScoring'] => (array) Scores associated with the events. (required) + * - $personalizationStrategyParams['facetScoring'] => (array) Scores associated with the facets. (required) + * - $personalizationStrategyParams['personalizationImpact'] => (int) The impact that personalization has on search results: a number between 0 (personalization disabled) and 100 (personalization fully enabled). (required) * - * @return array + * @see \Algolia\AlgoliaSearch\Model\Personalization\PersonalizationStrategyParams + * + * @return array|\Algolia\AlgoliaSearch\Model\Personalization\SetPersonalizationStrategyResponse */ public function setPersonalizationStrategy($personalizationStrategyParams) { diff --git a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php index f03f9d1648..88594e84f7 100644 --- a/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php +++ b/clients/algoliasearch-client-php/lib/Api/QuerySuggestionsApi.php @@ -54,7 +54,7 @@ public static function create($appId = null, $apiKey = null, $region = null) } /** - * Instantiate the client with congiguration + * Instantiate the client with configuration * * @param QuerySuggestionsConfig $config Configuration */ @@ -91,7 +91,9 @@ public function getClientConfig() * * @param array $querySuggestionsIndexWithIndexParam querySuggestionsIndexWithIndexParam (required) * - * @return array + * @see \Algolia\AlgoliaSearch\Model\QuerySuggestions\QuerySuggestionsIndexWithIndexParam + * + * @return array|\Algolia\AlgoliaSearch\Model\QuerySuggestions\SucessResponse */ public function createConfig($querySuggestionsIndexWithIndexParam) { @@ -120,7 +122,7 @@ public function createConfig($querySuggestionsIndexWithIndexParam) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function del($path, $parameters = null, $body = null) { @@ -149,7 +151,7 @@ public function del($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -166,7 +168,7 @@ public function del($path, $parameters = null, $body = null) * * @param string $indexName The index in which to perform the request. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\QuerySuggestions\SucessResponse */ public function deleteConfig($indexName) { @@ -199,7 +201,7 @@ public function deleteConfig($indexName) * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) * @param array $parameters Query parameters to be applied to the current query. (optional) * - * @return array + * @return array|object */ public function get($path, $parameters = null) { @@ -228,7 +230,7 @@ public function get($path, $parameters = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -240,7 +242,7 @@ public function get($path, $parameters = null) * Get all the configurations of Query Suggestions. * * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\QuerySuggestions\QuerySuggestionsIndex[] */ public function getAllConfigs() { @@ -256,7 +258,7 @@ public function getAllConfigs() * * @param string $indexName The index in which to perform the request. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\QuerySuggestions\QuerySuggestionsIndex */ public function getConfig($indexName) { @@ -288,7 +290,7 @@ public function getConfig($indexName) * * @param string $indexName The index in which to perform the request. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\QuerySuggestions\Status */ public function getConfigStatus($indexName) { @@ -320,7 +322,7 @@ public function getConfigStatus($indexName) * * @param string $indexName The index in which to perform the request. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\QuerySuggestions\LogFile[] */ public function getLogFile($indexName) { @@ -354,7 +356,7 @@ public function getLogFile($indexName) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function post($path, $parameters = null, $body = null) { @@ -383,7 +385,7 @@ public function post($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -402,7 +404,7 @@ public function post($path, $parameters = null, $body = null) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function put($path, $parameters = null, $body = null) { @@ -431,7 +433,7 @@ public function put($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -448,8 +450,13 @@ public function put($path, $parameters = null, $body = null) * * @param string $indexName The index in which to perform the request. (required) * @param array $querySuggestionsIndexParam querySuggestionsIndexParam (required) + * - $querySuggestionsIndexParam['sourceIndices'] => (array) List of source indices used to generate a Query Suggestions index. (required) + * - $querySuggestionsIndexParam['languages'] => (array) De-duplicate singular and plural suggestions. For example, let's say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain. + * - $querySuggestionsIndexParam['exclude'] => (array) List of words and patterns to exclude from the Query Suggestions index. + * + * @see \Algolia\AlgoliaSearch\Model\QuerySuggestions\QuerySuggestionsIndexParam * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\QuerySuggestions\SucessResponse */ public function updateConfig($indexName, $querySuggestionsIndexParam) { diff --git a/clients/algoliasearch-client-php/lib/Api/RecommendApi.php b/clients/algoliasearch-client-php/lib/Api/RecommendApi.php index 36251f7a18..0f92385361 100644 --- a/clients/algoliasearch-client-php/lib/Api/RecommendApi.php +++ b/clients/algoliasearch-client-php/lib/Api/RecommendApi.php @@ -49,7 +49,7 @@ public static function create($appId = null, $apiKey = null) } /** - * Instantiate the client with congiguration + * Instantiate the client with configuration * * @param RecommendConfig $config Configuration */ @@ -93,7 +93,7 @@ public function getClientConfig() * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function del($path, $parameters = null, $body = null) { @@ -122,7 +122,7 @@ public function del($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -140,7 +140,7 @@ public function del($path, $parameters = null, $body = null) * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) * @param array $parameters Query parameters to be applied to the current query. (optional) * - * @return array + * @return array|object */ public function get($path, $parameters = null) { @@ -169,7 +169,7 @@ public function get($path, $parameters = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -181,8 +181,11 @@ public function get($path, $parameters = null) * Returns recommendations for a specific model and objectID. * * @param array $getRecommendationsParams getRecommendationsParams (required) + * - $getRecommendationsParams['requests'] => (array) The `getRecommendations` requests. (required) * - * @return array + * @see \Algolia\AlgoliaSearch\Model\Recommend\GetRecommendationsParams + * + * @return array|\Algolia\AlgoliaSearch\Model\Recommend\GetRecommendationsResponse */ public function getRecommendations($getRecommendationsParams) { @@ -211,7 +214,7 @@ public function getRecommendations($getRecommendationsParams) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function post($path, $parameters = null, $body = null) { @@ -240,7 +243,7 @@ public function post($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -259,7 +262,7 @@ public function post($path, $parameters = null, $body = null) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function put($path, $parameters = null, $body = null) { @@ -288,7 +291,7 @@ public function put($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } diff --git a/clients/algoliasearch-client-php/lib/Api/SearchApi.php b/clients/algoliasearch-client-php/lib/Api/SearchApi.php index 81d7b50796..d2a572aacf 100644 --- a/clients/algoliasearch-client-php/lib/Api/SearchApi.php +++ b/clients/algoliasearch-client-php/lib/Api/SearchApi.php @@ -8,6 +8,7 @@ use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapper; use Algolia\AlgoliaSearch\RetryStrategy\ApiWrapperInterface; use Algolia\AlgoliaSearch\RetryStrategy\ClusterHosts; +use GuzzleHttp\RequestOptions; /** * SearchApi Class Doc Comment @@ -50,7 +51,7 @@ public static function create($appId = null, $apiKey = null) } /** - * Instantiate the client with congiguration + * Instantiate the client with configuration * * @param SearchConfig $config Configuration */ @@ -91,8 +92,18 @@ public function getClientConfig() * Create a new API key. * * @param array $apiKey apiKey (required) + * - $apiKey['acl'] => (array) Set of permissions associated with the key. (required) + * - $apiKey['description'] => (string) A comment used to identify a key more easily in the dashboard. It is not interpreted by the API. + * - $apiKey['indexes'] => (array) Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed. + * - $apiKey['maxHitsPerQuery'] => (int) Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. + * - $apiKey['maxQueriesPerIPPerHour'] => (int) Maximum number of API calls per hour allowed from a given IP address or a user token. + * - $apiKey['queryParameters'] => (string) URL-encoded query string. Force some query parameters to be applied for each query made with this API key. + * - $apiKey['referers'] => (array) Restrict this new API key to specific referers. If empty or blank, defaults to all referers. + * - $apiKey['validity'] => (int) Validity limit for this key in seconds. The key will automatically be removed after this period of time. * - * @return array + * @see \Algolia\AlgoliaSearch\Model\Search\ApiKey + * + * @return array|\Algolia\AlgoliaSearch\Model\Search\AddApiKeyResponse */ public function addApiKey($apiKey) { @@ -121,7 +132,7 @@ public function addApiKey($apiKey) * @param string $objectID Unique identifier of an object. (required) * @param array $body The Algolia object. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdatedAtWithObjectIdResponse */ public function addOrUpdateObject($indexName, $objectID, $body) { @@ -178,7 +189,9 @@ public function addOrUpdateObject($indexName, $objectID, $body) * * @param array $source The source to add. (required) * - * @return array + * @see \Algolia\AlgoliaSearch\Model\Search\Source + * + * @return array|\Algolia\AlgoliaSearch\Model\Search\CreatedAtResponse */ public function appendSource($source) { @@ -205,8 +218,11 @@ public function appendSource($source) * * @param string $xAlgoliaUserID userID to assign. (required) * @param array $assignUserIdParams assignUserIdParams (required) + * - $assignUserIdParams['cluster'] => (string) Name of the cluster. (required) * - * @return array + * @see \Algolia\AlgoliaSearch\Model\Search\AssignUserIdParams + * + * @return array|\Algolia\AlgoliaSearch\Model\Search\CreatedAtResponse */ public function assignUserId($xAlgoliaUserID, $assignUserIdParams) { @@ -253,8 +269,11 @@ public function assignUserId($xAlgoliaUserID, $assignUserIdParams) * * @param string $indexName The index in which to perform the request. (required) * @param array $batchWriteParams batchWriteParams (required) + * - $batchWriteParams['requests'] => (array) + * + * @see \Algolia\AlgoliaSearch\Model\Search\BatchWriteParams * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\BatchResponse */ public function batch($indexName, $batchWriteParams) { @@ -296,8 +315,12 @@ public function batch($indexName, $batchWriteParams) * * @param string $xAlgoliaUserID userID to assign. (required) * @param array $batchAssignUserIdsParams batchAssignUserIdsParams (required) + * - $batchAssignUserIdsParams['cluster'] => (string) Name of the cluster. (required) + * - $batchAssignUserIdsParams['users'] => (array) userIDs to assign. Note you cannot move users with this method. (required) * - * @return array + * @see \Algolia\AlgoliaSearch\Model\Search\BatchAssignUserIdsParams + * + * @return array|\Algolia\AlgoliaSearch\Model\Search\CreatedAtResponse */ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsParams) { @@ -344,8 +367,12 @@ public function batchAssignUserIds($xAlgoliaUserID, $batchAssignUserIdsParams) * * @param array $dictionaryName The dictionary to search in. (required) * @param array $batchDictionaryEntriesParams batchDictionaryEntriesParams (required) + * - $batchDictionaryEntriesParams['clearExistingDictionaryEntries'] => (bool) When `true`, start the batch by removing all the custom entries from the dictionary. + * - $batchDictionaryEntriesParams['requests'] => (array) List of operations to batch. Each operation is described by an `action` and a `body`. (required) + * + * @see \Algolia\AlgoliaSearch\Model\Search\BatchDictionaryEntriesParams * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse */ public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntriesParams) { @@ -387,10 +414,10 @@ public function batchDictionaryEntries($dictionaryName, $batchDictionaryEntriesP * * @param string $indexName The index in which to perform the request. (required) * @param array $rule rule (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) - * @param array $clearExistingRules When true, existing Rules are cleared before adding this batch. When false, existing Rules are kept. (optional) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * @param bool $clearExistingRules When true, existing Rules are cleared before adding this batch. When false, existing Rules are kept. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse */ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearExistingRules = null) { @@ -452,8 +479,12 @@ public function batchRules($indexName, $rule, $forwardToReplicas = null, $clearE * * @param string $indexName The index in which to perform the request. (required) * @param array $browseRequest browseRequest (optional) + * - $browseRequest['params'] => (string) Search parameters as URL-encoded query string. + * - $browseRequest['cursor'] => (string) Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. + * + * @see \Algolia\AlgoliaSearch\Model\Search\BrowseRequest * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\BrowseResponse */ public function browse($indexName, $browseRequest = null) { @@ -488,9 +519,9 @@ public function browse($indexName, $browseRequest = null) * Clear all synonyms. * * @param string $indexName The index in which to perform the request. (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse */ public function clearAllSynonyms($indexName, $forwardToReplicas = null) { @@ -532,7 +563,7 @@ public function clearAllSynonyms($indexName, $forwardToReplicas = null) * * @param string $indexName The index in which to perform the request. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse */ public function clearObjects($indexName) { @@ -563,9 +594,9 @@ public function clearObjects($indexName) * Clear Rules. * * @param string $indexName The index in which to perform the request. (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse */ public function clearRules($indexName, $forwardToReplicas = null) { @@ -609,7 +640,7 @@ public function clearRules($indexName, $forwardToReplicas = null) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function del($path, $parameters = null, $body = null) { @@ -638,7 +669,7 @@ public function del($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -655,7 +686,7 @@ public function del($path, $parameters = null, $body = null) * * @param string $key API Key string. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\DeleteApiKeyResponse */ public function deleteApiKey($key) { @@ -688,7 +719,9 @@ public function deleteApiKey($key) * @param string $indexName The index in which to perform the request. (required) * @param array $searchParams searchParams (required) * - * @return array + * @see \Algolia\AlgoliaSearch\Model\Search\SearchParams + * + * @return array|\Algolia\AlgoliaSearch\Model\Search\DeletedAtResponse */ public function deleteBy($indexName, $searchParams) { @@ -730,7 +763,7 @@ public function deleteBy($indexName, $searchParams) * * @param string $indexName The index in which to perform the request. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\DeletedAtResponse */ public function deleteIndex($indexName) { @@ -763,7 +796,7 @@ public function deleteIndex($indexName) * @param string $indexName The index in which to perform the request. (required) * @param string $objectID Unique identifier of an object. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\DeletedAtResponse */ public function deleteObject($indexName, $objectID) { @@ -810,9 +843,9 @@ public function deleteObject($indexName, $objectID) * * @param string $indexName The index in which to perform the request. (required) * @param string $objectID Unique identifier of an object. (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse */ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) { @@ -869,7 +902,7 @@ public function deleteRule($indexName, $objectID, $forwardToReplicas = null) * * @param string $source The IP range of the source. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\DeleteSourceResponse */ public function deleteSource($source) { @@ -901,9 +934,9 @@ public function deleteSource($source) * * @param string $indexName The index in which to perform the request. (required) * @param string $objectID Unique identifier of an object. (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\DeletedAtResponse */ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) { @@ -961,7 +994,7 @@ public function deleteSynonym($indexName, $objectID, $forwardToReplicas = null) * @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required) * @param array $parameters Query parameters to be applied to the current query. (optional) * - * @return array + * @return array|object */ public function get($path, $parameters = null) { @@ -990,7 +1023,7 @@ public function get($path, $parameters = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -1003,7 +1036,7 @@ public function get($path, $parameters = null) * * @param string $key API Key string. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\Key */ public function getApiKey($key) { @@ -1034,7 +1067,7 @@ public function getApiKey($key) * List dictionaries supported per language. * * - * @return array + * @return array|array */ public function getDictionaryLanguages() { @@ -1049,7 +1082,7 @@ public function getDictionaryLanguages() * Retrieve dictionaries settings. The API stores languages whose standard entries are disabled. Fetch settings does not return false values. * * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\GetDictionarySettingsResponse */ public function getDictionarySettings() { @@ -1068,7 +1101,7 @@ public function getDictionarySettings() * @param string $indexName Index for which log entries should be retrieved. When omitted, log entries are retrieved across all indices. (optional) * @param array $type Type of log entries to retrieve. When omitted, all log entries are retrieved. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\GetLogsResponse */ public function getLogs($offset = 0, $length = 10, $indexName = null, $type = null) { @@ -1130,7 +1163,7 @@ public function getLogs($offset = 0, $length = 10, $indexName = null, $type = nu * @param string $objectID Unique identifier of an object. (required) * @param array $attributesToRetrieve List of attributes to retrieve. If not specified, all retrievable attributes are returned. (optional) * - * @return array + * @return array|array */ public function getObject($indexName, $objectID, $attributesToRetrieve = null) { @@ -1186,8 +1219,11 @@ public function getObject($indexName, $objectID, $attributesToRetrieve = null) * Retrieve one or more objects. * * @param array $getObjectsParams getObjectsParams (required) + * - $getObjectsParams['requests'] => (array) + * + * @see \Algolia\AlgoliaSearch\Model\Search\GetObjectsParams * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\GetObjectsResponse */ public function getObjects($getObjectsParams) { @@ -1215,7 +1251,7 @@ public function getObjects($getObjectsParams) * @param string $indexName The index in which to perform the request. (required) * @param string $objectID Unique identifier of an object. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\Rule */ public function getRule($indexName, $objectID) { @@ -1262,7 +1298,7 @@ public function getRule($indexName, $objectID) * * @param string $indexName The index in which to perform the request. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\IndexSettings */ public function getSettings($indexName) { @@ -1293,7 +1329,7 @@ public function getSettings($indexName) * List all allowed sources. * * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\Source[] */ public function getSources() { @@ -1310,7 +1346,7 @@ public function getSources() * @param string $indexName The index in which to perform the request. (required) * @param string $objectID Unique identifier of an object. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\SynonymHit */ public function getSynonym($indexName, $objectID) { @@ -1358,7 +1394,7 @@ public function getSynonym($indexName, $objectID) * @param string $indexName The index in which to perform the request. (required) * @param int $taskID Unique identifier of an task. Numeric value (up to 64bits). (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\GetTaskResponse */ public function getTask($indexName, $taskID) { @@ -1404,7 +1440,7 @@ public function getTask($indexName, $taskID) * Get top userID * * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\GetTopUserIdsResponse */ public function getTopUserIds() { @@ -1420,7 +1456,7 @@ public function getTopUserIds() * * @param string $userID userID to assign. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\UserId */ public function getUserId($userID) { @@ -1453,9 +1489,9 @@ public function getUserId($userID) /** * Has pending mappings * - * @param array $getClusters Whether to get clusters or not. (optional) + * @param bool $getClusters Whether to get clusters or not. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\CreatedAtResponse */ public function hasPendingMappings($getClusters = null) { @@ -1480,7 +1516,7 @@ public function hasPendingMappings($getClusters = null) * Get the full list of API Keys. * * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\ListApiKeysResponse */ public function listApiKeys() { @@ -1495,7 +1531,7 @@ public function listApiKeys() * List clusters * * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\ListClustersResponse */ public function listClusters() { @@ -1511,7 +1547,7 @@ public function listClusters() * * @param int $page Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\ListIndicesResponse */ public function listIndices($page = null) { @@ -1538,7 +1574,7 @@ public function listIndices($page = null) * @param int $page Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). (optional) * @param int $hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\ListUserIdsResponse */ public function listUserIds($page = null, $hitsPerPage = 100) { @@ -1573,8 +1609,11 @@ public function listUserIds($page = null, $hitsPerPage = 100) * Perform multiple write operations. * * @param array $batchParams batchParams (required) + * - $batchParams['requests'] => (array) + * + * @see \Algolia\AlgoliaSearch\Model\Search\BatchParams * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\MultipleBatchResponse */ public function multipleBatch($batchParams) { @@ -1600,8 +1639,12 @@ public function multipleBatch($batchParams) * Get search results for the given requests. * * @param array $multipleQueriesParams multipleQueriesParams (required) + * - $multipleQueriesParams['requests'] => (array) (required) + * - $multipleQueriesParams['strategy'] => (array) * - * @return array + * @see \Algolia\AlgoliaSearch\Model\Search\MultipleQueriesParams + * + * @return array|\Algolia\AlgoliaSearch\Model\Search\MultipleQueriesResponse */ public function multipleQueries($multipleQueriesParams) { @@ -1628,8 +1671,13 @@ public function multipleQueries($multipleQueriesParams) * * @param string $indexName The index in which to perform the request. (required) * @param array $operationIndexParams operationIndexParams (required) + * - $operationIndexParams['operation'] => (array) (required) + * - $operationIndexParams['destination'] => (string) The Algolia index name. (required) + * - $operationIndexParams['scope'] => (array) Scope of the data to copy. When absent, a full copy is performed. When present, only the selected scopes are copied. + * + * @see \Algolia\AlgoliaSearch\Model\Search\OperationIndexParams * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse */ public function operationIndex($indexName, $operationIndexParams) { @@ -1672,9 +1720,9 @@ public function operationIndex($indexName, $operationIndexParams) * @param string $indexName The index in which to perform the request. (required) * @param string $objectID Unique identifier of an object. (required) * @param array $attributeOrBuiltInOperation List of attributes to update. (required) - * @param array $createIfNotExists Creates the record if it does not exist yet. (optional, default to true) + * @param bool $createIfNotExists Creates the record if it does not exist yet. (optional, default to true) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdatedAtWithObjectIdResponse */ public function partialUpdateObject($indexName, $objectID, $attributeOrBuiltInOperation, $createIfNotExists = true) { @@ -1743,7 +1791,7 @@ public function partialUpdateObject($indexName, $objectID, $attributeOrBuiltInOp * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function post($path, $parameters = null, $body = null) { @@ -1772,7 +1820,7 @@ public function post($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -1791,7 +1839,7 @@ public function post($path, $parameters = null, $body = null) * @param array $parameters Query parameters to be applied to the current query. (optional) * @param array $body The parameters to send with the custom request. (optional) * - * @return array + * @return array|object */ public function put($path, $parameters = null, $body = null) { @@ -1820,7 +1868,7 @@ public function put($path, $parameters = null, $body = null) if ($path !== null) { $resourcePath = str_replace( '{path}', - path, + $path, $resourcePath ); } @@ -1837,7 +1885,7 @@ public function put($path, $parameters = null, $body = null) * * @param string $userID userID to assign. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\RemoveUserIdResponse */ public function removeUserId($userID) { @@ -1872,7 +1920,7 @@ public function removeUserId($userID) * * @param array $source The sources to allow. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\ReplaceSourceResponse */ public function replaceSources($source) { @@ -1899,7 +1947,7 @@ public function replaceSources($source) * * @param string $key API Key string. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\AddApiKeyResponse */ public function restoreApiKey($key) { @@ -1932,7 +1980,7 @@ public function restoreApiKey($key) * @param string $indexName The index in which to perform the request. (required) * @param array $body The Algolia record. (required) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\SaveObjectResponse */ public function saveObject($indexName, $body) { @@ -1975,9 +2023,18 @@ public function saveObject($indexName, $body) * @param string $indexName The index in which to perform the request. (required) * @param string $objectID Unique identifier of an object. (required) * @param array $rule rule (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * - $rule['objectID'] => (string) Unique identifier of the object. (required) + * - $rule['conditions'] => (array) A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule. + * - $rule['consequence'] => (array) (required) + * - $rule['description'] => (string) This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It's not interpreted by the API. + * - $rule['enabled'] => (bool) Whether the Rule is enabled. Disabled Rules remain in the index, but aren't applied at query time. + * - $rule['validity'] => (array) By default, Rules are permanently valid. When validity periods are specified, the Rule applies only during those periods; it's ignored the rest of the time. The list must not be empty. + * + * @see \Algolia\AlgoliaSearch\Model\Search\Rule * - * @return array + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdatedRuleResponse */ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null) { @@ -2045,9 +2102,21 @@ public function saveRule($indexName, $objectID, $rule, $forwardToReplicas = null * @param string $indexName The index in which to perform the request. (required) * @param string $objectID Unique identifier of an object. (required) * @param array $synonymHit synonymHit (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * - $synonymHit['objectID'] => (string) Unique identifier of the synonym object to be created or updated. (required) + * - $synonymHit['type'] => (array) + * - $synonymHit['synonyms'] => (array) Words or phrases to be considered equivalent. + * - $synonymHit['input'] => (string) Word or phrase to appear in query strings (for onewaysynonym). + * - $synonymHit['word'] => (string) Word or phrase to appear in query strings (for altcorrection1 and altcorrection2). + * - $synonymHit['corrections'] => (array) Words to be matched in records. + * - $synonymHit['placeholder'] => (string) Token to be put inside records. + * - $synonymHit['replacements'] => (array) List of query words that will match the token. + * - $synonymHit['_highlightResult'] => (array) + * + * @see \Algolia\AlgoliaSearch\Model\Search\SynonymHit + * + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\SaveSynonymResponse */ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplicas = null) { @@ -2114,10 +2183,10 @@ public function saveSynonym($indexName, $objectID, $synonymHit, $forwardToReplic * * @param string $indexName The index in which to perform the request. (required) * @param array $synonymHit synonymHit (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) - * @param array $replaceExistingSynonyms Replace all synonyms of the index with the ones sent with this request. (optional) + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * @param bool $replaceExistingSynonyms Replace all synonyms of the index with the ones sent with this request. (optional) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse */ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, $replaceExistingSynonyms = null) { @@ -2180,7 +2249,9 @@ public function saveSynonyms($indexName, $synonymHit, $forwardToReplicas = null, * @param string $indexName The index in which to perform the request. (required) * @param array $searchParams searchParams (required) * - * @return array + * @see \Algolia\AlgoliaSearch\Model\Search\SearchParams + * + * @return array|\Algolia\AlgoliaSearch\Model\Search\SearchResponse */ public function search($indexName, $searchParams) { @@ -2222,8 +2293,14 @@ public function search($indexName, $searchParams) * * @param array $dictionaryName The dictionary to search in. (required) * @param array $searchDictionaryEntriesParams searchDictionaryEntriesParams (required) + * - $searchDictionaryEntriesParams['query'] => (string) The text to search in the index. (required) + * - $searchDictionaryEntriesParams['page'] => (int) Specify the page to retrieve. + * - $searchDictionaryEntriesParams['hitsPerPage'] => (int) Set the number of hits per page. + * - $searchDictionaryEntriesParams['language'] => (string) Language ISO code supported by the dictionary (e.g., \"en\" for English). + * + * @see \Algolia\AlgoliaSearch\Model\Search\SearchDictionaryEntriesParams * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse */ public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntriesParams) { @@ -2266,8 +2343,13 @@ public function searchDictionaryEntries($dictionaryName, $searchDictionaryEntrie * @param string $indexName The index in which to perform the request. (required) * @param string $facetName The facet name. (required) * @param array $searchForFacetValuesRequest searchForFacetValuesRequest (optional) + * - $searchForFacetValuesRequest['params'] => (string) Search parameters as URL-encoded query string. + * - $searchForFacetValuesRequest['facetQuery'] => (string) Text to search inside the facet's values. + * - $searchForFacetValuesRequest['maxFacetHits'] => (int) Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @see \Algolia\AlgoliaSearch\Model\Search\SearchForFacetValuesRequest * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\SearchForFacetValuesResponse */ public function searchForFacetValues($indexName, $facetName, $searchForFacetValuesRequest = null) { @@ -2318,8 +2400,17 @@ public function searchForFacetValues($indexName, $facetName, $searchForFacetValu * * @param string $indexName The index in which to perform the request. (required) * @param array $searchRulesParams searchRulesParams (required) + * - $searchRulesParams['query'] => (string) Full text query. + * - $searchRulesParams['anchoring'] => (array) + * - $searchRulesParams['context'] => (string) Restricts matches to contextual rules with a specific context (exact match). + * - $searchRulesParams['page'] => (int) Requested page (zero-based). + * - $searchRulesParams['hitsPerPage'] => (int) Maximum number of hits in a page. Minimum is 1, maximum is 1000. + * - $searchRulesParams['enabled'] => (bool) When specified, restricts matches to rules with a specific enabled status. When absent (default), all rules are retrieved, regardless of their enabled status. + * - $searchRulesParams['requestOptions'] => (array) A mapping of requestOptions to send along with the request. * - * @return array + * @see \Algolia\AlgoliaSearch\Model\Search\SearchRulesParams + * + * @return array|\Algolia\AlgoliaSearch\Model\Search\SearchRulesResponse */ public function searchRules($indexName, $searchRulesParams) { @@ -2365,7 +2456,7 @@ public function searchRules($indexName, $searchRulesParams) * @param int $page Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination). (optional, default to 0) * @param int $hitsPerPage Maximum number of objects to retrieve. (optional, default to 100) * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\SearchSynonymsResponse */ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, $hitsPerPage = 100) { @@ -2436,8 +2527,14 @@ public function searchSynonyms($indexName, $query = '', $type = null, $page = 0, * Search userID * * @param array $searchUserIdsParams searchUserIdsParams (required) + * - $searchUserIdsParams['query'] => (string) Query to search. The search is a prefix search with typoTolerance. Use empty query to retrieve all users. (required) + * - $searchUserIdsParams['clusterName'] => (string) Name of the cluster. + * - $searchUserIdsParams['page'] => (int) Specify the page to retrieve. + * - $searchUserIdsParams['hitsPerPage'] => (int) Set the number of hits per page. + * + * @see \Algolia\AlgoliaSearch\Model\Search\SearchUserIdsParams * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\SearchUserIdsResponse */ public function searchUserIds($searchUserIdsParams) { @@ -2463,8 +2560,11 @@ public function searchUserIds($searchUserIdsParams) * Set dictionary settings. * * @param array $dictionarySettingsParams dictionarySettingsParams (required) + * - $dictionarySettingsParams['disableStandardEntries'] => (array) (required) + * + * @see \Algolia\AlgoliaSearch\Model\Search\DictionarySettingsParams * - * @return array + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse */ public function setDictionarySettings($dictionarySettingsParams) { @@ -2491,9 +2591,12 @@ public function setDictionarySettings($dictionarySettingsParams) * * @param string $indexName The index in which to perform the request. (required) * @param array $indexSettings indexSettings (required) - * @param array $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) * - * @return array + * @see \Algolia\AlgoliaSearch\Model\Search\IndexSettings + * + * @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional) + * + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdatedAtResponse */ public function setSettings($indexName, $indexSettings, $forwardToReplicas = null) { @@ -2545,8 +2648,18 @@ public function setSettings($indexName, $indexSettings, $forwardToReplicas = nul * * @param string $key API Key string. (required) * @param array $apiKey apiKey (required) - * - * @return array + * - $apiKey['acl'] => (array) Set of permissions associated with the key. (required) + * - $apiKey['description'] => (string) A comment used to identify a key more easily in the dashboard. It is not interpreted by the API. + * - $apiKey['indexes'] => (array) Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed. + * - $apiKey['maxHitsPerQuery'] => (int) Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. + * - $apiKey['maxQueriesPerIPPerHour'] => (int) Maximum number of API calls per hour allowed from a given IP address or a user token. + * - $apiKey['queryParameters'] => (string) URL-encoded query string. Force some query parameters to be applied for each query made with this API key. + * - $apiKey['referers'] => (array) Restrict this new API key to specific referers. If empty or blank, defaults to all referers. + * - $apiKey['validity'] => (int) Validity limit for this key in seconds. The key will automatically be removed after this period of time. + * + * @see \Algolia\AlgoliaSearch\Model\Search\ApiKey + * + * @return array|\Algolia\AlgoliaSearch\Model\Search\UpdateApiKeyResponse */ public function updateApiKey($key, $apiKey) { diff --git a/clients/algoliasearch-client-php/lib/Model/Abtesting/ABTest.php b/clients/algoliasearch-client-php/lib/Model/Abtesting/ABTest.php new file mode 100644 index 0000000000..a6c0d2fb0f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Abtesting/ABTest.php @@ -0,0 +1,449 @@ + 'int', + 'clickSignificance' => 'double', + 'conversionSignificance' => 'double', + 'endAt' => 'string', + 'createdAt' => 'string', + 'name' => 'string', + 'status' => 'string', + 'variants' => '\Algolia\AlgoliaSearch\Model\Abtesting\Variant[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'abTestID' => null, + 'clickSignificance' => 'double', + 'conversionSignificance' => 'double', + 'endAt' => null, + 'createdAt' => null, + 'name' => null, + 'status' => null, + 'variants' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abTestID' => 'setAbTestID', + 'clickSignificance' => 'setClickSignificance', + 'conversionSignificance' => 'setConversionSignificance', + 'endAt' => 'setEndAt', + 'createdAt' => 'setCreatedAt', + 'name' => 'setName', + 'status' => 'setStatus', + 'variants' => 'setVariants', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abTestID' => 'getAbTestID', + 'clickSignificance' => 'getClickSignificance', + 'conversionSignificance' => 'getConversionSignificance', + 'endAt' => 'getEndAt', + 'createdAt' => 'getCreatedAt', + 'name' => 'getName', + 'status' => 'getStatus', + 'variants' => 'getVariants', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['abTestID'])) { + $this->container['abTestID'] = $data['abTestID']; + } + if (isset($data['clickSignificance'])) { + $this->container['clickSignificance'] = $data['clickSignificance']; + } + if (isset($data['conversionSignificance'])) { + $this->container['conversionSignificance'] = $data['conversionSignificance']; + } + if (isset($data['endAt'])) { + $this->container['endAt'] = $data['endAt']; + } + if (isset($data['createdAt'])) { + $this->container['createdAt'] = $data['createdAt']; + } + if (isset($data['name'])) { + $this->container['name'] = $data['name']; + } + if (isset($data['status'])) { + $this->container['status'] = $data['status']; + } + if (isset($data['variants'])) { + $this->container['variants'] = $data['variants']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['abTestID']) || $this->container['abTestID'] === null) { + $invalidProperties[] = "'abTestID' can't be null"; + } + if (!isset($this->container['clickSignificance']) || $this->container['clickSignificance'] === null) { + $invalidProperties[] = "'clickSignificance' can't be null"; + } + if (!isset($this->container['conversionSignificance']) || $this->container['conversionSignificance'] === null) { + $invalidProperties[] = "'conversionSignificance' can't be null"; + } + if (!isset($this->container['endAt']) || $this->container['endAt'] === null) { + $invalidProperties[] = "'endAt' can't be null"; + } + if (!isset($this->container['createdAt']) || $this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if (!isset($this->container['name']) || $this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if (!isset($this->container['status']) || $this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if (!isset($this->container['variants']) || $this->container['variants'] === null) { + $invalidProperties[] = "'variants' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets abTestID + * + * @return int + */ + public function getAbTestID() + { + return $this->container['abTestID'] ?? null; + } + + /** + * Sets abTestID + * + * @param int $abTestID the A/B test ID + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets clickSignificance + * + * @return float + */ + public function getClickSignificance() + { + return $this->container['clickSignificance'] ?? null; + } + + /** + * Sets clickSignificance + * + * @param float $clickSignificance A/B test significance based on click data. Should be > 0.95 to be considered significant (no matter which variant is winning). + * + * @return self + */ + public function setClickSignificance($clickSignificance) + { + $this->container['clickSignificance'] = $clickSignificance; + + return $this; + } + + /** + * Gets conversionSignificance + * + * @return float + */ + public function getConversionSignificance() + { + return $this->container['conversionSignificance'] ?? null; + } + + /** + * Sets conversionSignificance + * + * @param float $conversionSignificance A/B test significance based on conversion data. Should be > 0.95 to be considered significant (no matter which variant is winning). + * + * @return self + */ + public function setConversionSignificance($conversionSignificance) + { + $this->container['conversionSignificance'] = $conversionSignificance; + + return $this; + } + + /** + * Gets endAt + * + * @return string + */ + public function getEndAt() + { + return $this->container['endAt'] ?? null; + } + + /** + * Sets endAt + * + * @param string $endAt end date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ + * + * @return self + */ + public function setEndAt($endAt) + { + $this->container['endAt'] = $endAt; + + return $this; + } + + /** + * Gets createdAt + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['createdAt'] ?? null; + } + + /** + * Sets createdAt + * + * @param string $createdAt end date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name'] ?? null; + } + + /** + * Sets name + * + * @param string $name A/B test name + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status'] ?? null; + } + + /** + * Sets status + * + * @param string $status status of the A/B test + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets variants + * + * @return \Algolia\AlgoliaSearch\Model\Abtesting\Variant[] + */ + public function getVariants() + { + return $this->container['variants'] ?? null; + } + + /** + * Sets variants + * + * @param \Algolia\AlgoliaSearch\Model\Abtesting\Variant[] $variants list of A/B test variant + * + * @return self + */ + public function setVariants($variants) + { + $this->container['variants'] = $variants; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Abtesting/ABTestResponse.php b/clients/algoliasearch-client-php/lib/Model/Abtesting/ABTestResponse.php new file mode 100644 index 0000000000..fd64b49ce2 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Abtesting/ABTestResponse.php @@ -0,0 +1,279 @@ + 'string', + 'abTestID' => 'int', + 'taskID' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'index' => null, + 'abTestID' => null, + 'taskID' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'index' => 'setIndex', + 'abTestID' => 'setAbTestID', + 'taskID' => 'setTaskID', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'index' => 'getIndex', + 'abTestID' => 'getAbTestID', + 'taskID' => 'getTaskID', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['index'])) { + $this->container['index'] = $data['index']; + } + if (isset($data['abTestID'])) { + $this->container['abTestID'] = $data['abTestID']; + } + if (isset($data['taskID'])) { + $this->container['taskID'] = $data['taskID']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['index']) || $this->container['index'] === null) { + $invalidProperties[] = "'index' can't be null"; + } + if (!isset($this->container['abTestID']) || $this->container['abTestID'] === null) { + $invalidProperties[] = "'abTestID' can't be null"; + } + if (!isset($this->container['taskID']) || $this->container['taskID'] === null) { + $invalidProperties[] = "'taskID' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets index + * + * @return string + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index + * + * @param string $index the index performing the A/B test + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets abTestID + * + * @return int + */ + public function getAbTestID() + { + return $this->container['abTestID'] ?? null; + } + + /** + * Sets abTestID + * + * @param int $abTestID the A/B test ID + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets taskID + * + * @return int + */ + public function getTaskID() + { + return $this->container['taskID'] ?? null; + } + + /** + * Sets taskID + * + * @param int $taskID taskID of the task to wait for + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Abtesting/AbTestsVariant.php b/clients/algoliasearch-client-php/lib/Model/Abtesting/AbTestsVariant.php new file mode 100644 index 0000000000..53e06983d2 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Abtesting/AbTestsVariant.php @@ -0,0 +1,276 @@ + 'string', + 'trafficPercentage' => 'int', + 'description' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'index' => null, + 'trafficPercentage' => null, + 'description' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'index' => 'setIndex', + 'trafficPercentage' => 'setTrafficPercentage', + 'description' => 'setDescription', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'index' => 'getIndex', + 'trafficPercentage' => 'getTrafficPercentage', + 'description' => 'getDescription', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['index'])) { + $this->container['index'] = $data['index']; + } + if (isset($data['trafficPercentage'])) { + $this->container['trafficPercentage'] = $data['trafficPercentage']; + } + if (isset($data['description'])) { + $this->container['description'] = $data['description']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['index']) || $this->container['index'] === null) { + $invalidProperties[] = "'index' can't be null"; + } + if (!isset($this->container['trafficPercentage']) || $this->container['trafficPercentage'] === null) { + $invalidProperties[] = "'trafficPercentage' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets index + * + * @return string + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index + * + * @param string $index the index performing the A/B test + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets trafficPercentage + * + * @return int + */ + public function getTrafficPercentage() + { + return $this->container['trafficPercentage'] ?? null; + } + + /** + * Sets trafficPercentage + * + * @param int $trafficPercentage the traffic perfecentage for the A/B test + * + * @return self + */ + public function setTrafficPercentage($trafficPercentage) + { + $this->container['trafficPercentage'] = $trafficPercentage; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description'] ?? null; + } + + /** + * Sets description + * + * @param string|null $description the A/B test description + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Abtesting/AbTestsVariantSearchParams.php b/clients/algoliasearch-client-php/lib/Model/Abtesting/AbTestsVariantSearchParams.php new file mode 100644 index 0000000000..e8ca50f9af --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Abtesting/AbTestsVariantSearchParams.php @@ -0,0 +1,310 @@ + 'string', + 'trafficPercentage' => 'int', + 'description' => 'string', + 'customSearchParameters' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'index' => null, + 'trafficPercentage' => null, + 'description' => null, + 'customSearchParameters' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'index' => 'setIndex', + 'trafficPercentage' => 'setTrafficPercentage', + 'description' => 'setDescription', + 'customSearchParameters' => 'setCustomSearchParameters', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'index' => 'getIndex', + 'trafficPercentage' => 'getTrafficPercentage', + 'description' => 'getDescription', + 'customSearchParameters' => 'getCustomSearchParameters', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['index'])) { + $this->container['index'] = $data['index']; + } + if (isset($data['trafficPercentage'])) { + $this->container['trafficPercentage'] = $data['trafficPercentage']; + } + if (isset($data['description'])) { + $this->container['description'] = $data['description']; + } + if (isset($data['customSearchParameters'])) { + $this->container['customSearchParameters'] = $data['customSearchParameters']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['index']) || $this->container['index'] === null) { + $invalidProperties[] = "'index' can't be null"; + } + if (!isset($this->container['trafficPercentage']) || $this->container['trafficPercentage'] === null) { + $invalidProperties[] = "'trafficPercentage' can't be null"; + } + if (!isset($this->container['customSearchParameters']) || $this->container['customSearchParameters'] === null) { + $invalidProperties[] = "'customSearchParameters' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets index + * + * @return string + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index + * + * @param string $index the index performing the A/B test + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets trafficPercentage + * + * @return int + */ + public function getTrafficPercentage() + { + return $this->container['trafficPercentage'] ?? null; + } + + /** + * Sets trafficPercentage + * + * @param int $trafficPercentage the traffic perfecentage for the A/B test + * + * @return self + */ + public function setTrafficPercentage($trafficPercentage) + { + $this->container['trafficPercentage'] = $trafficPercentage; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description'] ?? null; + } + + /** + * Sets description + * + * @param string|null $description the A/B test description + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets customSearchParameters + * + * @return object + */ + public function getCustomSearchParameters() + { + return $this->container['customSearchParameters'] ?? null; + } + + /** + * Sets customSearchParameters + * + * @param object $customSearchParameters customSearchParameters + * + * @return self + */ + public function setCustomSearchParameters($customSearchParameters) + { + $this->container['customSearchParameters'] = $customSearchParameters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Abtesting/AddABTestsRequest.php b/clients/algoliasearch-client-php/lib/Model/Abtesting/AddABTestsRequest.php new file mode 100644 index 0000000000..d3a91995d9 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Abtesting/AddABTestsRequest.php @@ -0,0 +1,293 @@ + 'string', + 'variant' => '\Algolia\AlgoliaSearch\Model\Abtesting\AddABTestsVariant[]', + 'endAt' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'name' => null, + 'variant' => null, + 'endAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'variant' => 'setVariant', + 'endAt' => 'setEndAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'variant' => 'getVariant', + 'endAt' => 'getEndAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['name'])) { + $this->container['name'] = $data['name']; + } + if (isset($data['variant'])) { + $this->container['variant'] = $data['variant']; + } + if (isset($data['endAt'])) { + $this->container['endAt'] = $data['endAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['name']) || $this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if (!isset($this->container['variant']) || $this->container['variant'] === null) { + $invalidProperties[] = "'variant' can't be null"; + } + if ((count($this->container['variant']) > 2)) { + $invalidProperties[] = "invalid value for 'variant', number of items must be less than or equal to 2."; + } + + if ((count($this->container['variant']) < 2)) { + $invalidProperties[] = "invalid value for 'variant', number of items must be greater than or equal to 2."; + } + + if (!isset($this->container['endAt']) || $this->container['endAt'] === null) { + $invalidProperties[] = "'endAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name'] ?? null; + } + + /** + * Sets name + * + * @param string $name A/B test name + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets variant + * + * @return \Algolia\AlgoliaSearch\Model\Abtesting\AddABTestsVariant[] + */ + public function getVariant() + { + return $this->container['variant'] ?? null; + } + + /** + * Sets variant + * + * @param \Algolia\AlgoliaSearch\Model\Abtesting\AddABTestsVariant[] $variant list of 2 variants for the A/B test + * + * @return self + */ + public function setVariant($variant) + { + if ((count($variant) > 2)) { + throw new \InvalidArgumentException('invalid value for $variant when calling AddABTestsRequest., number of items must be less than or equal to 2.'); + } + if ((count($variant) < 2)) { + throw new \InvalidArgumentException('invalid length for $variant when calling AddABTestsRequest., number of items must be greater than or equal to 2.'); + } + $this->container['variant'] = $variant; + + return $this; + } + + /** + * Gets endAt + * + * @return string + */ + public function getEndAt() + { + return $this->container['endAt'] ?? null; + } + + /** + * Sets endAt + * + * @param string $endAt end date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ + * + * @return self + */ + public function setEndAt($endAt) + { + $this->container['endAt'] = $endAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Abtesting/AddABTestsVariant.php b/clients/algoliasearch-client-php/lib/Model/Abtesting/AddABTestsVariant.php new file mode 100644 index 0000000000..0dd368ee56 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Abtesting/AddABTestsVariant.php @@ -0,0 +1,310 @@ + 'string', + 'trafficPercentage' => 'int', + 'description' => 'string', + 'customSearchParameters' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'index' => null, + 'trafficPercentage' => null, + 'description' => null, + 'customSearchParameters' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'index' => 'setIndex', + 'trafficPercentage' => 'setTrafficPercentage', + 'description' => 'setDescription', + 'customSearchParameters' => 'setCustomSearchParameters', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'index' => 'getIndex', + 'trafficPercentage' => 'getTrafficPercentage', + 'description' => 'getDescription', + 'customSearchParameters' => 'getCustomSearchParameters', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['index'])) { + $this->container['index'] = $data['index']; + } + if (isset($data['trafficPercentage'])) { + $this->container['trafficPercentage'] = $data['trafficPercentage']; + } + if (isset($data['description'])) { + $this->container['description'] = $data['description']; + } + if (isset($data['customSearchParameters'])) { + $this->container['customSearchParameters'] = $data['customSearchParameters']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['index']) || $this->container['index'] === null) { + $invalidProperties[] = "'index' can't be null"; + } + if (!isset($this->container['trafficPercentage']) || $this->container['trafficPercentage'] === null) { + $invalidProperties[] = "'trafficPercentage' can't be null"; + } + if (!isset($this->container['customSearchParameters']) || $this->container['customSearchParameters'] === null) { + $invalidProperties[] = "'customSearchParameters' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets index + * + * @return string + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index + * + * @param string $index the index performing the A/B test + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets trafficPercentage + * + * @return int + */ + public function getTrafficPercentage() + { + return $this->container['trafficPercentage'] ?? null; + } + + /** + * Sets trafficPercentage + * + * @param int $trafficPercentage the traffic perfecentage for the A/B test + * + * @return self + */ + public function setTrafficPercentage($trafficPercentage) + { + $this->container['trafficPercentage'] = $trafficPercentage; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description'] ?? null; + } + + /** + * Sets description + * + * @param string|null $description the A/B test description + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets customSearchParameters + * + * @return object + */ + public function getCustomSearchParameters() + { + return $this->container['customSearchParameters'] ?? null; + } + + /** + * Sets customSearchParameters + * + * @param object $customSearchParameters customSearchParameters + * + * @return self + */ + public function setCustomSearchParameters($customSearchParameters) + { + $this->container['customSearchParameters'] = $customSearchParameters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Abtesting/CustomSearchParams.php b/clients/algoliasearch-client-php/lib/Model/Abtesting/CustomSearchParams.php new file mode 100644 index 0000000000..1a0853a566 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Abtesting/CustomSearchParams.php @@ -0,0 +1,211 @@ + 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'customSearchParameters' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'customSearchParameters' => 'setCustomSearchParameters', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'customSearchParameters' => 'getCustomSearchParameters', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['customSearchParameters'])) { + $this->container['customSearchParameters'] = $data['customSearchParameters']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['customSearchParameters']) || $this->container['customSearchParameters'] === null) { + $invalidProperties[] = "'customSearchParameters' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets customSearchParameters + * + * @return object + */ + public function getCustomSearchParameters() + { + return $this->container['customSearchParameters'] ?? null; + } + + /** + * Sets customSearchParameters + * + * @param object $customSearchParameters customSearchParameters + * + * @return self + */ + public function setCustomSearchParameters($customSearchParameters) + { + $this->container['customSearchParameters'] = $customSearchParameters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Abtesting/ErrorBase.php b/clients/algoliasearch-client-php/lib/Model/Abtesting/ErrorBase.php new file mode 100644 index 0000000000..5e737db60d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Abtesting/ErrorBase.php @@ -0,0 +1,209 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['message'])) { + $this->container['message'] = $data['message']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Abtesting/ListABTestsResponse.php b/clients/algoliasearch-client-php/lib/Model/Abtesting/ListABTestsResponse.php new file mode 100644 index 0000000000..26ef0e38e3 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Abtesting/ListABTestsResponse.php @@ -0,0 +1,279 @@ + '\Algolia\AlgoliaSearch\Model\Abtesting\ABTest[]', + 'count' => 'int', + 'total' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'abtests' => null, + 'count' => null, + 'total' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abtests' => 'setAbtests', + 'count' => 'setCount', + 'total' => 'setTotal', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abtests' => 'getAbtests', + 'count' => 'getCount', + 'total' => 'getTotal', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['abtests'])) { + $this->container['abtests'] = $data['abtests']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + if (isset($data['total'])) { + $this->container['total'] = $data['total']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['abtests']) || $this->container['abtests'] === null) { + $invalidProperties[] = "'abtests' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if (!isset($this->container['total']) || $this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets abtests + * + * @return \Algolia\AlgoliaSearch\Model\Abtesting\ABTest[] + */ + public function getAbtests() + { + return $this->container['abtests'] ?? null; + } + + /** + * Sets abtests + * + * @param \Algolia\AlgoliaSearch\Model\Abtesting\ABTest[] $abtests list of A/B tests + * + * @return self + */ + public function setAbtests($abtests) + { + $this->container['abtests'] = $abtests; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count number of A/B tests found for the app + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total'] ?? null; + } + + /** + * Sets total + * + * @param int $total number of A/B tests retrievable + * + * @return self + */ + public function setTotal($total) + { + $this->container['total'] = $total; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Abtesting/ModelInterface.php b/clients/algoliasearch-client-php/lib/Model/Abtesting/ModelInterface.php new file mode 100644 index 0000000000..b2239e229c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Abtesting/ModelInterface.php @@ -0,0 +1,54 @@ + 'int', + 'clickCount' => 'int', + 'clickThroughRate' => 'double', + 'conversionCount' => 'int', + 'conversionRate' => 'double', + 'description' => 'string', + 'index' => 'string', + 'noResultCount' => 'int', + 'searchCount' => 'int', + 'trackedSearchCount' => 'int', + 'trafficPercentage' => 'int', + 'userCount' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'averageClickPosition' => null, + 'clickCount' => null, + 'clickThroughRate' => 'double', + 'conversionCount' => null, + 'conversionRate' => 'double', + 'description' => null, + 'index' => null, + 'noResultCount' => null, + 'searchCount' => null, + 'trackedSearchCount' => null, + 'trafficPercentage' => null, + 'userCount' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'averageClickPosition' => 'setAverageClickPosition', + 'clickCount' => 'setClickCount', + 'clickThroughRate' => 'setClickThroughRate', + 'conversionCount' => 'setConversionCount', + 'conversionRate' => 'setConversionRate', + 'description' => 'setDescription', + 'index' => 'setIndex', + 'noResultCount' => 'setNoResultCount', + 'searchCount' => 'setSearchCount', + 'trackedSearchCount' => 'setTrackedSearchCount', + 'trafficPercentage' => 'setTrafficPercentage', + 'userCount' => 'setUserCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'averageClickPosition' => 'getAverageClickPosition', + 'clickCount' => 'getClickCount', + 'clickThroughRate' => 'getClickThroughRate', + 'conversionCount' => 'getConversionCount', + 'conversionRate' => 'getConversionRate', + 'description' => 'getDescription', + 'index' => 'getIndex', + 'noResultCount' => 'getNoResultCount', + 'searchCount' => 'getSearchCount', + 'trackedSearchCount' => 'getTrackedSearchCount', + 'trafficPercentage' => 'getTrafficPercentage', + 'userCount' => 'getUserCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['averageClickPosition'])) { + $this->container['averageClickPosition'] = $data['averageClickPosition']; + } + if (isset($data['clickCount'])) { + $this->container['clickCount'] = $data['clickCount']; + } + if (isset($data['clickThroughRate'])) { + $this->container['clickThroughRate'] = $data['clickThroughRate']; + } + if (isset($data['conversionCount'])) { + $this->container['conversionCount'] = $data['conversionCount']; + } + if (isset($data['conversionRate'])) { + $this->container['conversionRate'] = $data['conversionRate']; + } + if (isset($data['description'])) { + $this->container['description'] = $data['description']; + } + if (isset($data['index'])) { + $this->container['index'] = $data['index']; + } + if (isset($data['noResultCount'])) { + $this->container['noResultCount'] = $data['noResultCount']; + } + if (isset($data['searchCount'])) { + $this->container['searchCount'] = $data['searchCount']; + } + if (isset($data['trackedSearchCount'])) { + $this->container['trackedSearchCount'] = $data['trackedSearchCount']; + } + if (isset($data['trafficPercentage'])) { + $this->container['trafficPercentage'] = $data['trafficPercentage']; + } + if (isset($data['userCount'])) { + $this->container['userCount'] = $data['userCount']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['averageClickPosition']) || $this->container['averageClickPosition'] === null) { + $invalidProperties[] = "'averageClickPosition' can't be null"; + } + if (!isset($this->container['clickCount']) || $this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + if (!isset($this->container['clickThroughRate']) || $this->container['clickThroughRate'] === null) { + $invalidProperties[] = "'clickThroughRate' can't be null"; + } + if (!isset($this->container['conversionCount']) || $this->container['conversionCount'] === null) { + $invalidProperties[] = "'conversionCount' can't be null"; + } + if (!isset($this->container['conversionRate']) || $this->container['conversionRate'] === null) { + $invalidProperties[] = "'conversionRate' can't be null"; + } + if (!isset($this->container['description']) || $this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if (!isset($this->container['index']) || $this->container['index'] === null) { + $invalidProperties[] = "'index' can't be null"; + } + if (!isset($this->container['noResultCount']) || $this->container['noResultCount'] === null) { + $invalidProperties[] = "'noResultCount' can't be null"; + } + if (!isset($this->container['searchCount']) || $this->container['searchCount'] === null) { + $invalidProperties[] = "'searchCount' can't be null"; + } + if (!isset($this->container['trackedSearchCount']) || $this->container['trackedSearchCount'] === null) { + $invalidProperties[] = "'trackedSearchCount' can't be null"; + } + if (!isset($this->container['trafficPercentage']) || $this->container['trafficPercentage'] === null) { + $invalidProperties[] = "'trafficPercentage' can't be null"; + } + if (!isset($this->container['userCount']) || $this->container['userCount'] === null) { + $invalidProperties[] = "'userCount' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets averageClickPosition + * + * @return int + */ + public function getAverageClickPosition() + { + return $this->container['averageClickPosition'] ?? null; + } + + /** + * Sets averageClickPosition + * + * @param int $averageClickPosition average click position for the variant + * + * @return self + */ + public function setAverageClickPosition($averageClickPosition) + { + $this->container['averageClickPosition'] = $averageClickPosition; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount'] ?? null; + } + + /** + * Sets clickCount + * + * @param int $clickCount distinct click count for the variant + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + + /** + * Gets clickThroughRate + * + * @return float + */ + public function getClickThroughRate() + { + return $this->container['clickThroughRate'] ?? null; + } + + /** + * Sets clickThroughRate + * + * @param float $clickThroughRate click through rate for the variant + * + * @return self + */ + public function setClickThroughRate($clickThroughRate) + { + $this->container['clickThroughRate'] = $clickThroughRate; + + return $this; + } + + /** + * Gets conversionCount + * + * @return int + */ + public function getConversionCount() + { + return $this->container['conversionCount'] ?? null; + } + + /** + * Sets conversionCount + * + * @param int $conversionCount distinct conversion count for the variant + * + * @return self + */ + public function setConversionCount($conversionCount) + { + $this->container['conversionCount'] = $conversionCount; + + return $this; + } + + /** + * Gets conversionRate + * + * @return float + */ + public function getConversionRate() + { + return $this->container['conversionRate'] ?? null; + } + + /** + * Sets conversionRate + * + * @param float $conversionRate conversion rate for the variant + * + * @return self + */ + public function setConversionRate($conversionRate) + { + $this->container['conversionRate'] = $conversionRate; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description'] ?? null; + } + + /** + * Sets description + * + * @param string $description the A/B test description + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets index + * + * @return string + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index + * + * @param string $index the index performing the A/B test + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets noResultCount + * + * @return int + */ + public function getNoResultCount() + { + return $this->container['noResultCount'] ?? null; + } + + /** + * Sets noResultCount + * + * @param int $noResultCount the number of occurrences + * + * @return self + */ + public function setNoResultCount($noResultCount) + { + $this->container['noResultCount'] = $noResultCount; + + return $this; + } + + /** + * Gets searchCount + * + * @return int + */ + public function getSearchCount() + { + return $this->container['searchCount'] ?? null; + } + + /** + * Sets searchCount + * + * @param int $searchCount the number of search during the A/B test + * + * @return self + */ + public function setSearchCount($searchCount) + { + $this->container['searchCount'] = $searchCount; + + return $this; + } + + /** + * Gets trackedSearchCount + * + * @return int + */ + public function getTrackedSearchCount() + { + return $this->container['trackedSearchCount'] ?? null; + } + + /** + * Sets trackedSearchCount + * + * @param int $trackedSearchCount the number of tracked search click + * + * @return self + */ + public function setTrackedSearchCount($trackedSearchCount) + { + $this->container['trackedSearchCount'] = $trackedSearchCount; + + return $this; + } + + /** + * Gets trafficPercentage + * + * @return int + */ + public function getTrafficPercentage() + { + return $this->container['trafficPercentage'] ?? null; + } + + /** + * Sets trafficPercentage + * + * @param int $trafficPercentage the traffic perfecentage for the A/B test + * + * @return self + */ + public function setTrafficPercentage($trafficPercentage) + { + $this->container['trafficPercentage'] = $trafficPercentage; + + return $this; + } + + /** + * Gets userCount + * + * @return int + */ + public function getUserCount() + { + return $this->container['userCount'] ?? null; + } + + /** + * Sets userCount + * + * @param int $userCount the number of user during the A/B test + * + * @return self + */ + public function setUserCount($userCount) + { + $this->container['userCount'] = $userCount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/ErrorBase.php b/clients/algoliasearch-client-php/lib/Model/Analytics/ErrorBase.php new file mode 100644 index 0000000000..0100be741c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/ErrorBase.php @@ -0,0 +1,209 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['message'])) { + $this->container['message'] = $data['message']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetAverageClickPositionResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetAverageClickPositionResponse.php new file mode 100644 index 0000000000..fbf8ba4271 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetAverageClickPositionResponse.php @@ -0,0 +1,279 @@ + 'double', + 'clickCount' => 'int', + 'dates' => '\Algolia\AlgoliaSearch\Model\Analytics\GetAverageClickPositionResponseDates[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'average' => 'double', + 'clickCount' => null, + 'dates' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'average' => 'setAverage', + 'clickCount' => 'setClickCount', + 'dates' => 'setDates', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'average' => 'getAverage', + 'clickCount' => 'getClickCount', + 'dates' => 'getDates', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['average'])) { + $this->container['average'] = $data['average']; + } + if (isset($data['clickCount'])) { + $this->container['clickCount'] = $data['clickCount']; + } + if (isset($data['dates'])) { + $this->container['dates'] = $data['dates']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['average']) || $this->container['average'] === null) { + $invalidProperties[] = "'average' can't be null"; + } + if (!isset($this->container['clickCount']) || $this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + if (!isset($this->container['dates']) || $this->container['dates'] === null) { + $invalidProperties[] = "'dates' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets average + * + * @return float + */ + public function getAverage() + { + return $this->container['average'] ?? null; + } + + /** + * Sets average + * + * @param float $average the average of all the click count event + * + * @return self + */ + public function setAverage($average) + { + $this->container['average'] = $average; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount'] ?? null; + } + + /** + * Sets clickCount + * + * @param int $clickCount the number of click event + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + + /** + * Gets dates + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetAverageClickPositionResponseDates[] + */ + public function getDates() + { + return $this->container['dates'] ?? null; + } + + /** + * Sets dates + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetAverageClickPositionResponseDates[] $dates a list of average click position with their date + * + * @return self + */ + public function setDates($dates) + { + $this->container['dates'] = $dates; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetAverageClickPositionResponseDates.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetAverageClickPositionResponseDates.php new file mode 100644 index 0000000000..a89b31650f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetAverageClickPositionResponseDates.php @@ -0,0 +1,279 @@ + 'double', + 'clickCount' => 'int', + 'date' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'average' => 'double', + 'clickCount' => null, + 'date' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'average' => 'setAverage', + 'clickCount' => 'setClickCount', + 'date' => 'setDate', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'average' => 'getAverage', + 'clickCount' => 'getClickCount', + 'date' => 'getDate', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['average'])) { + $this->container['average'] = $data['average']; + } + if (isset($data['clickCount'])) { + $this->container['clickCount'] = $data['clickCount']; + } + if (isset($data['date'])) { + $this->container['date'] = $data['date']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['average']) || $this->container['average'] === null) { + $invalidProperties[] = "'average' can't be null"; + } + if (!isset($this->container['clickCount']) || $this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + if (!isset($this->container['date']) || $this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets average + * + * @return float + */ + public function getAverage() + { + return $this->container['average'] ?? null; + } + + /** + * Sets average + * + * @param float $average the average of all the click count event + * + * @return self + */ + public function setAverage($average) + { + $this->container['average'] = $average; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount'] ?? null; + } + + /** + * Sets clickCount + * + * @param int $clickCount the number of click event + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + + /** + * Gets date + * + * @return string + */ + public function getDate() + { + return $this->container['date'] ?? null; + } + + /** + * Sets date + * + * @param string $date date of the event + * + * @return self + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickPositionsResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickPositionsResponse.php new file mode 100644 index 0000000000..bac57f71c1 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickPositionsResponse.php @@ -0,0 +1,224 @@ + '\Algolia\AlgoliaSearch\Model\Analytics\GetClickPositionsResponsePositions[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'positions' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'positions' => 'setPositions', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'positions' => 'getPositions', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['positions'])) { + $this->container['positions'] = $data['positions']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['positions']) || $this->container['positions'] === null) { + $invalidProperties[] = "'positions' can't be null"; + } + if ((count($this->container['positions']) > 2)) { + $invalidProperties[] = "invalid value for 'positions', number of items must be less than or equal to 2."; + } + + if ((count($this->container['positions']) < 2)) { + $invalidProperties[] = "invalid value for 'positions', number of items must be greater than or equal to 2."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets positions + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetClickPositionsResponsePositions[] + */ + public function getPositions() + { + return $this->container['positions'] ?? null; + } + + /** + * Sets positions + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetClickPositionsResponsePositions[] $positions a list of the click positions with their click count + * + * @return self + */ + public function setPositions($positions) + { + if ((count($positions) > 2)) { + throw new \InvalidArgumentException('invalid value for $positions when calling GetClickPositionsResponse., number of items must be less than or equal to 2.'); + } + if ((count($positions) < 2)) { + throw new \InvalidArgumentException('invalid length for $positions when calling GetClickPositionsResponse., number of items must be greater than or equal to 2.'); + } + $this->container['positions'] = $positions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickPositionsResponsePositions.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickPositionsResponsePositions.php new file mode 100644 index 0000000000..add72eb90b --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickPositionsResponsePositions.php @@ -0,0 +1,245 @@ + 'int[]', + 'clickCount' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'position' => null, + 'clickCount' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'position' => 'setPosition', + 'clickCount' => 'setClickCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'position' => 'getPosition', + 'clickCount' => 'getClickCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['position'])) { + $this->container['position'] = $data['position']; + } + if (isset($data['clickCount'])) { + $this->container['clickCount'] = $data['clickCount']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['position']) || $this->container['position'] === null) { + $invalidProperties[] = "'position' can't be null"; + } + if (!isset($this->container['clickCount']) || $this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets position + * + * @return int[] + */ + public function getPosition() + { + return $this->container['position'] ?? null; + } + + /** + * Sets position + * + * @param int[] $position Range of positions with the following pattern: Positions from 1 to 10 included are displayed in separated groups. Positions from 11 to 20 included are grouped together. Positions from 21 and up are grouped together. + * + * @return self + */ + public function setPosition($position) + { + $this->container['position'] = $position; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount'] ?? null; + } + + /** + * Sets clickCount + * + * @param int $clickCount the number of click event + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickThroughRateResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickThroughRateResponse.php new file mode 100644 index 0000000000..01e1eb2b6f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickThroughRateResponse.php @@ -0,0 +1,313 @@ + 'double', + 'clickCount' => 'int', + 'trackedSearchCount' => 'int', + 'dates' => '\Algolia\AlgoliaSearch\Model\Analytics\GetClickThroughRateResponseDates[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'rate' => 'double', + 'clickCount' => null, + 'trackedSearchCount' => null, + 'dates' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'clickCount' => 'setClickCount', + 'trackedSearchCount' => 'setTrackedSearchCount', + 'dates' => 'setDates', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'clickCount' => 'getClickCount', + 'trackedSearchCount' => 'getTrackedSearchCount', + 'dates' => 'getDates', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['rate'])) { + $this->container['rate'] = $data['rate']; + } + if (isset($data['clickCount'])) { + $this->container['clickCount'] = $data['clickCount']; + } + if (isset($data['trackedSearchCount'])) { + $this->container['trackedSearchCount'] = $data['trackedSearchCount']; + } + if (isset($data['dates'])) { + $this->container['dates'] = $data['dates']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['rate']) || $this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if (!isset($this->container['clickCount']) || $this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + if (!isset($this->container['trackedSearchCount']) || $this->container['trackedSearchCount'] === null) { + $invalidProperties[] = "'trackedSearchCount' can't be null"; + } + if (!isset($this->container['dates']) || $this->container['dates'] === null) { + $invalidProperties[] = "'dates' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate'] ?? null; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount'] ?? null; + } + + /** + * Sets clickCount + * + * @param int $clickCount the number of click event + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + + /** + * Gets trackedSearchCount + * + * @return int + */ + public function getTrackedSearchCount() + { + return $this->container['trackedSearchCount'] ?? null; + } + + /** + * Sets trackedSearchCount + * + * @param int $trackedSearchCount the number of tracked search click + * + * @return self + */ + public function setTrackedSearchCount($trackedSearchCount) + { + $this->container['trackedSearchCount'] = $trackedSearchCount; + + return $this; + } + + /** + * Gets dates + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetClickThroughRateResponseDates[] + */ + public function getDates() + { + return $this->container['dates'] ?? null; + } + + /** + * Sets dates + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetClickThroughRateResponseDates[] $dates a list of click-through rate events with their date + * + * @return self + */ + public function setDates($dates) + { + $this->container['dates'] = $dates; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickThroughRateResponseDates.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickThroughRateResponseDates.php new file mode 100644 index 0000000000..0c6beeb36d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetClickThroughRateResponseDates.php @@ -0,0 +1,313 @@ + 'double', + 'clickCount' => 'int', + 'trackedSearchCount' => 'int', + 'date' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'rate' => 'double', + 'clickCount' => null, + 'trackedSearchCount' => null, + 'date' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'clickCount' => 'setClickCount', + 'trackedSearchCount' => 'setTrackedSearchCount', + 'date' => 'setDate', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'clickCount' => 'getClickCount', + 'trackedSearchCount' => 'getTrackedSearchCount', + 'date' => 'getDate', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['rate'])) { + $this->container['rate'] = $data['rate']; + } + if (isset($data['clickCount'])) { + $this->container['clickCount'] = $data['clickCount']; + } + if (isset($data['trackedSearchCount'])) { + $this->container['trackedSearchCount'] = $data['trackedSearchCount']; + } + if (isset($data['date'])) { + $this->container['date'] = $data['date']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['rate']) || $this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if (!isset($this->container['clickCount']) || $this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + if (!isset($this->container['trackedSearchCount']) || $this->container['trackedSearchCount'] === null) { + $invalidProperties[] = "'trackedSearchCount' can't be null"; + } + if (!isset($this->container['date']) || $this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate'] ?? null; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount'] ?? null; + } + + /** + * Sets clickCount + * + * @param int $clickCount the number of click event + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + + /** + * Gets trackedSearchCount + * + * @return int + */ + public function getTrackedSearchCount() + { + return $this->container['trackedSearchCount'] ?? null; + } + + /** + * Sets trackedSearchCount + * + * @param int $trackedSearchCount the number of tracked search click + * + * @return self + */ + public function setTrackedSearchCount($trackedSearchCount) + { + $this->container['trackedSearchCount'] = $trackedSearchCount; + + return $this; + } + + /** + * Gets date + * + * @return string + */ + public function getDate() + { + return $this->container['date'] ?? null; + } + + /** + * Sets date + * + * @param string $date date of the event + * + * @return self + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetConversationRateResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetConversationRateResponse.php new file mode 100644 index 0000000000..1feb216e31 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetConversationRateResponse.php @@ -0,0 +1,313 @@ + 'double', + 'trackedSearchCount' => 'int', + 'conversionCount' => 'int', + 'dates' => '\Algolia\AlgoliaSearch\Model\Analytics\GetConversationRateResponseDates[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'rate' => 'double', + 'trackedSearchCount' => null, + 'conversionCount' => null, + 'dates' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'trackedSearchCount' => 'setTrackedSearchCount', + 'conversionCount' => 'setConversionCount', + 'dates' => 'setDates', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'trackedSearchCount' => 'getTrackedSearchCount', + 'conversionCount' => 'getConversionCount', + 'dates' => 'getDates', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['rate'])) { + $this->container['rate'] = $data['rate']; + } + if (isset($data['trackedSearchCount'])) { + $this->container['trackedSearchCount'] = $data['trackedSearchCount']; + } + if (isset($data['conversionCount'])) { + $this->container['conversionCount'] = $data['conversionCount']; + } + if (isset($data['dates'])) { + $this->container['dates'] = $data['dates']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['rate']) || $this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if (!isset($this->container['trackedSearchCount']) || $this->container['trackedSearchCount'] === null) { + $invalidProperties[] = "'trackedSearchCount' can't be null"; + } + if (!isset($this->container['conversionCount']) || $this->container['conversionCount'] === null) { + $invalidProperties[] = "'conversionCount' can't be null"; + } + if (!isset($this->container['dates']) || $this->container['dates'] === null) { + $invalidProperties[] = "'dates' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate'] ?? null; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets trackedSearchCount + * + * @return int + */ + public function getTrackedSearchCount() + { + return $this->container['trackedSearchCount'] ?? null; + } + + /** + * Sets trackedSearchCount + * + * @param int $trackedSearchCount the number of tracked search click + * + * @return self + */ + public function setTrackedSearchCount($trackedSearchCount) + { + $this->container['trackedSearchCount'] = $trackedSearchCount; + + return $this; + } + + /** + * Gets conversionCount + * + * @return int + */ + public function getConversionCount() + { + return $this->container['conversionCount'] ?? null; + } + + /** + * Sets conversionCount + * + * @param int $conversionCount the number of converted clicks + * + * @return self + */ + public function setConversionCount($conversionCount) + { + $this->container['conversionCount'] = $conversionCount; + + return $this; + } + + /** + * Gets dates + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetConversationRateResponseDates[] + */ + public function getDates() + { + return $this->container['dates'] ?? null; + } + + /** + * Sets dates + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetConversationRateResponseDates[] $dates a list of conversion events with their date + * + * @return self + */ + public function setDates($dates) + { + $this->container['dates'] = $dates; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetConversationRateResponseDates.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetConversationRateResponseDates.php new file mode 100644 index 0000000000..fb7cd455e1 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetConversationRateResponseDates.php @@ -0,0 +1,313 @@ + 'double', + 'trackedSearchCount' => 'int', + 'conversionCount' => 'int', + 'date' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'rate' => 'double', + 'trackedSearchCount' => null, + 'conversionCount' => null, + 'date' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'trackedSearchCount' => 'setTrackedSearchCount', + 'conversionCount' => 'setConversionCount', + 'date' => 'setDate', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'trackedSearchCount' => 'getTrackedSearchCount', + 'conversionCount' => 'getConversionCount', + 'date' => 'getDate', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['rate'])) { + $this->container['rate'] = $data['rate']; + } + if (isset($data['trackedSearchCount'])) { + $this->container['trackedSearchCount'] = $data['trackedSearchCount']; + } + if (isset($data['conversionCount'])) { + $this->container['conversionCount'] = $data['conversionCount']; + } + if (isset($data['date'])) { + $this->container['date'] = $data['date']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['rate']) || $this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if (!isset($this->container['trackedSearchCount']) || $this->container['trackedSearchCount'] === null) { + $invalidProperties[] = "'trackedSearchCount' can't be null"; + } + if (!isset($this->container['conversionCount']) || $this->container['conversionCount'] === null) { + $invalidProperties[] = "'conversionCount' can't be null"; + } + if (!isset($this->container['date']) || $this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate'] ?? null; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets trackedSearchCount + * + * @return int + */ + public function getTrackedSearchCount() + { + return $this->container['trackedSearchCount'] ?? null; + } + + /** + * Sets trackedSearchCount + * + * @param int $trackedSearchCount the number of tracked search click + * + * @return self + */ + public function setTrackedSearchCount($trackedSearchCount) + { + $this->container['trackedSearchCount'] = $trackedSearchCount; + + return $this; + } + + /** + * Gets conversionCount + * + * @return int + */ + public function getConversionCount() + { + return $this->container['conversionCount'] ?? null; + } + + /** + * Sets conversionCount + * + * @param int $conversionCount the number of converted clicks + * + * @return self + */ + public function setConversionCount($conversionCount) + { + $this->container['conversionCount'] = $conversionCount; + + return $this; + } + + /** + * Gets date + * + * @return string + */ + public function getDate() + { + return $this->container['date'] ?? null; + } + + /** + * Sets date + * + * @param string $date date of the event + * + * @return self + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoClickRateResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoClickRateResponse.php new file mode 100644 index 0000000000..be5d6719cd --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoClickRateResponse.php @@ -0,0 +1,313 @@ + 'double', + 'count' => 'int', + 'noClickCount' => 'int', + 'dates' => '\Algolia\AlgoliaSearch\Model\Analytics\GetNoClickRateResponseDates[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'rate' => 'double', + 'count' => null, + 'noClickCount' => null, + 'dates' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'count' => 'setCount', + 'noClickCount' => 'setNoClickCount', + 'dates' => 'setDates', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'count' => 'getCount', + 'noClickCount' => 'getNoClickCount', + 'dates' => 'getDates', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['rate'])) { + $this->container['rate'] = $data['rate']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + if (isset($data['noClickCount'])) { + $this->container['noClickCount'] = $data['noClickCount']; + } + if (isset($data['dates'])) { + $this->container['dates'] = $data['dates']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['rate']) || $this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if (!isset($this->container['noClickCount']) || $this->container['noClickCount'] === null) { + $invalidProperties[] = "'noClickCount' can't be null"; + } + if (!isset($this->container['dates']) || $this->container['dates'] === null) { + $invalidProperties[] = "'dates' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate'] ?? null; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of click event + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets noClickCount + * + * @return int + */ + public function getNoClickCount() + { + return $this->container['noClickCount'] ?? null; + } + + /** + * Sets noClickCount + * + * @param int $noClickCount the number of click event + * + * @return self + */ + public function setNoClickCount($noClickCount) + { + $this->container['noClickCount'] = $noClickCount; + + return $this; + } + + /** + * Gets dates + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetNoClickRateResponseDates[] + */ + public function getDates() + { + return $this->container['dates'] ?? null; + } + + /** + * Sets dates + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetNoClickRateResponseDates[] $dates a list of searches without clicks with their date, rate and counts + * + * @return self + */ + public function setDates($dates) + { + $this->container['dates'] = $dates; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoClickRateResponseDates.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoClickRateResponseDates.php new file mode 100644 index 0000000000..7128c8e6f8 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoClickRateResponseDates.php @@ -0,0 +1,313 @@ + 'double', + 'count' => 'int', + 'noClickCount' => 'int', + 'date' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'rate' => 'double', + 'count' => null, + 'noClickCount' => null, + 'date' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'count' => 'setCount', + 'noClickCount' => 'setNoClickCount', + 'date' => 'setDate', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'count' => 'getCount', + 'noClickCount' => 'getNoClickCount', + 'date' => 'getDate', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['rate'])) { + $this->container['rate'] = $data['rate']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + if (isset($data['noClickCount'])) { + $this->container['noClickCount'] = $data['noClickCount']; + } + if (isset($data['date'])) { + $this->container['date'] = $data['date']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['rate']) || $this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if (!isset($this->container['noClickCount']) || $this->container['noClickCount'] === null) { + $invalidProperties[] = "'noClickCount' can't be null"; + } + if (!isset($this->container['date']) || $this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate'] ?? null; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of click event + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets noClickCount + * + * @return int + */ + public function getNoClickCount() + { + return $this->container['noClickCount'] ?? null; + } + + /** + * Sets noClickCount + * + * @param int $noClickCount the number of click event + * + * @return self + */ + public function setNoClickCount($noClickCount) + { + $this->container['noClickCount'] = $noClickCount; + + return $this; + } + + /** + * Gets date + * + * @return string + */ + public function getDate() + { + return $this->container['date'] ?? null; + } + + /** + * Sets date + * + * @param string $date date of the event + * + * @return self + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoResultsRateResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoResultsRateResponse.php new file mode 100644 index 0000000000..31bab73200 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoResultsRateResponse.php @@ -0,0 +1,313 @@ + 'double', + 'count' => 'int', + 'noResultCount' => 'int', + 'dates' => '\Algolia\AlgoliaSearch\Model\Analytics\GetNoResultsRateResponseDates[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'rate' => 'double', + 'count' => null, + 'noResultCount' => null, + 'dates' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'rate' => 'setRate', + 'count' => 'setCount', + 'noResultCount' => 'setNoResultCount', + 'dates' => 'setDates', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'rate' => 'getRate', + 'count' => 'getCount', + 'noResultCount' => 'getNoResultCount', + 'dates' => 'getDates', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['rate'])) { + $this->container['rate'] = $data['rate']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + if (isset($data['noResultCount'])) { + $this->container['noResultCount'] = $data['noResultCount']; + } + if (isset($data['dates'])) { + $this->container['dates'] = $data['dates']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['rate']) || $this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if (!isset($this->container['noResultCount']) || $this->container['noResultCount'] === null) { + $invalidProperties[] = "'noResultCount' can't be null"; + } + if (!isset($this->container['dates']) || $this->container['dates'] === null) { + $invalidProperties[] = "'dates' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate'] ?? null; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets noResultCount + * + * @return int + */ + public function getNoResultCount() + { + return $this->container['noResultCount'] ?? null; + } + + /** + * Sets noResultCount + * + * @param int $noResultCount the number of occurrences + * + * @return self + */ + public function setNoResultCount($noResultCount) + { + $this->container['noResultCount'] = $noResultCount; + + return $this; + } + + /** + * Gets dates + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetNoResultsRateResponseDates[] + */ + public function getDates() + { + return $this->container['dates'] ?? null; + } + + /** + * Sets dates + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetNoResultsRateResponseDates[] $dates a list of searches without results with their date, rate and counts + * + * @return self + */ + public function setDates($dates) + { + $this->container['dates'] = $dates; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoResultsRateResponseDates.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoResultsRateResponseDates.php new file mode 100644 index 0000000000..0c1891a303 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetNoResultsRateResponseDates.php @@ -0,0 +1,313 @@ + 'string', + 'noResultCount' => 'int', + 'count' => 'int', + 'rate' => 'double', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'date' => null, + 'noResultCount' => null, + 'count' => null, + 'rate' => 'double', + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date' => 'setDate', + 'noResultCount' => 'setNoResultCount', + 'count' => 'setCount', + 'rate' => 'setRate', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date' => 'getDate', + 'noResultCount' => 'getNoResultCount', + 'count' => 'getCount', + 'rate' => 'getRate', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['date'])) { + $this->container['date'] = $data['date']; + } + if (isset($data['noResultCount'])) { + $this->container['noResultCount'] = $data['noResultCount']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + if (isset($data['rate'])) { + $this->container['rate'] = $data['rate']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['date']) || $this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if (!isset($this->container['noResultCount']) || $this->container['noResultCount'] === null) { + $invalidProperties[] = "'noResultCount' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if (!isset($this->container['rate']) || $this->container['rate'] === null) { + $invalidProperties[] = "'rate' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets date + * + * @return string + */ + public function getDate() + { + return $this->container['date'] ?? null; + } + + /** + * Sets date + * + * @param string $date date of the event + * + * @return self + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets noResultCount + * + * @return int + */ + public function getNoResultCount() + { + return $this->container['noResultCount'] ?? null; + } + + /** + * Sets noResultCount + * + * @param int $noResultCount the number of occurrences + * + * @return self + */ + public function setNoResultCount($noResultCount) + { + $this->container['noResultCount'] = $noResultCount; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets rate + * + * @return float + */ + public function getRate() + { + return $this->container['rate'] ?? null; + } + + /** + * Sets rate + * + * @param float $rate the click-through rate + * + * @return self + */ + public function setRate($rate) + { + $this->container['rate'] = $rate; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesCountResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesCountResponse.php new file mode 100644 index 0000000000..687b52a9b7 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesCountResponse.php @@ -0,0 +1,245 @@ + 'int', + 'dates' => '\Algolia\AlgoliaSearch\Model\Analytics\GetSearchesCountResponseDates[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'count' => null, + 'dates' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'dates' => 'setDates', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'dates' => 'getDates', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + if (isset($data['dates'])) { + $this->container['dates'] = $data['dates']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if (!isset($this->container['dates']) || $this->container['dates'] === null) { + $invalidProperties[] = "'dates' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets dates + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesCountResponseDates[] + */ + public function getDates() + { + return $this->container['dates'] ?? null; + } + + /** + * Sets dates + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesCountResponseDates[] $dates a list of search events with their date and count + * + * @return self + */ + public function setDates($dates) + { + $this->container['dates'] = $dates; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesCountResponseDates.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesCountResponseDates.php new file mode 100644 index 0000000000..58bc7a3e4d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesCountResponseDates.php @@ -0,0 +1,245 @@ + 'string', + 'count' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'date' => null, + 'count' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'date' => 'setDate', + 'count' => 'setCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'date' => 'getDate', + 'count' => 'getCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['date'])) { + $this->container['date'] = $data['date']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['date']) || $this->container['date'] === null) { + $invalidProperties[] = "'date' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets date + * + * @return string + */ + public function getDate() + { + return $this->container['date'] ?? null; + } + + /** + * Sets date + * + * @param string $date date of the event + * + * @return self + */ + public function setDate($date) + { + $this->container['date'] = $date; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoClicksResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoClicksResponse.php new file mode 100644 index 0000000000..7e51283415 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoClicksResponse.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoClicksResponseSearches[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'searches' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'searches' => 'setSearches', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'searches' => 'getSearches', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['searches'])) { + $this->container['searches'] = $data['searches']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['searches']) || $this->container['searches'] === null) { + $invalidProperties[] = "'searches' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets searches + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoClicksResponseSearches[] + */ + public function getSearches() + { + return $this->container['searches'] ?? null; + } + + /** + * Sets searches + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoClicksResponseSearches[] $searches a list of searches with no clicks and their count + * + * @return self + */ + public function setSearches($searches) + { + $this->container['searches'] = $searches; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoClicksResponseSearches.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoClicksResponseSearches.php new file mode 100644 index 0000000000..9340737772 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoClicksResponseSearches.php @@ -0,0 +1,279 @@ + 'string', + 'count' => 'int', + 'withFilterCount' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'search' => null, + 'count' => null, + 'withFilterCount' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'search' => 'setSearch', + 'count' => 'setCount', + 'withFilterCount' => 'setWithFilterCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'search' => 'getSearch', + 'count' => 'getCount', + 'withFilterCount' => 'getWithFilterCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['search'])) { + $this->container['search'] = $data['search']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + if (isset($data['withFilterCount'])) { + $this->container['withFilterCount'] = $data['withFilterCount']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['search']) || $this->container['search'] === null) { + $invalidProperties[] = "'search' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if (!isset($this->container['withFilterCount']) || $this->container['withFilterCount'] === null) { + $invalidProperties[] = "'withFilterCount' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets search + * + * @return string + */ + public function getSearch() + { + return $this->container['search'] ?? null; + } + + /** + * Sets search + * + * @param string $search the search query + * + * @return self + */ + public function setSearch($search) + { + $this->container['search'] = $search; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets withFilterCount + * + * @return int + */ + public function getWithFilterCount() + { + return $this->container['withFilterCount'] ?? null; + } + + /** + * Sets withFilterCount + * + * @param int $withFilterCount the number of occurrences + * + * @return self + */ + public function setWithFilterCount($withFilterCount) + { + $this->container['withFilterCount'] = $withFilterCount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoResultsResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoResultsResponse.php new file mode 100644 index 0000000000..e464f5e673 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoResultsResponse.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoResultsResponseSearches[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'searches' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'searches' => 'setSearches', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'searches' => 'getSearches', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['searches'])) { + $this->container['searches'] = $data['searches']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['searches']) || $this->container['searches'] === null) { + $invalidProperties[] = "'searches' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets searches + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoResultsResponseSearches[] + */ + public function getSearches() + { + return $this->container['searches'] ?? null; + } + + /** + * Sets searches + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoResultsResponseSearches[] $searches a list of searches with no results and their count + * + * @return self + */ + public function setSearches($searches) + { + $this->container['searches'] = $searches; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoResultsResponseSearches.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoResultsResponseSearches.php new file mode 100644 index 0000000000..78e1b0cf9c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetSearchesNoResultsResponseSearches.php @@ -0,0 +1,279 @@ + 'string', + 'count' => 'int', + 'nbHits' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'search' => null, + 'count' => null, + 'nbHits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'search' => 'setSearch', + 'count' => 'setCount', + 'nbHits' => 'setNbHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'search' => 'getSearch', + 'count' => 'getCount', + 'nbHits' => 'getNbHits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['search'])) { + $this->container['search'] = $data['search']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + if (isset($data['nbHits'])) { + $this->container['nbHits'] = $data['nbHits']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['search']) || $this->container['search'] === null) { + $invalidProperties[] = "'search' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if (!isset($this->container['nbHits']) || $this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets search + * + * @return string + */ + public function getSearch() + { + return $this->container['search'] ?? null; + } + + /** + * Sets search + * + * @param string $search the search query + * + * @return self + */ + public function setSearch($search) + { + $this->container['search'] = $search; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits'] ?? null; + } + + /** + * Sets nbHits + * + * @param int $nbHits number of hits that the search query matched + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetStatusResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetStatusResponse.php new file mode 100644 index 0000000000..d777e9d2f0 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetStatusResponse.php @@ -0,0 +1,211 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'updatedAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'updatedAt' => 'setUpdatedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'updatedAt' => 'getUpdatedAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['updatedAt'])) { + $this->container['updatedAt'] = $data['updatedAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['updatedAt']) || $this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets updatedAt + * + * @return string + */ + public function getUpdatedAt() + { + return $this->container['updatedAt'] ?? null; + } + + /** + * Sets updatedAt + * + * @param string $updatedAt date of last update (ISO-8601 format) + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopCountriesResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopCountriesResponse.php new file mode 100644 index 0000000000..0fda1fdd43 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopCountriesResponse.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Analytics\GetTopCountriesResponseCountries[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'countries' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'countries' => 'setCountries', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'countries' => 'getCountries', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['countries'])) { + $this->container['countries'] = $data['countries']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['countries']) || $this->container['countries'] === null) { + $invalidProperties[] = "'countries' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets countries + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopCountriesResponseCountries[] + */ + public function getCountries() + { + return $this->container['countries'] ?? null; + } + + /** + * Sets countries + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetTopCountriesResponseCountries[] $countries a list of countries with their count + * + * @return self + */ + public function setCountries($countries) + { + $this->container['countries'] = $countries; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopCountriesResponseCountries.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopCountriesResponseCountries.php new file mode 100644 index 0000000000..8432cf60bd --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopCountriesResponseCountries.php @@ -0,0 +1,245 @@ + 'string', + 'count' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'country' => null, + 'count' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country' => 'setCountry', + 'count' => 'setCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country' => 'getCountry', + 'count' => 'getCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['country'])) { + $this->container['country'] = $data['country']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['country']) || $this->container['country'] === null) { + $invalidProperties[] = "'country' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country'] ?? null; + } + + /** + * Sets country + * + * @param string $country the country + * + * @return self + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterAttribute.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterAttribute.php new file mode 100644 index 0000000000..0be476be3f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterAttribute.php @@ -0,0 +1,245 @@ + 'string', + 'count' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'attribute' => null, + 'count' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'attribute' => 'setAttribute', + 'count' => 'setCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'attribute' => 'getAttribute', + 'count' => 'getCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['attribute'])) { + $this->container['attribute'] = $data['attribute']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['attribute']) || $this->container['attribute'] === null) { + $invalidProperties[] = "'attribute' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets attribute + * + * @return string + */ + public function getAttribute() + { + return $this->container['attribute'] ?? null; + } + + /** + * Sets attribute + * + * @param string $attribute the attribute + * + * @return self + */ + public function setAttribute($attribute) + { + $this->container['attribute'] = $attribute; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterAttributesResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterAttributesResponse.php new file mode 100644 index 0000000000..8e92831e61 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterAttributesResponse.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterAttribute[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'attributes' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'attributes' => 'setAttributes', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'attributes' => 'getAttributes', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['attributes'])) { + $this->container['attributes'] = $data['attributes']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['attributes']) || $this->container['attributes'] === null) { + $invalidProperties[] = "'attributes' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets attributes + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterAttribute[] + */ + public function getAttributes() + { + return $this->container['attributes'] ?? null; + } + + /** + * Sets attributes + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterAttribute[] $attributes a list of attributes with their count + * + * @return self + */ + public function setAttributes($attributes) + { + $this->container['attributes'] = $attributes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterForAttribute.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterForAttribute.php new file mode 100644 index 0000000000..c4ed25d239 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterForAttribute.php @@ -0,0 +1,313 @@ + 'string', + 'operator' => 'string', + 'value' => 'string', + 'count' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'attribute' => null, + 'operator' => null, + 'value' => null, + 'count' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'attribute' => 'setAttribute', + 'operator' => 'setOperator', + 'value' => 'setValue', + 'count' => 'setCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'attribute' => 'getAttribute', + 'operator' => 'getOperator', + 'value' => 'getValue', + 'count' => 'getCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['attribute'])) { + $this->container['attribute'] = $data['attribute']; + } + if (isset($data['operator'])) { + $this->container['operator'] = $data['operator']; + } + if (isset($data['value'])) { + $this->container['value'] = $data['value']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['attribute']) || $this->container['attribute'] === null) { + $invalidProperties[] = "'attribute' can't be null"; + } + if (!isset($this->container['operator']) || $this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if (!isset($this->container['value']) || $this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets attribute + * + * @return string + */ + public function getAttribute() + { + return $this->container['attribute'] ?? null; + } + + /** + * Sets attribute + * + * @param string $attribute the attribute + * + * @return self + */ + public function setAttribute($attribute) + { + $this->container['attribute'] = $attribute; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator'] ?? null; + } + + /** + * Sets operator + * + * @param string $operator the operator + * + * @return self + */ + public function setOperator($operator) + { + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value + * + * @param string $value the value of the attribute + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterForAttributeResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterForAttributeResponse.php new file mode 100644 index 0000000000..2178af0a18 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFilterForAttributeResponse.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterForAttribute[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'values' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'values' => 'setValues', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'values' => 'getValues', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['values'])) { + $this->container['values'] = $data['values']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['values']) || $this->container['values'] === null) { + $invalidProperties[] = "'values' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets values + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterForAttribute[] + */ + public function getValues() + { + return $this->container['values'] ?? null; + } + + /** + * Sets values + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetTopFilterForAttribute[] $values a list of filters for the given attributes + * + * @return self + */ + public function setValues($values) + { + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsResponse.php new file mode 100644 index 0000000000..a424cef6aa --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsResponse.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Analytics\GetTopFiltersNoResultsValues[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'values' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'values' => 'setValues', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'values' => 'getValues', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['values'])) { + $this->container['values'] = $data['values']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['values']) || $this->container['values'] === null) { + $invalidProperties[] = "'values' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets values + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopFiltersNoResultsValues[] + */ + public function getValues() + { + return $this->container['values'] ?? null; + } + + /** + * Sets values + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetTopFiltersNoResultsValues[] $values a list of filters without results + * + * @return self + */ + public function setValues($values) + { + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsValue.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsValue.php new file mode 100644 index 0000000000..a3cf93351e --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsValue.php @@ -0,0 +1,279 @@ + 'string', + 'operator' => 'string', + 'value' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'attribute' => null, + 'operator' => null, + 'value' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'attribute' => 'setAttribute', + 'operator' => 'setOperator', + 'value' => 'setValue', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'attribute' => 'getAttribute', + 'operator' => 'getOperator', + 'value' => 'getValue', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['attribute'])) { + $this->container['attribute'] = $data['attribute']; + } + if (isset($data['operator'])) { + $this->container['operator'] = $data['operator']; + } + if (isset($data['value'])) { + $this->container['value'] = $data['value']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['attribute']) || $this->container['attribute'] === null) { + $invalidProperties[] = "'attribute' can't be null"; + } + if (!isset($this->container['operator']) || $this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if (!isset($this->container['value']) || $this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets attribute + * + * @return string + */ + public function getAttribute() + { + return $this->container['attribute'] ?? null; + } + + /** + * Sets attribute + * + * @param string $attribute the attribute + * + * @return self + */ + public function setAttribute($attribute) + { + $this->container['attribute'] = $attribute; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator'] ?? null; + } + + /** + * Sets operator + * + * @param string $operator the operator + * + * @return self + */ + public function setOperator($operator) + { + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value + * + * @param string $value the value of the attribute + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsValues.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsValues.php new file mode 100644 index 0000000000..ac1960827d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopFiltersNoResultsValues.php @@ -0,0 +1,245 @@ + 'int', + 'values' => '\Algolia\AlgoliaSearch\Model\Analytics\GetTopFiltersNoResultsValue[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'count' => null, + 'values' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'values' => 'setValues', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'values' => 'getValues', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + if (isset($data['values'])) { + $this->container['values'] = $data['values']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if (!isset($this->container['values']) || $this->container['values'] === null) { + $invalidProperties[] = "'values' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets values + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetTopFiltersNoResultsValue[] + */ + public function getValues() + { + return $this->container['values'] ?? null; + } + + /** + * Sets values + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetTopFiltersNoResultsValue[] $values a list of filters without results + * + * @return self + */ + public function setValues($values) + { + $this->container['values'] = $values; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopHitsResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopHitsResponse.php new file mode 100644 index 0000000000..d9f9ef9bd4 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopHitsResponse.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Analytics\TopHitsResponseWithAnalyticsHits[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'hits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['hits'])) { + $this->container['hits'] = $data['hits']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['hits']) || $this->container['hits'] === null) { + $invalidProperties[] = "'hits' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets hits + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\TopHitsResponseWithAnalyticsHits[] + */ + public function getHits() + { + return $this->container['hits'] ?? null; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\TopHitsResponseWithAnalyticsHits[] $hits a list of top hits with their count and analytics + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopSearchesResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopSearchesResponse.php new file mode 100644 index 0000000000..25a1325e62 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetTopSearchesResponse.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Analytics\TopSearchesResponseWithAnalyticsSearches[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'searches' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'searches' => 'setSearches', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'searches' => 'getSearches', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['searches'])) { + $this->container['searches'] = $data['searches']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['searches']) || $this->container['searches'] === null) { + $invalidProperties[] = "'searches' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets searches + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\TopSearchesResponseWithAnalyticsSearches[] + */ + public function getSearches() + { + return $this->container['searches'] ?? null; + } + + /** + * Sets searches + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\TopSearchesResponseWithAnalyticsSearches[] $searches a list of top searches with their count and analytics + * + * @return self + */ + public function setSearches($searches) + { + $this->container['searches'] = $searches; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/GetUsersCountResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/GetUsersCountResponse.php new file mode 100644 index 0000000000..7c7220a07c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/GetUsersCountResponse.php @@ -0,0 +1,245 @@ + 'int', + 'dates' => '\Algolia\AlgoliaSearch\Model\Analytics\GetSearchesCountResponseDates[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'count' => null, + 'dates' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'count' => 'setCount', + 'dates' => 'setDates', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'count' => 'getCount', + 'dates' => 'getDates', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + if (isset($data['dates'])) { + $this->container['dates'] = $data['dates']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if (!isset($this->container['dates']) || $this->container['dates'] === null) { + $invalidProperties[] = "'dates' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets dates + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesCountResponseDates[] + */ + public function getDates() + { + return $this->container['dates'] ?? null; + } + + /** + * Sets dates + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesCountResponseDates[] $dates a list of users count with their date + * + * @return self + */ + public function setDates($dates) + { + $this->container['dates'] = $dates; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/ModelInterface.php b/clients/algoliasearch-client-php/lib/Model/Analytics/ModelInterface.php new file mode 100644 index 0000000000..8cf55c6bb6 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/ModelInterface.php @@ -0,0 +1,54 @@ + '\Algolia\AlgoliaSearch\Model\Analytics\TopHitsResponseHits[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'hits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['hits'])) { + $this->container['hits'] = $data['hits']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['hits']) || $this->container['hits'] === null) { + $invalidProperties[] = "'hits' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets hits + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\TopHitsResponseHits[] + */ + public function getHits() + { + return $this->container['hits'] ?? null; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\TopHitsResponseHits[] $hits a list of top hits with their count + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/TopHitsResponseHits.php b/clients/algoliasearch-client-php/lib/Model/Analytics/TopHitsResponseHits.php new file mode 100644 index 0000000000..e878809eca --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/TopHitsResponseHits.php @@ -0,0 +1,245 @@ + 'string', + 'count' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'hit' => null, + 'count' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hit' => 'setHit', + 'count' => 'setCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hit' => 'getHit', + 'count' => 'getCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['hit'])) { + $this->container['hit'] = $data['hit']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['hit']) || $this->container['hit'] === null) { + $invalidProperties[] = "'hit' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets hit + * + * @return string + */ + public function getHit() + { + return $this->container['hit'] ?? null; + } + + /** + * Sets hit + * + * @param string $hit the hit + * + * @return self + */ + public function setHit($hit) + { + $this->container['hit'] = $hit; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/TopHitsResponseWithAnalytics.php b/clients/algoliasearch-client-php/lib/Model/Analytics/TopHitsResponseWithAnalytics.php new file mode 100644 index 0000000000..793b71a6c1 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/TopHitsResponseWithAnalytics.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Analytics\TopHitsResponseWithAnalyticsHits[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'hits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['hits'])) { + $this->container['hits'] = $data['hits']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['hits']) || $this->container['hits'] === null) { + $invalidProperties[] = "'hits' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets hits + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\TopHitsResponseWithAnalyticsHits[] + */ + public function getHits() + { + return $this->container['hits'] ?? null; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\TopHitsResponseWithAnalyticsHits[] $hits a list of top hits with their count and analytics + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/TopHitsResponseWithAnalyticsHits.php b/clients/algoliasearch-client-php/lib/Model/Analytics/TopHitsResponseWithAnalyticsHits.php new file mode 100644 index 0000000000..d7aaddc50e --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/TopHitsResponseWithAnalyticsHits.php @@ -0,0 +1,415 @@ + 'string', + 'count' => 'int', + 'clickThroughRate' => 'double', + 'conversionRate' => 'double', + 'trackedSearchCount' => 'int', + 'clickCount' => 'int', + 'conversionCount' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'hit' => null, + 'count' => null, + 'clickThroughRate' => 'double', + 'conversionRate' => 'double', + 'trackedSearchCount' => null, + 'clickCount' => null, + 'conversionCount' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hit' => 'setHit', + 'count' => 'setCount', + 'clickThroughRate' => 'setClickThroughRate', + 'conversionRate' => 'setConversionRate', + 'trackedSearchCount' => 'setTrackedSearchCount', + 'clickCount' => 'setClickCount', + 'conversionCount' => 'setConversionCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hit' => 'getHit', + 'count' => 'getCount', + 'clickThroughRate' => 'getClickThroughRate', + 'conversionRate' => 'getConversionRate', + 'trackedSearchCount' => 'getTrackedSearchCount', + 'clickCount' => 'getClickCount', + 'conversionCount' => 'getConversionCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['hit'])) { + $this->container['hit'] = $data['hit']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + if (isset($data['clickThroughRate'])) { + $this->container['clickThroughRate'] = $data['clickThroughRate']; + } + if (isset($data['conversionRate'])) { + $this->container['conversionRate'] = $data['conversionRate']; + } + if (isset($data['trackedSearchCount'])) { + $this->container['trackedSearchCount'] = $data['trackedSearchCount']; + } + if (isset($data['clickCount'])) { + $this->container['clickCount'] = $data['clickCount']; + } + if (isset($data['conversionCount'])) { + $this->container['conversionCount'] = $data['conversionCount']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['hit']) || $this->container['hit'] === null) { + $invalidProperties[] = "'hit' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if (!isset($this->container['clickThroughRate']) || $this->container['clickThroughRate'] === null) { + $invalidProperties[] = "'clickThroughRate' can't be null"; + } + if (!isset($this->container['conversionRate']) || $this->container['conversionRate'] === null) { + $invalidProperties[] = "'conversionRate' can't be null"; + } + if (!isset($this->container['trackedSearchCount']) || $this->container['trackedSearchCount'] === null) { + $invalidProperties[] = "'trackedSearchCount' can't be null"; + } + if (!isset($this->container['clickCount']) || $this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + if (!isset($this->container['conversionCount']) || $this->container['conversionCount'] === null) { + $invalidProperties[] = "'conversionCount' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets hit + * + * @return string + */ + public function getHit() + { + return $this->container['hit'] ?? null; + } + + /** + * Sets hit + * + * @param string $hit the hit + * + * @return self + */ + public function setHit($hit) + { + $this->container['hit'] = $hit; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets clickThroughRate + * + * @return float + */ + public function getClickThroughRate() + { + return $this->container['clickThroughRate'] ?? null; + } + + /** + * Sets clickThroughRate + * + * @param float $clickThroughRate the click-through rate + * + * @return self + */ + public function setClickThroughRate($clickThroughRate) + { + $this->container['clickThroughRate'] = $clickThroughRate; + + return $this; + } + + /** + * Gets conversionRate + * + * @return float + */ + public function getConversionRate() + { + return $this->container['conversionRate'] ?? null; + } + + /** + * Sets conversionRate + * + * @param float $conversionRate the conversion rate + * + * @return self + */ + public function setConversionRate($conversionRate) + { + $this->container['conversionRate'] = $conversionRate; + + return $this; + } + + /** + * Gets trackedSearchCount + * + * @return int + */ + public function getTrackedSearchCount() + { + return $this->container['trackedSearchCount'] ?? null; + } + + /** + * Sets trackedSearchCount + * + * @param int $trackedSearchCount the number of tracked search click + * + * @return self + */ + public function setTrackedSearchCount($trackedSearchCount) + { + $this->container['trackedSearchCount'] = $trackedSearchCount; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount'] ?? null; + } + + /** + * Sets clickCount + * + * @param int $clickCount the number of click event + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + + /** + * Gets conversionCount + * + * @return int + */ + public function getConversionCount() + { + return $this->container['conversionCount'] ?? null; + } + + /** + * Sets conversionCount + * + * @param int $conversionCount the number of converted clicks + * + * @return self + */ + public function setConversionCount($conversionCount) + { + $this->container['conversionCount'] = $conversionCount; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/TopSearchesResponse.php b/clients/algoliasearch-client-php/lib/Model/Analytics/TopSearchesResponse.php new file mode 100644 index 0000000000..f13570be12 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/TopSearchesResponse.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoResultsResponseSearches[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'searches' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'searches' => 'setSearches', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'searches' => 'getSearches', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['searches'])) { + $this->container['searches'] = $data['searches']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['searches']) || $this->container['searches'] === null) { + $invalidProperties[] = "'searches' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets searches + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoResultsResponseSearches[] + */ + public function getSearches() + { + return $this->container['searches'] ?? null; + } + + /** + * Sets searches + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\GetSearchesNoResultsResponseSearches[] $searches a list of top searches with their count + * + * @return self + */ + public function setSearches($searches) + { + $this->container['searches'] = $searches; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/TopSearchesResponseWithAnalytics.php b/clients/algoliasearch-client-php/lib/Model/Analytics/TopSearchesResponseWithAnalytics.php new file mode 100644 index 0000000000..2f9fbbd02f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/TopSearchesResponseWithAnalytics.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Analytics\TopSearchesResponseWithAnalyticsSearches[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'searches' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'searches' => 'setSearches', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'searches' => 'getSearches', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['searches'])) { + $this->container['searches'] = $data['searches']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['searches']) || $this->container['searches'] === null) { + $invalidProperties[] = "'searches' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets searches + * + * @return \Algolia\AlgoliaSearch\Model\Analytics\TopSearchesResponseWithAnalyticsSearches[] + */ + public function getSearches() + { + return $this->container['searches'] ?? null; + } + + /** + * Sets searches + * + * @param \Algolia\AlgoliaSearch\Model\Analytics\TopSearchesResponseWithAnalyticsSearches[] $searches a list of top searches with their count and analytics + * + * @return self + */ + public function setSearches($searches) + { + $this->container['searches'] = $searches; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Analytics/TopSearchesResponseWithAnalyticsSearches.php b/clients/algoliasearch-client-php/lib/Model/Analytics/TopSearchesResponseWithAnalyticsSearches.php new file mode 100644 index 0000000000..d884114d41 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Analytics/TopSearchesResponseWithAnalyticsSearches.php @@ -0,0 +1,483 @@ + 'string', + 'count' => 'int', + 'clickThroughRate' => 'double', + 'averageClickPosition' => 'int', + 'conversionRate' => 'double', + 'trackedSearchCount' => 'int', + 'clickCount' => 'int', + 'conversionCount' => 'int', + 'nbHits' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'search' => null, + 'count' => null, + 'clickThroughRate' => 'double', + 'averageClickPosition' => null, + 'conversionRate' => 'double', + 'trackedSearchCount' => null, + 'clickCount' => null, + 'conversionCount' => null, + 'nbHits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'search' => 'setSearch', + 'count' => 'setCount', + 'clickThroughRate' => 'setClickThroughRate', + 'averageClickPosition' => 'setAverageClickPosition', + 'conversionRate' => 'setConversionRate', + 'trackedSearchCount' => 'setTrackedSearchCount', + 'clickCount' => 'setClickCount', + 'conversionCount' => 'setConversionCount', + 'nbHits' => 'setNbHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'search' => 'getSearch', + 'count' => 'getCount', + 'clickThroughRate' => 'getClickThroughRate', + 'averageClickPosition' => 'getAverageClickPosition', + 'conversionRate' => 'getConversionRate', + 'trackedSearchCount' => 'getTrackedSearchCount', + 'clickCount' => 'getClickCount', + 'conversionCount' => 'getConversionCount', + 'nbHits' => 'getNbHits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['search'])) { + $this->container['search'] = $data['search']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + if (isset($data['clickThroughRate'])) { + $this->container['clickThroughRate'] = $data['clickThroughRate']; + } + if (isset($data['averageClickPosition'])) { + $this->container['averageClickPosition'] = $data['averageClickPosition']; + } + if (isset($data['conversionRate'])) { + $this->container['conversionRate'] = $data['conversionRate']; + } + if (isset($data['trackedSearchCount'])) { + $this->container['trackedSearchCount'] = $data['trackedSearchCount']; + } + if (isset($data['clickCount'])) { + $this->container['clickCount'] = $data['clickCount']; + } + if (isset($data['conversionCount'])) { + $this->container['conversionCount'] = $data['conversionCount']; + } + if (isset($data['nbHits'])) { + $this->container['nbHits'] = $data['nbHits']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['search']) || $this->container['search'] === null) { + $invalidProperties[] = "'search' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + if (!isset($this->container['clickThroughRate']) || $this->container['clickThroughRate'] === null) { + $invalidProperties[] = "'clickThroughRate' can't be null"; + } + if (!isset($this->container['averageClickPosition']) || $this->container['averageClickPosition'] === null) { + $invalidProperties[] = "'averageClickPosition' can't be null"; + } + if (!isset($this->container['conversionRate']) || $this->container['conversionRate'] === null) { + $invalidProperties[] = "'conversionRate' can't be null"; + } + if (!isset($this->container['trackedSearchCount']) || $this->container['trackedSearchCount'] === null) { + $invalidProperties[] = "'trackedSearchCount' can't be null"; + } + if (!isset($this->container['clickCount']) || $this->container['clickCount'] === null) { + $invalidProperties[] = "'clickCount' can't be null"; + } + if (!isset($this->container['conversionCount']) || $this->container['conversionCount'] === null) { + $invalidProperties[] = "'conversionCount' can't be null"; + } + if (!isset($this->container['nbHits']) || $this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets search + * + * @return string + */ + public function getSearch() + { + return $this->container['search'] ?? null; + } + + /** + * Sets search + * + * @param string $search the search query + * + * @return self + */ + public function setSearch($search) + { + $this->container['search'] = $search; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the number of occurrences + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + + /** + * Gets clickThroughRate + * + * @return float + */ + public function getClickThroughRate() + { + return $this->container['clickThroughRate'] ?? null; + } + + /** + * Sets clickThroughRate + * + * @param float $clickThroughRate the click-through rate + * + * @return self + */ + public function setClickThroughRate($clickThroughRate) + { + $this->container['clickThroughRate'] = $clickThroughRate; + + return $this; + } + + /** + * Gets averageClickPosition + * + * @return int + */ + public function getAverageClickPosition() + { + return $this->container['averageClickPosition'] ?? null; + } + + /** + * Sets averageClickPosition + * + * @param int $averageClickPosition the average position of all the click count event + * + * @return self + */ + public function setAverageClickPosition($averageClickPosition) + { + $this->container['averageClickPosition'] = $averageClickPosition; + + return $this; + } + + /** + * Gets conversionRate + * + * @return float + */ + public function getConversionRate() + { + return $this->container['conversionRate'] ?? null; + } + + /** + * Sets conversionRate + * + * @param float $conversionRate the conversion rate + * + * @return self + */ + public function setConversionRate($conversionRate) + { + $this->container['conversionRate'] = $conversionRate; + + return $this; + } + + /** + * Gets trackedSearchCount + * + * @return int + */ + public function getTrackedSearchCount() + { + return $this->container['trackedSearchCount'] ?? null; + } + + /** + * Sets trackedSearchCount + * + * @param int $trackedSearchCount the number of tracked search click + * + * @return self + */ + public function setTrackedSearchCount($trackedSearchCount) + { + $this->container['trackedSearchCount'] = $trackedSearchCount; + + return $this; + } + + /** + * Gets clickCount + * + * @return int + */ + public function getClickCount() + { + return $this->container['clickCount'] ?? null; + } + + /** + * Sets clickCount + * + * @param int $clickCount the number of click event + * + * @return self + */ + public function setClickCount($clickCount) + { + $this->container['clickCount'] = $clickCount; + + return $this; + } + + /** + * Gets conversionCount + * + * @return int + */ + public function getConversionCount() + { + return $this->container['conversionCount'] ?? null; + } + + /** + * Sets conversionCount + * + * @param int $conversionCount the number of converted clicks + * + * @return self + */ + public function setConversionCount($conversionCount) + { + $this->container['conversionCount'] = $conversionCount; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits'] ?? null; + } + + /** + * Sets nbHits + * + * @param int $nbHits number of hits that the search query matched + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Insights/ErrorBase.php b/clients/algoliasearch-client-php/lib/Model/Insights/ErrorBase.php new file mode 100644 index 0000000000..45263960a4 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Insights/ErrorBase.php @@ -0,0 +1,209 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['message'])) { + $this->container['message'] = $data['message']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Insights/InsightEvent.php b/clients/algoliasearch-client-php/lib/Model/Insights/InsightEvent.php new file mode 100644 index 0000000000..d0447da67d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Insights/InsightEvent.php @@ -0,0 +1,507 @@ + 'string', + 'eventName' => 'string', + 'index' => 'string', + 'userToken' => 'string', + 'timestamp' => 'int', + 'queryID' => 'string', + 'objectIDs' => 'string[]', + 'filters' => 'string[]', + 'positions' => 'int[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'eventType' => null, + 'eventName' => null, + 'index' => null, + 'userToken' => null, + 'timestamp' => null, + 'queryID' => null, + 'objectIDs' => null, + 'filters' => null, + 'positions' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'eventType' => 'setEventType', + 'eventName' => 'setEventName', + 'index' => 'setIndex', + 'userToken' => 'setUserToken', + 'timestamp' => 'setTimestamp', + 'queryID' => 'setQueryID', + 'objectIDs' => 'setObjectIDs', + 'filters' => 'setFilters', + 'positions' => 'setPositions', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'eventType' => 'getEventType', + 'eventName' => 'getEventName', + 'index' => 'getIndex', + 'userToken' => 'getUserToken', + 'timestamp' => 'getTimestamp', + 'queryID' => 'getQueryID', + 'objectIDs' => 'getObjectIDs', + 'filters' => 'getFilters', + 'positions' => 'getPositions', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + const EVENT_TYPE_CLICK = 'click'; + const EVENT_TYPE_CONVERSION = 'conversion'; + const EVENT_TYPE_VIEW = 'view'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getEventTypeAllowableValues() + { + return [ + self::EVENT_TYPE_CLICK, + self::EVENT_TYPE_CONVERSION, + self::EVENT_TYPE_VIEW, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['eventType'])) { + $this->container['eventType'] = $data['eventType']; + } + if (isset($data['eventName'])) { + $this->container['eventName'] = $data['eventName']; + } + if (isset($data['index'])) { + $this->container['index'] = $data['index']; + } + if (isset($data['userToken'])) { + $this->container['userToken'] = $data['userToken']; + } + if (isset($data['timestamp'])) { + $this->container['timestamp'] = $data['timestamp']; + } + if (isset($data['queryID'])) { + $this->container['queryID'] = $data['queryID']; + } + if (isset($data['objectIDs'])) { + $this->container['objectIDs'] = $data['objectIDs']; + } + if (isset($data['filters'])) { + $this->container['filters'] = $data['filters']; + } + if (isset($data['positions'])) { + $this->container['positions'] = $data['positions']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['eventType']) || $this->container['eventType'] === null) { + $invalidProperties[] = "'eventType' can't be null"; + } + $allowedValues = $this->getEventTypeAllowableValues(); + if (isset($this->container['eventType']) && !in_array($this->container['eventType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'eventType', must be one of '%s'", + $this->container['eventType'], + implode("', '", $allowedValues) + ); + } + + if (!isset($this->container['eventName']) || $this->container['eventName'] === null) { + $invalidProperties[] = "'eventName' can't be null"; + } + if (!isset($this->container['index']) || $this->container['index'] === null) { + $invalidProperties[] = "'index' can't be null"; + } + if (!isset($this->container['userToken']) || $this->container['userToken'] === null) { + $invalidProperties[] = "'userToken' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets eventType + * + * @return string + */ + public function getEventType() + { + return $this->container['eventType'] ?? null; + } + + /** + * Sets eventType + * + * @param string $eventType an eventType can be a click, a conversion, or a view + * + * @return self + */ + public function setEventType($eventType) + { + $allowedValues = $this->getEventTypeAllowableValues(); + if (!in_array($eventType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'eventType', must be one of '%s'", + $eventType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['eventType'] = $eventType; + + return $this; + } + + /** + * Gets eventName + * + * @return string + */ + public function getEventName() + { + return $this->container['eventName'] ?? null; + } + + /** + * Sets eventName + * + * @param string $eventName a user-defined string used to categorize events + * + * @return self + */ + public function setEventName($eventName) + { + $this->container['eventName'] = $eventName; + + return $this; + } + + /** + * Gets index + * + * @return string + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index + * + * @param string $index name of the targeted index + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets userToken + * + * @return string + */ + public function getUserToken() + { + return $this->container['userToken'] ?? null; + } + + /** + * Sets userToken + * + * @param string $userToken A user identifier. Depending if the user is logged-in or not, several strategies can be used from a sessionId to a technical identifier. + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets timestamp + * + * @return int|null + */ + public function getTimestamp() + { + return $this->container['timestamp'] ?? null; + } + + /** + * Sets timestamp + * + * @param int|null $timestamp time of the event expressed in milliseconds since the Unix epoch + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets queryID + * + * @return string|null + */ + public function getQueryID() + { + return $this->container['queryID'] ?? null; + } + + /** + * Sets queryID + * + * @param string|null $queryID Algolia queryID. This is required when an event is tied to a search. + * + * @return self + */ + public function setQueryID($queryID) + { + $this->container['queryID'] = $queryID; + + return $this; + } + + /** + * Gets objectIDs + * + * @return string[]|null + */ + public function getObjectIDs() + { + return $this->container['objectIDs'] ?? null; + } + + /** + * Sets objectIDs + * + * @param string[]|null $objectIDs An array of index objectID. Limited to 20 objects. An event can’t have both objectIDs and filters at the same time. + * + * @return self + */ + public function setObjectIDs($objectIDs) + { + $this->container['objectIDs'] = $objectIDs; + + return $this; + } + + /** + * Gets filters + * + * @return string[]|null + */ + public function getFilters() + { + return $this->container['filters'] ?? null; + } + + /** + * Sets filters + * + * @param string[]|null $filters An array of filters. Limited to 10 filters. An event can’t have both objectIDs and filters at the same time. + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets positions + * + * @return int[]|null + */ + public function getPositions() + { + return $this->container['positions'] ?? null; + } + + /** + * Sets positions + * + * @param int[]|null $positions Position of the click in the list of Algolia search results. This field is required if a queryID is provided. One position must be provided for each objectID. + * + * @return self + */ + public function setPositions($positions) + { + $this->container['positions'] = $positions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Insights/InsightEvents.php b/clients/algoliasearch-client-php/lib/Model/Insights/InsightEvents.php new file mode 100644 index 0000000000..7549619926 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Insights/InsightEvents.php @@ -0,0 +1,213 @@ + '\Algolia\AlgoliaSearch\Model\Insights\InsightEvent[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'events' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'events' => 'setEvents', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'events' => 'getEvents', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['events'])) { + $this->container['events'] = $data['events']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['events']) || $this->container['events'] === null) { + $invalidProperties[] = "'events' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets events + * + * @return \Algolia\AlgoliaSearch\Model\Insights\InsightEvent[] + */ + public function getEvents() + { + return $this->container['events'] ?? null; + } + + /** + * Sets events + * + * @param \Algolia\AlgoliaSearch\Model\Insights\InsightEvent[] $events array of events sent + * + * @return self + */ + public function setEvents($events) + { + $this->container['events'] = $events; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Insights/ModelInterface.php b/clients/algoliasearch-client-php/lib/Model/Insights/ModelInterface.php new file mode 100644 index 0000000000..05014509a0 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Insights/ModelInterface.php @@ -0,0 +1,54 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['message'])) { + $this->container['message'] = $data['message']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['message']) || $this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string $message a message confirming the event push + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Personalization/DeleteUserProfileResponse.php b/clients/algoliasearch-client-php/lib/Model/Personalization/DeleteUserProfileResponse.php new file mode 100644 index 0000000000..478a2ce57f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Personalization/DeleteUserProfileResponse.php @@ -0,0 +1,245 @@ + 'string', + 'deletedUntil' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'userToken' => null, + 'deletedUntil' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userToken' => 'setUserToken', + 'deletedUntil' => 'setDeletedUntil', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userToken' => 'getUserToken', + 'deletedUntil' => 'getDeletedUntil', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['userToken'])) { + $this->container['userToken'] = $data['userToken']; + } + if (isset($data['deletedUntil'])) { + $this->container['deletedUntil'] = $data['deletedUntil']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['userToken']) || $this->container['userToken'] === null) { + $invalidProperties[] = "'userToken' can't be null"; + } + if (!isset($this->container['deletedUntil']) || $this->container['deletedUntil'] === null) { + $invalidProperties[] = "'deletedUntil' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets userToken + * + * @return string + */ + public function getUserToken() + { + return $this->container['userToken'] ?? null; + } + + /** + * Sets userToken + * + * @param string $userToken userToken representing the user for which to fetch the Personalization profile + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets deletedUntil + * + * @return string + */ + public function getDeletedUntil() + { + return $this->container['deletedUntil'] ?? null; + } + + /** + * Sets deletedUntil + * + * @param string $deletedUntil A date until which the data can safely be considered as deleted for the given user. Any data received after the deletedUntil date will start building a new user profile. + * + * @return self + */ + public function setDeletedUntil($deletedUntil) + { + $this->container['deletedUntil'] = $deletedUntil; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Personalization/ErrorBase.php b/clients/algoliasearch-client-php/lib/Model/Personalization/ErrorBase.php new file mode 100644 index 0000000000..d2766b5d4c --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Personalization/ErrorBase.php @@ -0,0 +1,209 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['message'])) { + $this->container['message'] = $data['message']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Personalization/EventScoring.php b/clients/algoliasearch-client-php/lib/Model/Personalization/EventScoring.php new file mode 100644 index 0000000000..1fd93dd3e2 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Personalization/EventScoring.php @@ -0,0 +1,279 @@ + 'int', + 'eventName' => 'string', + 'eventType' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'score' => null, + 'eventName' => null, + 'eventType' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'score' => 'setScore', + 'eventName' => 'setEventName', + 'eventType' => 'setEventType', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'score' => 'getScore', + 'eventName' => 'getEventName', + 'eventType' => 'getEventType', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['score'])) { + $this->container['score'] = $data['score']; + } + if (isset($data['eventName'])) { + $this->container['eventName'] = $data['eventName']; + } + if (isset($data['eventType'])) { + $this->container['eventType'] = $data['eventType']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['score']) || $this->container['score'] === null) { + $invalidProperties[] = "'score' can't be null"; + } + if (!isset($this->container['eventName']) || $this->container['eventName'] === null) { + $invalidProperties[] = "'eventName' can't be null"; + } + if (!isset($this->container['eventType']) || $this->container['eventType'] === null) { + $invalidProperties[] = "'eventType' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets score + * + * @return int + */ + public function getScore() + { + return $this->container['score'] ?? null; + } + + /** + * Sets score + * + * @param int $score the score for the event + * + * @return self + */ + public function setScore($score) + { + $this->container['score'] = $score; + + return $this; + } + + /** + * Gets eventName + * + * @return string + */ + public function getEventName() + { + return $this->container['eventName'] ?? null; + } + + /** + * Sets eventName + * + * @param string $eventName the name of the event + * + * @return self + */ + public function setEventName($eventName) + { + $this->container['eventName'] = $eventName; + + return $this; + } + + /** + * Gets eventType + * + * @return string + */ + public function getEventType() + { + return $this->container['eventType'] ?? null; + } + + /** + * Sets eventType + * + * @param string $eventType the type of the event + * + * @return self + */ + public function setEventType($eventType) + { + $this->container['eventType'] = $eventType; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Personalization/FacetScoring.php b/clients/algoliasearch-client-php/lib/Model/Personalization/FacetScoring.php new file mode 100644 index 0000000000..c8f9ead087 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Personalization/FacetScoring.php @@ -0,0 +1,245 @@ + 'int', + 'facetName' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'score' => null, + 'facetName' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'score' => 'setScore', + 'facetName' => 'setFacetName', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'score' => 'getScore', + 'facetName' => 'getFacetName', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['score'])) { + $this->container['score'] = $data['score']; + } + if (isset($data['facetName'])) { + $this->container['facetName'] = $data['facetName']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['score']) || $this->container['score'] === null) { + $invalidProperties[] = "'score' can't be null"; + } + if (!isset($this->container['facetName']) || $this->container['facetName'] === null) { + $invalidProperties[] = "'facetName' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets score + * + * @return int + */ + public function getScore() + { + return $this->container['score'] ?? null; + } + + /** + * Sets score + * + * @param int $score the score for the event + * + * @return self + */ + public function setScore($score) + { + $this->container['score'] = $score; + + return $this; + } + + /** + * Gets facetName + * + * @return string + */ + public function getFacetName() + { + return $this->container['facetName'] ?? null; + } + + /** + * Sets facetName + * + * @param string $facetName the name of the facet + * + * @return self + */ + public function setFacetName($facetName) + { + $this->container['facetName'] = $facetName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Personalization/GetUserTokenResponse.php b/clients/algoliasearch-client-php/lib/Model/Personalization/GetUserTokenResponse.php new file mode 100644 index 0000000000..7dabb21cbc --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Personalization/GetUserTokenResponse.php @@ -0,0 +1,279 @@ + 'string', + 'lastEventAt' => 'string', + 'scores' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'userToken' => null, + 'lastEventAt' => null, + 'scores' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userToken' => 'setUserToken', + 'lastEventAt' => 'setLastEventAt', + 'scores' => 'setScores', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userToken' => 'getUserToken', + 'lastEventAt' => 'getLastEventAt', + 'scores' => 'getScores', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['userToken'])) { + $this->container['userToken'] = $data['userToken']; + } + if (isset($data['lastEventAt'])) { + $this->container['lastEventAt'] = $data['lastEventAt']; + } + if (isset($data['scores'])) { + $this->container['scores'] = $data['scores']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['userToken']) || $this->container['userToken'] === null) { + $invalidProperties[] = "'userToken' can't be null"; + } + if (!isset($this->container['lastEventAt']) || $this->container['lastEventAt'] === null) { + $invalidProperties[] = "'lastEventAt' can't be null"; + } + if (!isset($this->container['scores']) || $this->container['scores'] === null) { + $invalidProperties[] = "'scores' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets userToken + * + * @return string + */ + public function getUserToken() + { + return $this->container['userToken'] ?? null; + } + + /** + * Sets userToken + * + * @param string $userToken userToken representing the user for which to fetch the Personalization profile + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets lastEventAt + * + * @return string + */ + public function getLastEventAt() + { + return $this->container['lastEventAt'] ?? null; + } + + /** + * Sets lastEventAt + * + * @param string $lastEventAt Date of last event update. (ISO-8601 format). + * + * @return self + */ + public function setLastEventAt($lastEventAt) + { + $this->container['lastEventAt'] = $lastEventAt; + + return $this; + } + + /** + * Gets scores + * + * @return object + */ + public function getScores() + { + return $this->container['scores'] ?? null; + } + + /** + * Sets scores + * + * @param object $scores the userToken scores + * + * @return self + */ + public function setScores($scores) + { + $this->container['scores'] = $scores; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Personalization/ModelInterface.php b/clients/algoliasearch-client-php/lib/Model/Personalization/ModelInterface.php new file mode 100644 index 0000000000..9bb78a3525 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Personalization/ModelInterface.php @@ -0,0 +1,54 @@ + '\Algolia\AlgoliaSearch\Model\Personalization\EventScoring[]', + 'facetScoring' => '\Algolia\AlgoliaSearch\Model\Personalization\FacetScoring[]', + 'personalizationImpact' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'eventScoring' => null, + 'facetScoring' => null, + 'personalizationImpact' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'eventScoring' => 'setEventScoring', + 'facetScoring' => 'setFacetScoring', + 'personalizationImpact' => 'setPersonalizationImpact', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'eventScoring' => 'getEventScoring', + 'facetScoring' => 'getFacetScoring', + 'personalizationImpact' => 'getPersonalizationImpact', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['eventScoring'])) { + $this->container['eventScoring'] = $data['eventScoring']; + } + if (isset($data['facetScoring'])) { + $this->container['facetScoring'] = $data['facetScoring']; + } + if (isset($data['personalizationImpact'])) { + $this->container['personalizationImpact'] = $data['personalizationImpact']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['eventScoring']) || $this->container['eventScoring'] === null) { + $invalidProperties[] = "'eventScoring' can't be null"; + } + if (!isset($this->container['facetScoring']) || $this->container['facetScoring'] === null) { + $invalidProperties[] = "'facetScoring' can't be null"; + } + if (!isset($this->container['personalizationImpact']) || $this->container['personalizationImpact'] === null) { + $invalidProperties[] = "'personalizationImpact' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets eventScoring + * + * @return \Algolia\AlgoliaSearch\Model\Personalization\EventScoring[] + */ + public function getEventScoring() + { + return $this->container['eventScoring'] ?? null; + } + + /** + * Sets eventScoring + * + * @param \Algolia\AlgoliaSearch\Model\Personalization\EventScoring[] $eventScoring scores associated with the events + * + * @return self + */ + public function setEventScoring($eventScoring) + { + $this->container['eventScoring'] = $eventScoring; + + return $this; + } + + /** + * Gets facetScoring + * + * @return \Algolia\AlgoliaSearch\Model\Personalization\FacetScoring[] + */ + public function getFacetScoring() + { + return $this->container['facetScoring'] ?? null; + } + + /** + * Sets facetScoring + * + * @param \Algolia\AlgoliaSearch\Model\Personalization\FacetScoring[] $facetScoring scores associated with the facets + * + * @return self + */ + public function setFacetScoring($facetScoring) + { + $this->container['facetScoring'] = $facetScoring; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact'] ?? null; + } + + /** + * Sets personalizationImpact + * + * @param int $personalizationImpact the impact that personalization has on search results: a number between 0 (personalization disabled) and 100 (personalization fully enabled) + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Personalization/SetPersonalizationStrategyResponse.php b/clients/algoliasearch-client-php/lib/Model/Personalization/SetPersonalizationStrategyResponse.php new file mode 100644 index 0000000000..71825f0ca2 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Personalization/SetPersonalizationStrategyResponse.php @@ -0,0 +1,211 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['message'])) { + $this->container['message'] = $data['message']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['message']) || $this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string $message a message confirming the strategy update + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/ErrorBase.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/ErrorBase.php new file mode 100644 index 0000000000..53b29d0fb3 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/ErrorBase.php @@ -0,0 +1,209 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['message'])) { + $this->container['message'] = $data['message']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/IndexName.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/IndexName.php new file mode 100644 index 0000000000..066d833e04 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/IndexName.php @@ -0,0 +1,211 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'indexName' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'indexName' => 'getIndexName', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['indexName']) || $this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string $indexName index name to target + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/LogFile.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/LogFile.php new file mode 100644 index 0000000000..4de0b42723 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/LogFile.php @@ -0,0 +1,350 @@ + 'string', + 'level' => 'string', + 'message' => 'string', + 'contextLevel' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'timestamp' => null, + 'level' => null, + 'message' => null, + 'contextLevel' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'timestamp' => 'setTimestamp', + 'level' => 'setLevel', + 'message' => 'setMessage', + 'contextLevel' => 'setContextLevel', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'timestamp' => 'getTimestamp', + 'level' => 'getLevel', + 'message' => 'getMessage', + 'contextLevel' => 'getContextLevel', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + const LEVEL_INFO = 'INFO'; + const LEVEL_SKIP = 'SKIP'; + const LEVEL_ERROR = 'ERROR'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getLevelAllowableValues() + { + return [ + self::LEVEL_INFO, + self::LEVEL_SKIP, + self::LEVEL_ERROR, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['timestamp'])) { + $this->container['timestamp'] = $data['timestamp']; + } + if (isset($data['level'])) { + $this->container['level'] = $data['level']; + } + if (isset($data['message'])) { + $this->container['message'] = $data['message']; + } + if (isset($data['contextLevel'])) { + $this->container['contextLevel'] = $data['contextLevel']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['timestamp']) || $this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if (!isset($this->container['level']) || $this->container['level'] === null) { + $invalidProperties[] = "'level' can't be null"; + } + $allowedValues = $this->getLevelAllowableValues(); + if (isset($this->container['level']) && !in_array($this->container['level'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'level', must be one of '%s'", + $this->container['level'], + implode("', '", $allowedValues) + ); + } + + if (!isset($this->container['message']) || $this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + if (!isset($this->container['contextLevel']) || $this->container['contextLevel'] === null) { + $invalidProperties[] = "'contextLevel' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets timestamp + * + * @return string + */ + public function getTimestamp() + { + return $this->container['timestamp'] ?? null; + } + + /** + * Sets timestamp + * + * @param string $timestamp date and time of creation of the record + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets level + * + * @return string + */ + public function getLevel() + { + return $this->container['level'] ?? null; + } + + /** + * Sets level + * + * @param string $level type of the record, can be one of three values (INFO, SKIP or ERROR) + * + * @return self + */ + public function setLevel($level) + { + $allowedValues = $this->getLevelAllowableValues(); + if (!in_array($level, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'level', must be one of '%s'", + $level, + implode("', '", $allowedValues) + ) + ); + } + $this->container['level'] = $level; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string $message detailed description of what happened + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets contextLevel + * + * @return int + */ + public function getContextLevel() + { + return $this->container['contextLevel'] ?? null; + } + + /** + * Sets contextLevel + * + * @param int $contextLevel indicates the hierarchy of the records. For example, a record with contextLevel=1 belongs to a preceding record with contextLevel=0. + * + * @return self + */ + public function setContextLevel($contextLevel) + { + $this->container['contextLevel'] = $contextLevel; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/ModelInterface.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/ModelInterface.php new file mode 100644 index 0000000000..f2b2589d31 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/ModelInterface.php @@ -0,0 +1,54 @@ + 'string', + 'sourceIndices' => '\Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndiceWithReplicas[]', + 'languages' => 'string[]', + 'exclude' => 'string[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'indexName' => null, + 'sourceIndices' => null, + 'languages' => null, + 'exclude' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + 'sourceIndices' => 'setSourceIndices', + 'languages' => 'setLanguages', + 'exclude' => 'setExclude', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'indexName' => 'getIndexName', + 'sourceIndices' => 'getSourceIndices', + 'languages' => 'getLanguages', + 'exclude' => 'getExclude', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + if (isset($data['sourceIndices'])) { + $this->container['sourceIndices'] = $data['sourceIndices']; + } + if (isset($data['languages'])) { + $this->container['languages'] = $data['languages']; + } + if (isset($data['exclude'])) { + $this->container['exclude'] = $data['exclude']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['indexName']) || $this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + if (!isset($this->container['sourceIndices']) || $this->container['sourceIndices'] === null) { + $invalidProperties[] = "'sourceIndices' can't be null"; + } + if (!isset($this->container['languages']) || $this->container['languages'] === null) { + $invalidProperties[] = "'languages' can't be null"; + } + if (!isset($this->container['exclude']) || $this->container['exclude'] === null) { + $invalidProperties[] = "'exclude' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string $indexName index name to target + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets sourceIndices + * + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndiceWithReplicas[] + */ + public function getSourceIndices() + { + return $this->container['sourceIndices'] ?? null; + } + + /** + * Sets sourceIndices + * + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndiceWithReplicas[] $sourceIndices list of source indices used to generate a Query Suggestions index + * + * @return self + */ + public function setSourceIndices($sourceIndices) + { + $this->container['sourceIndices'] = $sourceIndices; + + return $this; + } + + /** + * Gets languages + * + * @return string[] + */ + public function getLanguages() + { + return $this->container['languages'] ?? null; + } + + /** + * Sets languages + * + * @param string[] $languages De-duplicate singular and plural suggestions. For example, let's say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain. + * + * @return self + */ + public function setLanguages($languages) + { + $this->container['languages'] = $languages; + + return $this; + } + + /** + * Gets exclude + * + * @return string[] + */ + public function getExclude() + { + return $this->container['exclude'] ?? null; + } + + /** + * Sets exclude + * + * @param string[] $exclude list of words and patterns to exclude from the Query Suggestions index + * + * @return self + */ + public function setExclude($exclude) + { + $this->container['exclude'] = $exclude; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndexParam.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndexParam.php new file mode 100644 index 0000000000..f1a0f2917d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndexParam.php @@ -0,0 +1,273 @@ + '\Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndex[]', + 'languages' => 'string[]', + 'exclude' => 'string[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'sourceIndices' => null, + 'languages' => null, + 'exclude' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sourceIndices' => 'setSourceIndices', + 'languages' => 'setLanguages', + 'exclude' => 'setExclude', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sourceIndices' => 'getSourceIndices', + 'languages' => 'getLanguages', + 'exclude' => 'getExclude', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['sourceIndices'])) { + $this->container['sourceIndices'] = $data['sourceIndices']; + } + if (isset($data['languages'])) { + $this->container['languages'] = $data['languages']; + } + if (isset($data['exclude'])) { + $this->container['exclude'] = $data['exclude']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['sourceIndices']) || $this->container['sourceIndices'] === null) { + $invalidProperties[] = "'sourceIndices' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets sourceIndices + * + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndex[] + */ + public function getSourceIndices() + { + return $this->container['sourceIndices'] ?? null; + } + + /** + * Sets sourceIndices + * + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndex[] $sourceIndices list of source indices used to generate a Query Suggestions index + * + * @return self + */ + public function setSourceIndices($sourceIndices) + { + $this->container['sourceIndices'] = $sourceIndices; + + return $this; + } + + /** + * Gets languages + * + * @return string[]|null + */ + public function getLanguages() + { + return $this->container['languages'] ?? null; + } + + /** + * Sets languages + * + * @param string[]|null $languages De-duplicate singular and plural suggestions. For example, let's say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain. + * + * @return self + */ + public function setLanguages($languages) + { + $this->container['languages'] = $languages; + + return $this; + } + + /** + * Gets exclude + * + * @return string[]|null + */ + public function getExclude() + { + return $this->container['exclude'] ?? null; + } + + /** + * Sets exclude + * + * @param string[]|null $exclude list of words and patterns to exclude from the Query Suggestions index + * + * @return self + */ + public function setExclude($exclude) + { + $this->container['exclude'] = $exclude; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndexWithIndexParam.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndexWithIndexParam.php new file mode 100644 index 0000000000..d8aec543e6 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/QuerySuggestionsIndexWithIndexParam.php @@ -0,0 +1,307 @@ + '\Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndex[]', + 'languages' => 'string[]', + 'exclude' => 'string[]', + 'indexName' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'sourceIndices' => null, + 'languages' => null, + 'exclude' => null, + 'indexName' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sourceIndices' => 'setSourceIndices', + 'languages' => 'setLanguages', + 'exclude' => 'setExclude', + 'indexName' => 'setIndexName', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sourceIndices' => 'getSourceIndices', + 'languages' => 'getLanguages', + 'exclude' => 'getExclude', + 'indexName' => 'getIndexName', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['sourceIndices'])) { + $this->container['sourceIndices'] = $data['sourceIndices']; + } + if (isset($data['languages'])) { + $this->container['languages'] = $data['languages']; + } + if (isset($data['exclude'])) { + $this->container['exclude'] = $data['exclude']; + } + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['sourceIndices']) || $this->container['sourceIndices'] === null) { + $invalidProperties[] = "'sourceIndices' can't be null"; + } + if (!isset($this->container['indexName']) || $this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets sourceIndices + * + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndex[] + */ + public function getSourceIndices() + { + return $this->container['sourceIndices'] ?? null; + } + + /** + * Sets sourceIndices + * + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndex[] $sourceIndices list of source indices used to generate a Query Suggestions index + * + * @return self + */ + public function setSourceIndices($sourceIndices) + { + $this->container['sourceIndices'] = $sourceIndices; + + return $this; + } + + /** + * Gets languages + * + * @return string[]|null + */ + public function getLanguages() + { + return $this->container['languages'] ?? null; + } + + /** + * Sets languages + * + * @param string[]|null $languages De-duplicate singular and plural suggestions. For example, let's say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain. + * + * @return self + */ + public function setLanguages($languages) + { + $this->container['languages'] = $languages; + + return $this; + } + + /** + * Gets exclude + * + * @return string[]|null + */ + public function getExclude() + { + return $this->container['exclude'] ?? null; + } + + /** + * Sets exclude + * + * @param string[]|null $exclude list of words and patterns to exclude from the Query Suggestions index + * + * @return self + */ + public function setExclude($exclude) + { + $this->container['exclude'] = $exclude; + + return $this; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string $indexName index name to target + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndex.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndex.php new file mode 100644 index 0000000000..b2c12b2400 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndex.php @@ -0,0 +1,397 @@ + 'string', + 'analyticsTags' => 'string[]', + 'facets' => 'object[]', + 'minHits' => 'int', + 'minLetters' => 'int', + 'generate' => 'string[][]', + 'external' => '\Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'indexName' => null, + 'analyticsTags' => null, + 'facets' => null, + 'minHits' => null, + 'minLetters' => null, + 'generate' => null, + 'external' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + 'analyticsTags' => 'setAnalyticsTags', + 'facets' => 'setFacets', + 'minHits' => 'setMinHits', + 'minLetters' => 'setMinLetters', + 'generate' => 'setGenerate', + 'external' => 'setExternal', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'indexName' => 'getIndexName', + 'analyticsTags' => 'getAnalyticsTags', + 'facets' => 'getFacets', + 'minHits' => 'getMinHits', + 'minLetters' => 'getMinLetters', + 'generate' => 'getGenerate', + 'external' => 'getExternal', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + if (isset($data['analyticsTags'])) { + $this->container['analyticsTags'] = $data['analyticsTags']; + } + if (isset($data['facets'])) { + $this->container['facets'] = $data['facets']; + } + if (isset($data['minHits'])) { + $this->container['minHits'] = $data['minHits']; + } + if (isset($data['minLetters'])) { + $this->container['minLetters'] = $data['minLetters']; + } + if (isset($data['generate'])) { + $this->container['generate'] = $data['generate']; + } + if (isset($data['external'])) { + $this->container['external'] = $data['external']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['indexName']) || $this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string $indexName source index name + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[]|null + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags'] ?? null; + } + + /** + * Sets analyticsTags + * + * @param string[]|null $analyticsTags list of analytics tags to filter the popular searches per tag + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets facets + * + * @return object[]|null + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets + * + * @param object[]|null $facets list of facets to define as categories for the query suggestions + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets minHits + * + * @return int|null + */ + public function getMinHits() + { + return $this->container['minHits'] ?? null; + } + + /** + * Sets minHits + * + * @param int|null $minHits Minimum number of hits (e.g., matching records in the source index) to generate a suggestions. + * + * @return self + */ + public function setMinHits($minHits) + { + $this->container['minHits'] = $minHits; + + return $this; + } + + /** + * Gets minLetters + * + * @return int|null + */ + public function getMinLetters() + { + return $this->container['minLetters'] ?? null; + } + + /** + * Sets minLetters + * + * @param int|null $minLetters minimum number of required letters for a suggestion to remain + * + * @return self + */ + public function setMinLetters($minLetters) + { + $this->container['minLetters'] = $minLetters; + + return $this; + } + + /** + * Gets generate + * + * @return string[][]|null + */ + public function getGenerate() + { + return $this->container['generate'] ?? null; + } + + /** + * Sets generate + * + * @param string[][]|null $generate List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC). + * + * @return self + */ + public function setGenerate($generate) + { + $this->container['generate'] = $generate; + + return $this; + } + + /** + * Gets external + * + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[]|null + */ + public function getExternal() + { + return $this->container['external'] ?? null; + } + + /** + * Sets external + * + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[]|null $external list of external indices to use to generate custom Query Suggestions + * + * @return self + */ + public function setExternal($external) + { + $this->container['external'] = $external; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndexExternal.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndexExternal.php new file mode 100644 index 0000000000..794e290216 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndexExternal.php @@ -0,0 +1,245 @@ + 'string', + 'count' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'query' => null, + 'count' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'count' => 'setCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'count' => 'getCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['query']) || $this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string $query the suggestion you would like to add + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count the measure of the suggestion relative popularity + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndiceWithReplicas.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndiceWithReplicas.php new file mode 100644 index 0000000000..b430024732 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SourceIndiceWithReplicas.php @@ -0,0 +1,451 @@ + 'bool', + 'indexName' => 'string', + 'analyticsTags' => 'string[]', + 'facets' => 'object[]', + 'minHits' => 'int', + 'minLetters' => 'int', + 'generate' => 'string[][]', + 'external' => '\Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'replicas' => null, + 'indexName' => null, + 'analyticsTags' => null, + 'facets' => null, + 'minHits' => null, + 'minLetters' => null, + 'generate' => null, + 'external' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'replicas' => 'setReplicas', + 'indexName' => 'setIndexName', + 'analyticsTags' => 'setAnalyticsTags', + 'facets' => 'setFacets', + 'minHits' => 'setMinHits', + 'minLetters' => 'setMinLetters', + 'generate' => 'setGenerate', + 'external' => 'setExternal', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'replicas' => 'getReplicas', + 'indexName' => 'getIndexName', + 'analyticsTags' => 'getAnalyticsTags', + 'facets' => 'getFacets', + 'minHits' => 'getMinHits', + 'minLetters' => 'getMinLetters', + 'generate' => 'getGenerate', + 'external' => 'getExternal', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['replicas'])) { + $this->container['replicas'] = $data['replicas']; + } + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + if (isset($data['analyticsTags'])) { + $this->container['analyticsTags'] = $data['analyticsTags']; + } + if (isset($data['facets'])) { + $this->container['facets'] = $data['facets']; + } + if (isset($data['minHits'])) { + $this->container['minHits'] = $data['minHits']; + } + if (isset($data['minLetters'])) { + $this->container['minLetters'] = $data['minLetters']; + } + if (isset($data['generate'])) { + $this->container['generate'] = $data['generate']; + } + if (isset($data['external'])) { + $this->container['external'] = $data['external']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['replicas']) || $this->container['replicas'] === null) { + $invalidProperties[] = "'replicas' can't be null"; + } + if (!isset($this->container['indexName']) || $this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + if (!isset($this->container['analyticsTags']) || $this->container['analyticsTags'] === null) { + $invalidProperties[] = "'analyticsTags' can't be null"; + } + if (!isset($this->container['facets']) || $this->container['facets'] === null) { + $invalidProperties[] = "'facets' can't be null"; + } + if (!isset($this->container['minHits']) || $this->container['minHits'] === null) { + $invalidProperties[] = "'minHits' can't be null"; + } + if (!isset($this->container['minLetters']) || $this->container['minLetters'] === null) { + $invalidProperties[] = "'minLetters' can't be null"; + } + if (!isset($this->container['generate']) || $this->container['generate'] === null) { + $invalidProperties[] = "'generate' can't be null"; + } + if (!isset($this->container['external']) || $this->container['external'] === null) { + $invalidProperties[] = "'external' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets replicas + * + * @return bool + */ + public function getReplicas() + { + return $this->container['replicas'] ?? null; + } + + /** + * Sets replicas + * + * @param bool $replicas true if the Query Suggestions index is a replicas + * + * @return self + */ + public function setReplicas($replicas) + { + $this->container['replicas'] = $replicas; + + return $this; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string $indexName source index name + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[] + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags'] ?? null; + } + + /** + * Sets analyticsTags + * + * @param string[] $analyticsTags list of analytics tags to filter the popular searches per tag + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets facets + * + * @return object[] + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets + * + * @param object[] $facets list of facets to define as categories for the query suggestions + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets minHits + * + * @return int + */ + public function getMinHits() + { + return $this->container['minHits'] ?? null; + } + + /** + * Sets minHits + * + * @param int $minHits Minimum number of hits (e.g., matching records in the source index) to generate a suggestions. + * + * @return self + */ + public function setMinHits($minHits) + { + $this->container['minHits'] = $minHits; + + return $this; + } + + /** + * Gets minLetters + * + * @return int + */ + public function getMinLetters() + { + return $this->container['minLetters'] ?? null; + } + + /** + * Sets minLetters + * + * @param int $minLetters minimum number of required letters for a suggestion to remain + * + * @return self + */ + public function setMinLetters($minLetters) + { + $this->container['minLetters'] = $minLetters; + + return $this; + } + + /** + * Gets generate + * + * @return string[][] + */ + public function getGenerate() + { + return $this->container['generate'] ?? null; + } + + /** + * Sets generate + * + * @param string[][] $generate List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC). + * + * @return self + */ + public function setGenerate($generate) + { + $this->container['generate'] = $generate; + + return $this; + } + + /** + * Gets external + * + * @return \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[] + */ + public function getExternal() + { + return $this->container['external'] ?? null; + } + + /** + * Sets external + * + * @param \Algolia\AlgoliaSearch\Model\QuerySuggestions\SourceIndexExternal[] $external list of external indices to use to generate custom Query Suggestions + * + * @return self + */ + public function setExternal($external) + { + $this->container['external'] = $external; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/Status.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/Status.php new file mode 100644 index 0000000000..784ac5de1f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/Status.php @@ -0,0 +1,279 @@ + 'string', + 'isRunning' => 'bool', + 'lastBuiltAt' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'indexName' => null, + 'isRunning' => null, + 'lastBuiltAt' => 'data-time', + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + 'isRunning' => 'setIsRunning', + 'lastBuiltAt' => 'setLastBuiltAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'indexName' => 'getIndexName', + 'isRunning' => 'getIsRunning', + 'lastBuiltAt' => 'getLastBuiltAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + if (isset($data['isRunning'])) { + $this->container['isRunning'] = $data['isRunning']; + } + if (isset($data['lastBuiltAt'])) { + $this->container['lastBuiltAt'] = $data['lastBuiltAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['indexName']) || $this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + if (!isset($this->container['isRunning']) || $this->container['isRunning'] === null) { + $invalidProperties[] = "'isRunning' can't be null"; + } + if (!isset($this->container['lastBuiltAt']) || $this->container['lastBuiltAt'] === null) { + $invalidProperties[] = "'lastBuiltAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string $indexName the targeted index name + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets isRunning + * + * @return bool + */ + public function getIsRunning() + { + return $this->container['isRunning'] ?? null; + } + + /** + * Sets isRunning + * + * @param bool $isRunning true if the Query Suggestions index is running + * + * @return self + */ + public function setIsRunning($isRunning) + { + $this->container['isRunning'] = $isRunning; + + return $this; + } + + /** + * Gets lastBuiltAt + * + * @return string + */ + public function getLastBuiltAt() + { + return $this->container['lastBuiltAt'] ?? null; + } + + /** + * Sets lastBuiltAt + * + * @param string $lastBuiltAt date and time of the last build + * + * @return self + */ + public function setLastBuiltAt($lastBuiltAt) + { + $this->container['lastBuiltAt'] = $lastBuiltAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SucessResponse.php b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SucessResponse.php new file mode 100644 index 0000000000..c4367e1246 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/QuerySuggestions/SucessResponse.php @@ -0,0 +1,245 @@ + 'int', + 'message' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'status' => null, + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + 'message' => 'getMessage', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['status'])) { + $this->container['status'] = $data['status']; + } + if (isset($data['message'])) { + $this->container['message'] = $data['message']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['status']) || $this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if (!isset($this->container['message']) || $this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets status + * + * @return int + */ + public function getStatus() + { + return $this->container['status'] ?? null; + } + + /** + * Sets status + * + * @param int $status the status code + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string $message message of the response + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/AroundRadius.php b/clients/algoliasearch-client-php/lib/Model/Recommend/AroundRadius.php new file mode 100644 index 0000000000..cf659989ea --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/AroundRadius.php @@ -0,0 +1,183 @@ +listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/AroundRadiusOneOf.php b/clients/algoliasearch-client-php/lib/Model/Recommend/AroundRadiusOneOf.php new file mode 100644 index 0000000000..b30297eb62 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/AroundRadiusOneOf.php @@ -0,0 +1,30 @@ + 'string', + 'threshold' => 'int', + 'maxRecommendations' => 'int', + 'queryParameters' => '\Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject', + 'fallbackParameters' => '\Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'indexName' => null, + 'threshold' => null, + 'maxRecommendations' => null, + 'queryParameters' => null, + 'fallbackParameters' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + 'threshold' => 'setThreshold', + 'maxRecommendations' => 'setMaxRecommendations', + 'queryParameters' => 'setQueryParameters', + 'fallbackParameters' => 'setFallbackParameters', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'indexName' => 'getIndexName', + 'threshold' => 'getThreshold', + 'maxRecommendations' => 'getMaxRecommendations', + 'queryParameters' => 'getQueryParameters', + 'fallbackParameters' => 'getFallbackParameters', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + if (isset($data['threshold'])) { + $this->container['threshold'] = $data['threshold']; + } + if (isset($data['maxRecommendations'])) { + $this->container['maxRecommendations'] = $data['maxRecommendations']; + } + if (isset($data['queryParameters'])) { + $this->container['queryParameters'] = $data['queryParameters']; + } + if (isset($data['fallbackParameters'])) { + $this->container['fallbackParameters'] = $data['fallbackParameters']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['indexName']) || $this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + if (!isset($this->container['threshold']) || $this->container['threshold'] === null) { + $invalidProperties[] = "'threshold' can't be null"; + } + if (($this->container['threshold'] > 100)) { + $invalidProperties[] = "invalid value for 'threshold', must be smaller than or equal to 100."; + } + + if (($this->container['threshold'] < 0)) { + $invalidProperties[] = "invalid value for 'threshold', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string $indexName the Algolia index name + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets threshold + * + * @return int + */ + public function getThreshold() + { + return $this->container['threshold'] ?? null; + } + + /** + * Sets threshold + * + * @param int $threshold the threshold to use when filtering recommendations by their score + * + * @return self + */ + public function setThreshold($threshold) + { + if (($threshold > 100)) { + throw new \InvalidArgumentException('invalid value for $threshold when calling BaseRecommendRequest., must be smaller than or equal to 100.'); + } + if (($threshold < 0)) { + throw new \InvalidArgumentException('invalid value for $threshold when calling BaseRecommendRequest., must be bigger than or equal to 0.'); + } + + $this->container['threshold'] = $threshold; + + return $this; + } + + /** + * Gets maxRecommendations + * + * @return int|null + */ + public function getMaxRecommendations() + { + return $this->container['maxRecommendations'] ?? null; + } + + /** + * Sets maxRecommendations + * + * @param int|null $maxRecommendations The max number of recommendations to retrieve. If it's set to 0, all the recommendations of the objectID may be returned. + * + * @return self + */ + public function setMaxRecommendations($maxRecommendations) + { + $this->container['maxRecommendations'] = $maxRecommendations; + + return $this; + } + + /** + * Gets queryParameters + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null + */ + public function getQueryParameters() + { + return $this->container['queryParameters'] ?? null; + } + + /** + * Sets queryParameters + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null $queryParameters queryParameters + * + * @return self + */ + public function setQueryParameters($queryParameters) + { + $this->container['queryParameters'] = $queryParameters; + + return $this; + } + + /** + * Gets fallbackParameters + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null + */ + public function getFallbackParameters() + { + return $this->container['fallbackParameters'] ?? null; + } + + /** + * Sets fallbackParameters + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null $fallbackParameters fallbackParameters + * + * @return self + */ + public function setFallbackParameters($fallbackParameters) + { + $this->container['fallbackParameters'] = $fallbackParameters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/BaseRecommendationRequest.php b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseRecommendationRequest.php new file mode 100644 index 0000000000..1998e69852 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseRecommendationRequest.php @@ -0,0 +1,245 @@ + '\Algolia\AlgoliaSearch\Model\Recommend\RecommendationModels', + 'objectID' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'model' => null, + 'objectID' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'model' => 'setModel', + 'objectID' => 'setObjectID', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'model' => 'getModel', + 'objectID' => 'getObjectID', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['model'])) { + $this->container['model'] = $data['model']; + } + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['model']) || $this->container['model'] === null) { + $invalidProperties[] = "'model' can't be null"; + } + if (!isset($this->container['objectID']) || $this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets model + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\RecommendationModels + */ + public function getModel() + { + return $this->container['model'] ?? null; + } + + /** + * Sets model + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\RecommendationModels $model model + * + * @return self + */ + public function setModel($model) + { + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchParams.php b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchParams.php new file mode 100644 index 0000000000..1949f41527 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchParams.php @@ -0,0 +1,1191 @@ + 'string', + 'filters' => 'string', + 'facetFilters' => 'string[]', + 'optionalFilters' => 'string[]', + 'numericFilters' => 'string[]', + 'tagFilters' => 'string[]', + 'sumOrFiltersScores' => 'bool', + 'facets' => 'string[]', + 'maxValuesPerFacet' => 'int', + 'facetingAfterDistinct' => 'bool', + 'sortFacetValuesBy' => 'string', + 'page' => 'int', + 'offset' => 'int', + 'length' => 'int', + 'aroundLatLng' => 'string', + 'aroundLatLngViaIP' => 'bool', + 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Recommend\AroundRadius', + 'aroundPrecision' => 'int', + 'minimumAroundRadius' => 'int', + 'insideBoundingBox' => 'float[]', + 'insidePolygon' => 'float[]', + 'naturalLanguages' => 'string[]', + 'ruleContexts' => 'string[]', + 'personalizationImpact' => 'int', + 'userToken' => 'string', + 'getRankingInfo' => 'bool', + 'clickAnalytics' => 'bool', + 'analytics' => 'bool', + 'analyticsTags' => 'string[]', + 'percentileComputation' => 'bool', + 'enableABTest' => 'bool', + 'enableReRanking' => 'bool', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'similarQuery' => null, + 'filters' => null, + 'facetFilters' => null, + 'optionalFilters' => null, + 'numericFilters' => null, + 'tagFilters' => null, + 'sumOrFiltersScores' => null, + 'facets' => null, + 'maxValuesPerFacet' => null, + 'facetingAfterDistinct' => null, + 'sortFacetValuesBy' => null, + 'page' => null, + 'offset' => null, + 'length' => null, + 'aroundLatLng' => null, + 'aroundLatLngViaIP' => null, + 'aroundRadius' => null, + 'aroundPrecision' => null, + 'minimumAroundRadius' => null, + 'insideBoundingBox' => null, + 'insidePolygon' => null, + 'naturalLanguages' => null, + 'ruleContexts' => null, + 'personalizationImpact' => null, + 'userToken' => null, + 'getRankingInfo' => null, + 'clickAnalytics' => null, + 'analytics' => null, + 'analyticsTags' => null, + 'percentileComputation' => null, + 'enableABTest' => null, + 'enableReRanking' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'similarQuery' => 'setSimilarQuery', + 'filters' => 'setFilters', + 'facetFilters' => 'setFacetFilters', + 'optionalFilters' => 'setOptionalFilters', + 'numericFilters' => 'setNumericFilters', + 'tagFilters' => 'setTagFilters', + 'sumOrFiltersScores' => 'setSumOrFiltersScores', + 'facets' => 'setFacets', + 'maxValuesPerFacet' => 'setMaxValuesPerFacet', + 'facetingAfterDistinct' => 'setFacetingAfterDistinct', + 'sortFacetValuesBy' => 'setSortFacetValuesBy', + 'page' => 'setPage', + 'offset' => 'setOffset', + 'length' => 'setLength', + 'aroundLatLng' => 'setAroundLatLng', + 'aroundLatLngViaIP' => 'setAroundLatLngViaIP', + 'aroundRadius' => 'setAroundRadius', + 'aroundPrecision' => 'setAroundPrecision', + 'minimumAroundRadius' => 'setMinimumAroundRadius', + 'insideBoundingBox' => 'setInsideBoundingBox', + 'insidePolygon' => 'setInsidePolygon', + 'naturalLanguages' => 'setNaturalLanguages', + 'ruleContexts' => 'setRuleContexts', + 'personalizationImpact' => 'setPersonalizationImpact', + 'userToken' => 'setUserToken', + 'getRankingInfo' => 'setGetRankingInfo', + 'clickAnalytics' => 'setClickAnalytics', + 'analytics' => 'setAnalytics', + 'analyticsTags' => 'setAnalyticsTags', + 'percentileComputation' => 'setPercentileComputation', + 'enableABTest' => 'setEnableABTest', + 'enableReRanking' => 'setEnableReRanking', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'similarQuery' => 'getSimilarQuery', + 'filters' => 'getFilters', + 'facetFilters' => 'getFacetFilters', + 'optionalFilters' => 'getOptionalFilters', + 'numericFilters' => 'getNumericFilters', + 'tagFilters' => 'getTagFilters', + 'sumOrFiltersScores' => 'getSumOrFiltersScores', + 'facets' => 'getFacets', + 'maxValuesPerFacet' => 'getMaxValuesPerFacet', + 'facetingAfterDistinct' => 'getFacetingAfterDistinct', + 'sortFacetValuesBy' => 'getSortFacetValuesBy', + 'page' => 'getPage', + 'offset' => 'getOffset', + 'length' => 'getLength', + 'aroundLatLng' => 'getAroundLatLng', + 'aroundLatLngViaIP' => 'getAroundLatLngViaIP', + 'aroundRadius' => 'getAroundRadius', + 'aroundPrecision' => 'getAroundPrecision', + 'minimumAroundRadius' => 'getMinimumAroundRadius', + 'insideBoundingBox' => 'getInsideBoundingBox', + 'insidePolygon' => 'getInsidePolygon', + 'naturalLanguages' => 'getNaturalLanguages', + 'ruleContexts' => 'getRuleContexts', + 'personalizationImpact' => 'getPersonalizationImpact', + 'userToken' => 'getUserToken', + 'getRankingInfo' => 'getGetRankingInfo', + 'clickAnalytics' => 'getClickAnalytics', + 'analytics' => 'getAnalytics', + 'analyticsTags' => 'getAnalyticsTags', + 'percentileComputation' => 'getPercentileComputation', + 'enableABTest' => 'getEnableABTest', + 'enableReRanking' => 'getEnableReRanking', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['similarQuery'])) { + $this->container['similarQuery'] = $data['similarQuery']; + } + if (isset($data['filters'])) { + $this->container['filters'] = $data['filters']; + } + 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['tagFilters'])) { + $this->container['tagFilters'] = $data['tagFilters']; + } + if (isset($data['sumOrFiltersScores'])) { + $this->container['sumOrFiltersScores'] = $data['sumOrFiltersScores']; + } + if (isset($data['facets'])) { + $this->container['facets'] = $data['facets']; + } + if (isset($data['maxValuesPerFacet'])) { + $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; + } + if (isset($data['facetingAfterDistinct'])) { + $this->container['facetingAfterDistinct'] = $data['facetingAfterDistinct']; + } + if (isset($data['sortFacetValuesBy'])) { + $this->container['sortFacetValuesBy'] = $data['sortFacetValuesBy']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['offset'])) { + $this->container['offset'] = $data['offset']; + } + if (isset($data['length'])) { + $this->container['length'] = $data['length']; + } + 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['naturalLanguages'])) { + $this->container['naturalLanguages'] = $data['naturalLanguages']; + } + if (isset($data['ruleContexts'])) { + $this->container['ruleContexts'] = $data['ruleContexts']; + } + if (isset($data['personalizationImpact'])) { + $this->container['personalizationImpact'] = $data['personalizationImpact']; + } + if (isset($data['userToken'])) { + $this->container['userToken'] = $data['userToken']; + } + if (isset($data['getRankingInfo'])) { + $this->container['getRankingInfo'] = $data['getRankingInfo']; + } + 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['percentileComputation'])) { + $this->container['percentileComputation'] = $data['percentileComputation']; + } + if (isset($data['enableABTest'])) { + $this->container['enableABTest'] = $data['enableABTest']; + } + if (isset($data['enableReRanking'])) { + $this->container['enableReRanking'] = $data['enableReRanking']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (isset($this->container['length']) && ($this->container['length'] > 1000)) { + $invalidProperties[] = "invalid value for 'length', must be smaller than or equal to 1000."; + } + + if (isset($this->container['length']) && ($this->container['length'] < 1)) { + $invalidProperties[] = "invalid value for 'length', must be bigger than or equal to 1."; + } + + if (isset($this->container['minimumAroundRadius']) && ($this->container['minimumAroundRadius'] < 1)) { + $invalidProperties[] = "invalid value for 'minimumAroundRadius', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets similarQuery + * + * @return string|null + */ + public function getSimilarQuery() + { + return $this->container['similarQuery'] ?? null; + } + + /** + * Sets similarQuery + * + * @param string|null $similarQuery overrides the query parameter and performs a more generic search that can be used to find \"similar\" results + * + * @return self + */ + public function setSimilarQuery($similarQuery) + { + $this->container['similarQuery'] = $similarQuery; + + return $this; + } + + /** + * Gets filters + * + * @return string|null + */ + public function getFilters() + { + return $this->container['filters'] ?? null; + } + + /** + * Sets filters + * + * @param string|null $filters filter the query with numeric, facet and/or tag filters + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets facetFilters + * + * @return string[]|null + */ + public function getFacetFilters() + { + return $this->container['facetFilters'] ?? null; + } + + /** + * Sets facetFilters + * + * @param string[]|null $facetFilters filter hits by facet value + * + * @return self + */ + public function setFacetFilters($facetFilters) + { + $this->container['facetFilters'] = $facetFilters; + + return $this; + } + + /** + * Gets optionalFilters + * + * @return string[]|null + */ + public function getOptionalFilters() + { + return $this->container['optionalFilters'] ?? null; + } + + /** + * Sets optionalFilters + * + * @param string[]|null $optionalFilters create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter + * + * @return self + */ + public function setOptionalFilters($optionalFilters) + { + $this->container['optionalFilters'] = $optionalFilters; + + return $this; + } + + /** + * Gets numericFilters + * + * @return string[]|null + */ + public function getNumericFilters() + { + return $this->container['numericFilters'] ?? null; + } + + /** + * Sets numericFilters + * + * @param string[]|null $numericFilters filter on numeric attributes + * + * @return self + */ + public function setNumericFilters($numericFilters) + { + $this->container['numericFilters'] = $numericFilters; + + return $this; + } + + /** + * Gets tagFilters + * + * @return string[]|null + */ + public function getTagFilters() + { + return $this->container['tagFilters'] ?? null; + } + + /** + * Sets tagFilters + * + * @param string[]|null $tagFilters filter hits by tags + * + * @return self + */ + public function setTagFilters($tagFilters) + { + $this->container['tagFilters'] = $tagFilters; + + return $this; + } + + /** + * Gets sumOrFiltersScores + * + * @return bool|null + */ + public function getSumOrFiltersScores() + { + return $this->container['sumOrFiltersScores'] ?? null; + } + + /** + * Sets sumOrFiltersScores + * + * @param bool|null $sumOrFiltersScores determines how to calculate the total score for filtering + * + * @return self + */ + public function setSumOrFiltersScores($sumOrFiltersScores) + { + $this->container['sumOrFiltersScores'] = $sumOrFiltersScores; + + return $this; + } + + /** + * Gets facets + * + * @return string[]|null + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets + * + * @param string[]|null $facets retrieve facets and their facet values + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets maxValuesPerFacet + * + * @return int|null + */ + public function getMaxValuesPerFacet() + { + return $this->container['maxValuesPerFacet'] ?? null; + } + + /** + * Sets maxValuesPerFacet + * + * @param int|null $maxValuesPerFacet maximum number of facet values to return for each facet during a regular search + * + * @return self + */ + public function setMaxValuesPerFacet($maxValuesPerFacet) + { + $this->container['maxValuesPerFacet'] = $maxValuesPerFacet; + + return $this; + } + + /** + * Gets facetingAfterDistinct + * + * @return bool|null + */ + public function getFacetingAfterDistinct() + { + return $this->container['facetingAfterDistinct'] ?? null; + } + + /** + * Sets facetingAfterDistinct + * + * @param bool|null $facetingAfterDistinct force faceting to be applied after de-duplication (via the Distinct setting) + * + * @return self + */ + public function setFacetingAfterDistinct($facetingAfterDistinct) + { + $this->container['facetingAfterDistinct'] = $facetingAfterDistinct; + + return $this; + } + + /** + * Gets sortFacetValuesBy + * + * @return string|null + */ + public function getSortFacetValuesBy() + { + return $this->container['sortFacetValuesBy'] ?? null; + } + + /** + * Sets sortFacetValuesBy + * + * @param string|null $sortFacetValuesBy controls how facet values are fetched + * + * @return self + */ + public function setSortFacetValuesBy($sortFacetValuesBy) + { + $this->container['sortFacetValuesBy'] = $sortFacetValuesBy; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int|null $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets offset + * + * @return int|null + */ + public function getOffset() + { + return $this->container['offset'] ?? null; + } + + /** + * Sets offset + * + * @param int|null $offset specify the offset of the first hit to return + * + * @return self + */ + public function setOffset($offset) + { + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets length + * + * @return int|null + */ + public function getLength() + { + return $this->container['length'] ?? null; + } + + /** + * Sets length + * + * @param int|null $length set the number of hits to retrieve (used only with offset) + * + * @return self + */ + public function setLength($length) + { + if (!is_null($length) && ($length > 1000)) { + throw new \InvalidArgumentException('invalid value for $length when calling BaseSearchParams., must be smaller than or equal to 1000.'); + } + if (!is_null($length) && ($length < 1)) { + throw new \InvalidArgumentException('invalid value for $length when calling BaseSearchParams., must be bigger than or equal to 1.'); + } + + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng'] ?? null; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng search for entries around a central geolocation, enabling a geo search within a circular area + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets aroundLatLngViaIP + * + * @return bool|null + */ + public function getAroundLatLngViaIP() + { + return $this->container['aroundLatLngViaIP'] ?? null; + } + + /** + * Sets aroundLatLngViaIP + * + * @param bool|null $aroundLatLngViaIP search for entries around a given location automatically computed from the requester's IP address + * + * @return self + */ + public function setAroundLatLngViaIP($aroundLatLngViaIP) + { + $this->container['aroundLatLngViaIP'] = $aroundLatLngViaIP; + + return $this; + } + + /** + * Gets aroundRadius + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\AroundRadius|null + */ + public function getAroundRadius() + { + return $this->container['aroundRadius'] ?? null; + } + + /** + * Sets aroundRadius + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\AroundRadius|null $aroundRadius aroundRadius + * + * @return self + */ + public function setAroundRadius($aroundRadius) + { + $this->container['aroundRadius'] = $aroundRadius; + + return $this; + } + + /** + * Gets aroundPrecision + * + * @return int|null + */ + public function getAroundPrecision() + { + return $this->container['aroundPrecision'] ?? null; + } + + /** + * Sets aroundPrecision + * + * @param int|null $aroundPrecision precision of geo search (in meters), to add grouping by geo location to the ranking formula + * + * @return self + */ + public function setAroundPrecision($aroundPrecision) + { + $this->container['aroundPrecision'] = $aroundPrecision; + + return $this; + } + + /** + * Gets minimumAroundRadius + * + * @return int|null + */ + public function getMinimumAroundRadius() + { + return $this->container['minimumAroundRadius'] ?? null; + } + + /** + * Sets minimumAroundRadius + * + * @param int|null $minimumAroundRadius minimum radius (in meters) used for a geo search when aroundRadius is not set + * + * @return self + */ + public function setMinimumAroundRadius($minimumAroundRadius) + { + if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { + throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling BaseSearchParams., must be bigger than or equal to 1.'); + } + + $this->container['minimumAroundRadius'] = $minimumAroundRadius; + + return $this; + } + + /** + * Gets insideBoundingBox + * + * @return float[]|null + */ + public function getInsideBoundingBox() + { + return $this->container['insideBoundingBox'] ?? null; + } + + /** + * Sets insideBoundingBox + * + * @param float[]|null $insideBoundingBox search inside a rectangular area (in geo coordinates) + * + * @return self + */ + public function setInsideBoundingBox($insideBoundingBox) + { + $this->container['insideBoundingBox'] = $insideBoundingBox; + + return $this; + } + + /** + * Gets insidePolygon + * + * @return float[]|null + */ + public function getInsidePolygon() + { + return $this->container['insidePolygon'] ?? null; + } + + /** + * Sets insidePolygon + * + * @param float[]|null $insidePolygon search inside a polygon (in geo coordinates) + * + * @return self + */ + public function setInsidePolygon($insidePolygon) + { + $this->container['insidePolygon'] = $insidePolygon; + + return $this; + } + + /** + * Gets naturalLanguages + * + * @return string[]|null + */ + public function getNaturalLanguages() + { + return $this->container['naturalLanguages'] ?? null; + } + + /** + * Sets naturalLanguages + * + * @param string[]|null $naturalLanguages This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. + * + * @return self + */ + public function setNaturalLanguages($naturalLanguages) + { + $this->container['naturalLanguages'] = $naturalLanguages; + + return $this; + } + + /** + * Gets ruleContexts + * + * @return string[]|null + */ + public function getRuleContexts() + { + return $this->container['ruleContexts'] ?? null; + } + + /** + * Sets ruleContexts + * + * @param string[]|null $ruleContexts enables contextual rules + * + * @return self + */ + public function setRuleContexts($ruleContexts) + { + $this->container['ruleContexts'] = $ruleContexts; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int|null + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact'] ?? null; + } + + /** + * Sets personalizationImpact + * + * @param int|null $personalizationImpact define the impact of the Personalization feature + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + return $this; + } + + /** + * Gets userToken + * + * @return string|null + */ + public function getUserToken() + { + return $this->container['userToken'] ?? null; + } + + /** + * Sets userToken + * + * @param string|null $userToken associates a certain user token with the current search + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets getRankingInfo + * + * @return bool|null + */ + public function getGetRankingInfo() + { + return $this->container['getRankingInfo'] ?? null; + } + + /** + * Sets getRankingInfo + * + * @param bool|null $getRankingInfo retrieve detailed ranking information + * + * @return self + */ + public function setGetRankingInfo($getRankingInfo) + { + $this->container['getRankingInfo'] = $getRankingInfo; + + return $this; + } + + /** + * Gets clickAnalytics + * + * @return bool|null + */ + public function getClickAnalytics() + { + return $this->container['clickAnalytics'] ?? null; + } + + /** + * Sets clickAnalytics + * + * @param bool|null $clickAnalytics enable the Click Analytics feature + * + * @return self + */ + public function setClickAnalytics($clickAnalytics) + { + $this->container['clickAnalytics'] = $clickAnalytics; + + return $this; + } + + /** + * Gets analytics + * + * @return bool|null + */ + public function getAnalytics() + { + return $this->container['analytics'] ?? null; + } + + /** + * Sets analytics + * + * @param bool|null $analytics whether the current query will be taken into account in the Analytics + * + * @return self + */ + public function setAnalytics($analytics) + { + $this->container['analytics'] = $analytics; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[]|null + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags'] ?? null; + } + + /** + * Sets analyticsTags + * + * @param string[]|null $analyticsTags list of tags to apply to the query for analytics purposes + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets percentileComputation + * + * @return bool|null + */ + public function getPercentileComputation() + { + return $this->container['percentileComputation'] ?? null; + } + + /** + * Sets percentileComputation + * + * @param bool|null $percentileComputation whether to include or exclude a query from the processing-time percentile computation + * + * @return self + */ + public function setPercentileComputation($percentileComputation) + { + $this->container['percentileComputation'] = $percentileComputation; + + return $this; + } + + /** + * Gets enableABTest + * + * @return bool|null + */ + public function getEnableABTest() + { + return $this->container['enableABTest'] ?? null; + } + + /** + * Sets enableABTest + * + * @param bool|null $enableABTest whether this search should participate in running AB tests + * + * @return self + */ + public function setEnableABTest($enableABTest) + { + $this->container['enableABTest'] = $enableABTest; + + return $this; + } + + /** + * Gets enableReRanking + * + * @return bool|null + */ + public function getEnableReRanking() + { + return $this->container['enableReRanking'] ?? null; + } + + /** + * Sets enableReRanking + * + * @param bool|null $enableReRanking whether this search should use AI Re-Ranking + * + * @return self + */ + public function setEnableReRanking($enableReRanking) + { + $this->container['enableReRanking'] = $enableReRanking; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponse.php b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponse.php new file mode 100644 index 0000000000..0cdaa18446 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponse.php @@ -0,0 +1,956 @@ + 'int', + 'abTestVariantID' => 'int', + 'aroundLatLng' => 'string', + 'automaticRadius' => 'string', + 'exhaustiveFacetsCount' => 'bool', + 'exhaustiveNbHits' => 'bool', + 'exhaustiveTypo' => 'bool', + 'facets' => 'array>', + 'facetsStats' => 'array', + 'hitsPerPage' => 'int', + 'index' => 'string', + 'indexUsed' => 'string', + 'message' => 'string', + 'nbHits' => 'int', + 'nbPages' => 'int', + 'nbSortedHits' => 'int', + 'page' => 'int', + 'params' => 'string', + 'parsedQuery' => 'string', + 'processingTimeMS' => 'int', + 'query' => 'string', + 'queryAfterRemoval' => 'string', + 'serverUsed' => 'string', + 'userData' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'abTestID' => null, + 'abTestVariantID' => null, + 'aroundLatLng' => null, + 'automaticRadius' => null, + 'exhaustiveFacetsCount' => null, + 'exhaustiveNbHits' => null, + 'exhaustiveTypo' => null, + 'facets' => null, + 'facetsStats' => null, + 'hitsPerPage' => null, + 'index' => null, + 'indexUsed' => null, + 'message' => null, + 'nbHits' => null, + 'nbPages' => null, + 'nbSortedHits' => null, + 'page' => null, + 'params' => null, + 'parsedQuery' => null, + 'processingTimeMS' => null, + 'query' => null, + 'queryAfterRemoval' => null, + 'serverUsed' => null, + 'userData' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abTestID' => 'setAbTestID', + 'abTestVariantID' => 'setAbTestVariantID', + 'aroundLatLng' => 'setAroundLatLng', + 'automaticRadius' => 'setAutomaticRadius', + 'exhaustiveFacetsCount' => 'setExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'setExhaustiveNbHits', + 'exhaustiveTypo' => 'setExhaustiveTypo', + 'facets' => 'setFacets', + 'facetsStats' => 'setFacetsStats', + 'hitsPerPage' => 'setHitsPerPage', + 'index' => 'setIndex', + 'indexUsed' => 'setIndexUsed', + 'message' => 'setMessage', + 'nbHits' => 'setNbHits', + 'nbPages' => 'setNbPages', + 'nbSortedHits' => 'setNbSortedHits', + 'page' => 'setPage', + 'params' => 'setParams', + 'parsedQuery' => 'setParsedQuery', + 'processingTimeMS' => 'setProcessingTimeMS', + 'query' => 'setQuery', + 'queryAfterRemoval' => 'setQueryAfterRemoval', + 'serverUsed' => 'setServerUsed', + 'userData' => 'setUserData', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abTestID' => 'getAbTestID', + 'abTestVariantID' => 'getAbTestVariantID', + 'aroundLatLng' => 'getAroundLatLng', + 'automaticRadius' => 'getAutomaticRadius', + 'exhaustiveFacetsCount' => 'getExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'getExhaustiveNbHits', + 'exhaustiveTypo' => 'getExhaustiveTypo', + 'facets' => 'getFacets', + 'facetsStats' => 'getFacetsStats', + 'hitsPerPage' => 'getHitsPerPage', + 'index' => 'getIndex', + 'indexUsed' => 'getIndexUsed', + 'message' => 'getMessage', + 'nbHits' => 'getNbHits', + 'nbPages' => 'getNbPages', + 'nbSortedHits' => 'getNbSortedHits', + 'page' => 'getPage', + 'params' => 'getParams', + 'parsedQuery' => 'getParsedQuery', + 'processingTimeMS' => 'getProcessingTimeMS', + 'query' => 'getQuery', + 'queryAfterRemoval' => 'getQueryAfterRemoval', + 'serverUsed' => 'getServerUsed', + 'userData' => 'getUserData', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['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['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['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + 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['nbHits'])) { + $this->container['nbHits'] = $data['nbHits']; + } + if (isset($data['nbPages'])) { + $this->container['nbPages'] = $data['nbPages']; + } + if (isset($data['nbSortedHits'])) { + $this->container['nbSortedHits'] = $data['nbSortedHits']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['params'])) { + $this->container['params'] = $data['params']; + } + if (isset($data['parsedQuery'])) { + $this->container['parsedQuery'] = $data['parsedQuery']; + } + if (isset($data['processingTimeMS'])) { + $this->container['processingTimeMS'] = $data['processingTimeMS']; + } + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['queryAfterRemoval'])) { + $this->container['queryAfterRemoval'] = $data['queryAfterRemoval']; + } + if (isset($data['serverUsed'])) { + $this->container['serverUsed'] = $data['serverUsed']; + } + if (isset($data['userData'])) { + $this->container['userData'] = $data['userData']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (isset($this->container['aroundLatLng']) && !preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $this->container['aroundLatLng'])) { + $invalidProperties[] = "invalid value for 'aroundLatLng', must be conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."; + } + + if (!isset($this->container['exhaustiveNbHits']) || $this->container['exhaustiveNbHits'] === null) { + $invalidProperties[] = "'exhaustiveNbHits' can't be null"; + } + if (!isset($this->container['exhaustiveTypo']) || $this->container['exhaustiveTypo'] === null) { + $invalidProperties[] = "'exhaustiveTypo' can't be null"; + } + if (!isset($this->container['hitsPerPage']) || $this->container['hitsPerPage'] === null) { + $invalidProperties[] = "'hitsPerPage' can't be null"; + } + if (!isset($this->container['nbHits']) || $this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if (!isset($this->container['nbPages']) || $this->container['nbPages'] === null) { + $invalidProperties[] = "'nbPages' can't be null"; + } + if (!isset($this->container['page']) || $this->container['page'] === null) { + $invalidProperties[] = "'page' can't be null"; + } + if (!isset($this->container['params']) || $this->container['params'] === null) { + $invalidProperties[] = "'params' can't be null"; + } + if (!isset($this->container['processingTimeMS']) || $this->container['processingTimeMS'] === null) { + $invalidProperties[] = "'processingTimeMS' can't be null"; + } + if (!isset($this->container['query']) || $this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets abTestID + * + * @return int|null + */ + public function getAbTestID() + { + return $this->container['abTestID'] ?? null; + } + + /** + * Sets abTestID + * + * @param int|null $abTestID if a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets abTestVariantID + * + * @return int|null + */ + public function getAbTestVariantID() + { + return $this->container['abTestVariantID'] ?? null; + } + + /** + * Sets abTestVariantID + * + * @param int|null $abTestVariantID if a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used + * + * @return self + */ + public function setAbTestVariantID($abTestVariantID) + { + $this->container['abTestVariantID'] = $abTestVariantID; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng'] ?? null; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng the computed geo location + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + if (!is_null($aroundLatLng) && (!preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $aroundLatLng))) { + throw new \InvalidArgumentException("invalid value for $aroundLatLng when calling BaseSearchResponse., must conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."); + } + + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets automaticRadius + * + * @return string|null + */ + public function getAutomaticRadius() + { + return $this->container['automaticRadius'] ?? null; + } + + /** + * Sets automaticRadius + * + * @param string|null $automaticRadius The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. + * + * @return self + */ + public function setAutomaticRadius($automaticRadius) + { + $this->container['automaticRadius'] = $automaticRadius; + + return $this; + } + + /** + * Gets exhaustiveFacetsCount + * + * @return bool|null + */ + public function getExhaustiveFacetsCount() + { + return $this->container['exhaustiveFacetsCount'] ?? null; + } + + /** + * Sets exhaustiveFacetsCount + * + * @param bool|null $exhaustiveFacetsCount whether the facet count is exhaustive or approximate + * + * @return self + */ + public function setExhaustiveFacetsCount($exhaustiveFacetsCount) + { + $this->container['exhaustiveFacetsCount'] = $exhaustiveFacetsCount; + + return $this; + } + + /** + * Gets exhaustiveNbHits + * + * @return bool + */ + public function getExhaustiveNbHits() + { + return $this->container['exhaustiveNbHits'] ?? null; + } + + /** + * Sets exhaustiveNbHits + * + * @param bool $exhaustiveNbHits indicate if the nbHits count was exhaustive or approximate + * + * @return self + */ + public function setExhaustiveNbHits($exhaustiveNbHits) + { + $this->container['exhaustiveNbHits'] = $exhaustiveNbHits; + + return $this; + } + + /** + * Gets exhaustiveTypo + * + * @return bool + */ + public function getExhaustiveTypo() + { + return $this->container['exhaustiveTypo'] ?? null; + } + + /** + * Sets exhaustiveTypo + * + * @param bool $exhaustiveTypo indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * + * @return self + */ + public function setExhaustiveTypo($exhaustiveTypo) + { + $this->container['exhaustiveTypo'] = $exhaustiveTypo; + + return $this; + } + + /** + * Gets facets + * + * @return array>|null + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets + * + * @param array>|null $facets a mapping of each facet name to the corresponding facet counts + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets facetsStats + * + * @return array|null + */ + public function getFacetsStats() + { + return $this->container['facetsStats'] ?? null; + } + + /** + * Sets facetsStats + * + * @param array|null $facetsStats statistics for numerical facets + * + * @return self + */ + public function setFacetsStats($facetsStats) + { + $this->container['facetsStats'] = $facetsStats; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets index + * + * @return string|null + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index + * + * @param string|null $index index name used for the query + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets indexUsed + * + * @return string|null + */ + public function getIndexUsed() + { + return $this->container['indexUsed'] ?? null; + } + + /** + * Sets indexUsed + * + * @param string|null $indexUsed Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. + * + * @return self + */ + public function setIndexUsed($indexUsed) + { + $this->container['indexUsed'] = $indexUsed; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string|null $message used to return warnings about the query + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits'] ?? null; + } + + /** + * Sets nbHits + * + * @param int $nbHits number of hits that the search query matched + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets nbPages + * + * @return int + */ + public function getNbPages() + { + return $this->container['nbPages'] ?? null; + } + + /** + * Sets nbPages + * + * @param int $nbPages number of pages available for the current query + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + + /** + * Gets nbSortedHits + * + * @return int|null + */ + public function getNbSortedHits() + { + return $this->container['nbSortedHits'] ?? null; + } + + /** + * Sets nbSortedHits + * + * @param int|null $nbSortedHits the number of hits selected and sorted by the relevant sort algorithm + * + * @return self + */ + public function setNbSortedHits($nbSortedHits) + { + $this->container['nbSortedHits'] = $nbSortedHits; + + return $this; + } + + /** + * Gets page + * + * @return int + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets params + * + * @return string + */ + public function getParams() + { + return $this->container['params'] ?? null; + } + + /** + * Sets params + * + * @param string $params a url-encoded string of all search parameters + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets parsedQuery + * + * @return string|null + */ + public function getParsedQuery() + { + return $this->container['parsedQuery'] ?? null; + } + + /** + * Sets parsedQuery + * + * @param string|null $parsedQuery the query string that will be searched, after normalization + * + * @return self + */ + public function setParsedQuery($parsedQuery) + { + $this->container['parsedQuery'] = $parsedQuery; + + return $this; + } + + /** + * Gets processingTimeMS + * + * @return int + */ + public function getProcessingTimeMS() + { + return $this->container['processingTimeMS'] ?? 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 query + * + * @return string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets queryAfterRemoval + * + * @return string|null + */ + public function getQueryAfterRemoval() + { + return $this->container['queryAfterRemoval'] ?? null; + } + + /** + * Sets queryAfterRemoval + * + * @param string|null $queryAfterRemoval a markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set + * + * @return self + */ + public function setQueryAfterRemoval($queryAfterRemoval) + { + $this->container['queryAfterRemoval'] = $queryAfterRemoval; + + return $this; + } + + /** + * Gets serverUsed + * + * @return string|null + */ + public function getServerUsed() + { + return $this->container['serverUsed'] ?? null; + } + + /** + * Sets serverUsed + * + * @param string|null $serverUsed actual host name of the server that processed the request + * + * @return self + */ + public function setServerUsed($serverUsed) + { + $this->container['serverUsed'] = $serverUsed; + + return $this; + } + + /** + * Gets userData + * + * @return object|null + */ + public function getUserData() + { + return $this->container['userData'] ?? null; + } + + /** + * Sets userData + * + * @param object|null $userData lets you store custom data in your indices + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponseFacetsStats.php b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponseFacetsStats.php new file mode 100644 index 0000000000..1a10524142 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseSearchResponseFacetsStats.php @@ -0,0 +1,300 @@ + 'int', + 'max' => 'int', + 'avg' => 'int', + 'sum' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'min' => null, + 'max' => null, + 'avg' => null, + 'sum' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'min' => 'setMin', + 'max' => 'setMax', + 'avg' => 'setAvg', + 'sum' => 'setSum', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'min' => 'getMin', + 'max' => 'getMax', + 'avg' => 'getAvg', + 'sum' => 'getSum', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['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']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets min + * + * @return int|null + */ + public function getMin() + { + return $this->container['min'] ?? null; + } + + /** + * Sets min + * + * @param int|null $min the minimum value in the result set + * + * @return self + */ + public function setMin($min) + { + $this->container['min'] = $min; + + return $this; + } + + /** + * Gets max + * + * @return int|null + */ + public function getMax() + { + return $this->container['max'] ?? null; + } + + /** + * Sets max + * + * @param int|null $max the maximum value in the result set + * + * @return self + */ + public function setMax($max) + { + $this->container['max'] = $max; + + return $this; + } + + /** + * Gets avg + * + * @return int|null + */ + public function getAvg() + { + return $this->container['avg'] ?? null; + } + + /** + * Sets avg + * + * @param int|null $avg the average facet value in the result set + * + * @return self + */ + public function setAvg($avg) + { + $this->container['avg'] = $avg; + + return $this; + } + + /** + * Gets sum + * + * @return int|null + */ + public function getSum() + { + return $this->container['sum'] ?? null; + } + + /** + * Sets sum + * + * @param int|null $sum the sum of all values in the result set + * + * @return self + */ + public function setSum($sum) + { + $this->container['sum'] = $sum; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/BaseTrendingRequest.php b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseTrendingRequest.php new file mode 100644 index 0000000000..307c6c9f0d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/BaseTrendingRequest.php @@ -0,0 +1,273 @@ + '\Algolia\AlgoliaSearch\Model\Recommend\TrendingModels', + 'facetName' => 'string', + 'facetValue' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'model' => null, + 'facetName' => null, + 'facetValue' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'model' => 'setModel', + 'facetName' => 'setFacetName', + 'facetValue' => 'setFacetValue', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'model' => 'getModel', + 'facetName' => 'getFacetName', + 'facetValue' => 'getFacetValue', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['model'])) { + $this->container['model'] = $data['model']; + } + if (isset($data['facetName'])) { + $this->container['facetName'] = $data['facetName']; + } + if (isset($data['facetValue'])) { + $this->container['facetValue'] = $data['facetValue']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['model']) || $this->container['model'] === null) { + $invalidProperties[] = "'model' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets model + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\TrendingModels + */ + public function getModel() + { + return $this->container['model'] ?? null; + } + + /** + * Sets model + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\TrendingModels $model model + * + * @return self + */ + public function setModel($model) + { + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets facetName + * + * @return string|null + */ + public function getFacetName() + { + return $this->container['facetName'] ?? null; + } + + /** + * Sets facetName + * + * @param string|null $facetName the facet name to use for trending models + * + * @return self + */ + public function setFacetName($facetName) + { + $this->container['facetName'] = $facetName; + + return $this; + } + + /** + * Gets facetValue + * + * @return string|null + */ + public function getFacetValue() + { + return $this->container['facetValue'] ?? null; + } + + /** + * Sets facetValue + * + * @param string|null $facetValue the facet value to use for trending models + * + * @return self + */ + public function setFacetValue($facetValue) + { + $this->container['facetValue'] = $facetValue; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/ErrorBase.php b/clients/algoliasearch-client-php/lib/Model/Recommend/ErrorBase.php new file mode 100644 index 0000000000..30c5f12efc --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/ErrorBase.php @@ -0,0 +1,209 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['message'])) { + $this->container['message'] = $data['message']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/GetRecommendationsParams.php b/clients/algoliasearch-client-php/lib/Model/Recommend/GetRecommendationsParams.php new file mode 100644 index 0000000000..b3a16b66fd --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/GetRecommendationsParams.php @@ -0,0 +1,213 @@ + '\Algolia\AlgoliaSearch\Model\Recommend\RecommendationsRequest[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'requests' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['requests'])) { + $this->container['requests'] = $data['requests']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['requests']) || $this->container['requests'] === null) { + $invalidProperties[] = "'requests' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets requests + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\RecommendationsRequest[] + */ + public function getRequests() + { + return $this->container['requests'] ?? null; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\RecommendationsRequest[] $requests the `getRecommendations` requests + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/GetRecommendationsResponse.php b/clients/algoliasearch-client-php/lib/Model/Recommend/GetRecommendationsResponse.php new file mode 100644 index 0000000000..d4389b7615 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/GetRecommendationsResponse.php @@ -0,0 +1,207 @@ + '\Algolia\AlgoliaSearch\Model\Recommend\RecommendationsResponse[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'results' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['results'])) { + $this->container['results'] = $data['results']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets results + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\RecommendationsResponse[]|null + */ + public function getResults() + { + return $this->container['results'] ?? null; + } + + /** + * Sets results + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\RecommendationsResponse[]|null $results results + * + * @return self + */ + public function setResults($results) + { + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/HighlightResult.php b/clients/algoliasearch-client-php/lib/Model/Recommend/HighlightResult.php new file mode 100644 index 0000000000..38d3f5f2b3 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/HighlightResult.php @@ -0,0 +1,339 @@ + 'string', + 'matchLevel' => 'string', + '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 property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'matchLevel' => 'setMatchLevel', + 'matchedWords' => 'setMatchedWords', + 'fullyHighlighted' => 'setFullyHighlighted', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'matchLevel' => 'getMatchLevel', + 'matchedWords' => 'getMatchedWords', + 'fullyHighlighted' => 'getFullyHighlighted', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + const MATCH_LEVEL_NONE = 'none'; + const MATCH_LEVEL_PARTIAL = 'partial'; + const MATCH_LEVEL_FULL = 'full'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMatchLevelAllowableValues() + { + return [ + self::MATCH_LEVEL_NONE, + self::MATCH_LEVEL_PARTIAL, + self::MATCH_LEVEL_FULL, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + 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']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMatchLevelAllowableValues(); + if (isset($this->container['matchLevel']) && !in_array($this->container['matchLevel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'matchLevel', must be one of '%s'", + $this->container['matchLevel'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value + * + * @param string|null $value markup text with occurrences highlighted + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matchLevel + * + * @return string|null + */ + public function getMatchLevel() + { + return $this->container['matchLevel'] ?? null; + } + + /** + * Sets matchLevel + * + * @param string|null $matchLevel indicates how well the attribute matched the search query + * + * @return self + */ + public function setMatchLevel($matchLevel) + { + $allowedValues = $this->getMatchLevelAllowableValues(); + if (!is_null($matchLevel) && !in_array($matchLevel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'matchLevel', must be one of '%s'", + $matchLevel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['matchLevel'] = $matchLevel; + + return $this; + } + + /** + * Gets matchedWords + * + * @return string[]|null + */ + public function getMatchedWords() + { + return $this->container['matchedWords'] ?? null; + } + + /** + * Sets matchedWords + * + * @param string[]|null $matchedWords list of words from the query that matched the object + * + * @return self + */ + public function setMatchedWords($matchedWords) + { + $this->container['matchedWords'] = $matchedWords; + + return $this; + } + + /** + * Gets fullyHighlighted + * + * @return bool|null + */ + public function getFullyHighlighted() + { + return $this->container['fullyHighlighted'] ?? null; + } + + /** + * Sets fullyHighlighted + * + * @param bool|null $fullyHighlighted whether the entire attribute value is highlighted + * + * @return self + */ + public function setFullyHighlighted($fullyHighlighted) + { + $this->container['fullyHighlighted'] = $fullyHighlighted; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/IndexSettingsAsSearchParams.php b/clients/algoliasearch-client-php/lib/Model/Recommend/IndexSettingsAsSearchParams.php new file mode 100644 index 0000000000..ea7d679dfa --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/IndexSettingsAsSearchParams.php @@ -0,0 +1,1777 @@ + 'string[]', + 'attributesForFaceting' => 'string[]', + 'unretrievableAttributes' => 'string[]', + 'attributesToRetrieve' => 'string[]', + 'restrictSearchableAttributes' => 'string[]', + 'ranking' => 'string[]', + 'customRanking' => 'string[]', + 'relevancyStrictness' => 'int', + 'attributesToHighlight' => 'string[]', + 'attributesToSnippet' => 'string[]', + 'highlightPreTag' => 'string', + 'highlightPostTag' => 'string', + 'snippetEllipsisText' => 'string', + 'restrictHighlightAndSnippetArrays' => 'bool', + 'hitsPerPage' => 'int', + 'minWordSizefor1Typo' => 'int', + 'minWordSizefor2Typos' => 'int', + 'typoTolerance' => 'string', + 'allowTyposOnNumericTokens' => 'bool', + 'disableTypoToleranceOnAttributes' => 'string[]', + 'separatorsToIndex' => 'string', + 'ignorePlurals' => 'string', + 'removeStopWords' => 'string', + 'keepDiacriticsOnCharacters' => 'string', + 'queryLanguages' => 'string[]', + 'decompoundQuery' => 'bool', + 'enableRules' => 'bool', + 'enablePersonalization' => 'bool', + 'queryType' => 'string', + 'removeWordsIfNoResults' => 'string', + 'advancedSyntax' => 'bool', + 'optionalWords' => 'string[]', + 'disableExactOnAttributes' => 'string[]', + 'exactOnSingleWordQuery' => 'string', + 'alternativesAsExact' => 'string[]', + 'advancedSyntaxFeatures' => 'string[]', + 'distinct' => 'int', + 'synonyms' => 'bool', + 'replaceSynonymsInHighlight' => 'bool', + 'minProximity' => 'int', + 'responseFields' => 'string[]', + 'maxFacetHits' => 'int', + 'attributeCriteriaComputedByMinProximity' => 'bool', + 'renderingContent' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'searchableAttributes' => null, + 'attributesForFaceting' => null, + 'unretrievableAttributes' => null, + 'attributesToRetrieve' => null, + 'restrictSearchableAttributes' => null, + 'ranking' => null, + 'customRanking' => null, + 'relevancyStrictness' => null, + 'attributesToHighlight' => null, + 'attributesToSnippet' => null, + 'highlightPreTag' => null, + 'highlightPostTag' => null, + 'snippetEllipsisText' => null, + 'restrictHighlightAndSnippetArrays' => null, + 'hitsPerPage' => null, + 'minWordSizefor1Typo' => null, + 'minWordSizefor2Typos' => null, + 'typoTolerance' => null, + 'allowTyposOnNumericTokens' => null, + 'disableTypoToleranceOnAttributes' => null, + 'separatorsToIndex' => null, + 'ignorePlurals' => null, + 'removeStopWords' => null, + 'keepDiacriticsOnCharacters' => null, + 'queryLanguages' => null, + 'decompoundQuery' => null, + 'enableRules' => null, + 'enablePersonalization' => null, + 'queryType' => null, + 'removeWordsIfNoResults' => null, + 'advancedSyntax' => null, + 'optionalWords' => null, + 'disableExactOnAttributes' => null, + 'exactOnSingleWordQuery' => null, + 'alternativesAsExact' => null, + 'advancedSyntaxFeatures' => null, + 'distinct' => null, + 'synonyms' => null, + 'replaceSynonymsInHighlight' => null, + 'minProximity' => null, + 'responseFields' => null, + 'maxFacetHits' => null, + 'attributeCriteriaComputedByMinProximity' => null, + 'renderingContent' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'searchableAttributes' => 'setSearchableAttributes', + 'attributesForFaceting' => 'setAttributesForFaceting', + 'unretrievableAttributes' => 'setUnretrievableAttributes', + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'restrictSearchableAttributes' => 'setRestrictSearchableAttributes', + 'ranking' => 'setRanking', + 'customRanking' => 'setCustomRanking', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'attributesToHighlight' => 'setAttributesToHighlight', + 'attributesToSnippet' => 'setAttributesToSnippet', + 'highlightPreTag' => 'setHighlightPreTag', + 'highlightPostTag' => 'setHighlightPostTag', + 'snippetEllipsisText' => 'setSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'setRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'setHitsPerPage', + 'minWordSizefor1Typo' => 'setMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'setMinWordSizefor2Typos', + 'typoTolerance' => 'setTypoTolerance', + 'allowTyposOnNumericTokens' => 'setAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'setDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'setSeparatorsToIndex', + 'ignorePlurals' => 'setIgnorePlurals', + 'removeStopWords' => 'setRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'setKeepDiacriticsOnCharacters', + 'queryLanguages' => 'setQueryLanguages', + 'decompoundQuery' => 'setDecompoundQuery', + 'enableRules' => 'setEnableRules', + 'enablePersonalization' => 'setEnablePersonalization', + 'queryType' => 'setQueryType', + 'removeWordsIfNoResults' => 'setRemoveWordsIfNoResults', + 'advancedSyntax' => 'setAdvancedSyntax', + 'optionalWords' => 'setOptionalWords', + 'disableExactOnAttributes' => 'setDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'setExactOnSingleWordQuery', + 'alternativesAsExact' => 'setAlternativesAsExact', + 'advancedSyntaxFeatures' => 'setAdvancedSyntaxFeatures', + 'distinct' => 'setDistinct', + 'synonyms' => 'setSynonyms', + 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', + 'minProximity' => 'setMinProximity', + 'responseFields' => 'setResponseFields', + 'maxFacetHits' => 'setMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'setRenderingContent', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'searchableAttributes' => 'getSearchableAttributes', + 'attributesForFaceting' => 'getAttributesForFaceting', + 'unretrievableAttributes' => 'getUnretrievableAttributes', + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'restrictSearchableAttributes' => 'getRestrictSearchableAttributes', + 'ranking' => 'getRanking', + 'customRanking' => 'getCustomRanking', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'attributesToHighlight' => 'getAttributesToHighlight', + 'attributesToSnippet' => 'getAttributesToSnippet', + 'highlightPreTag' => 'getHighlightPreTag', + 'highlightPostTag' => 'getHighlightPostTag', + 'snippetEllipsisText' => 'getSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'getRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'getHitsPerPage', + 'minWordSizefor1Typo' => 'getMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'getMinWordSizefor2Typos', + 'typoTolerance' => 'getTypoTolerance', + 'allowTyposOnNumericTokens' => 'getAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'getDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'getSeparatorsToIndex', + 'ignorePlurals' => 'getIgnorePlurals', + 'removeStopWords' => 'getRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'getKeepDiacriticsOnCharacters', + 'queryLanguages' => 'getQueryLanguages', + 'decompoundQuery' => 'getDecompoundQuery', + 'enableRules' => 'getEnableRules', + 'enablePersonalization' => 'getEnablePersonalization', + 'queryType' => 'getQueryType', + 'removeWordsIfNoResults' => 'getRemoveWordsIfNoResults', + 'advancedSyntax' => 'getAdvancedSyntax', + 'optionalWords' => 'getOptionalWords', + 'disableExactOnAttributes' => 'getDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'getExactOnSingleWordQuery', + 'alternativesAsExact' => 'getAlternativesAsExact', + 'advancedSyntaxFeatures' => 'getAdvancedSyntaxFeatures', + 'distinct' => 'getDistinct', + 'synonyms' => 'getSynonyms', + 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', + 'minProximity' => 'getMinProximity', + 'responseFields' => 'getResponseFields', + 'maxFacetHits' => 'getMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'getRenderingContent', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + const TYPO_TOLERANCE_TRUE = 'true'; + const TYPO_TOLERANCE_FALSE = 'false'; + const TYPO_TOLERANCE_MIN = 'min'; + const TYPO_TOLERANCE_STRICT = 'strict'; + const QUERY_TYPE_PREFIX_LAST = 'prefixLast'; + const QUERY_TYPE_PREFIX_ALL = 'prefixAll'; + const QUERY_TYPE_PREFIX_NONE = 'prefixNone'; + const REMOVE_WORDS_IF_NO_RESULTS_NONE = 'none'; + const REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS = 'lastWords'; + const REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS = 'firstWords'; + const REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL = 'allOptional'; + const EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE = 'attribute'; + const EXACT_ON_SINGLE_WORD_QUERY_NONE = 'none'; + const EXACT_ON_SINGLE_WORD_QUERY_WORD = 'word'; + const ALTERNATIVES_AS_EXACT_IGNORE_PLURALS = 'ignorePlurals'; + const ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM = 'singleWordSynonym'; + const ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM = 'multiWordsSynonym'; + const ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE = 'exactPhrase'; + const ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS = 'excludeWords'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypoToleranceAllowableValues() + { + return [ + self::TYPO_TOLERANCE_TRUE, + self::TYPO_TOLERANCE_FALSE, + self::TYPO_TOLERANCE_MIN, + self::TYPO_TOLERANCE_STRICT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getQueryTypeAllowableValues() + { + return [ + self::QUERY_TYPE_PREFIX_LAST, + self::QUERY_TYPE_PREFIX_ALL, + self::QUERY_TYPE_PREFIX_NONE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemoveWordsIfNoResultsAllowableValues() + { + return [ + self::REMOVE_WORDS_IF_NO_RESULTS_NONE, + self::REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExactOnSingleWordQueryAllowableValues() + { + return [ + self::EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE, + self::EXACT_ON_SINGLE_WORD_QUERY_NONE, + self::EXACT_ON_SINGLE_WORD_QUERY_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAlternativesAsExactAllowableValues() + { + return [ + self::ALTERNATIVES_AS_EXACT_IGNORE_PLURALS, + self::ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM, + self::ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdvancedSyntaxFeaturesAllowableValues() + { + return [ + self::ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE, + self::ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['searchableAttributes'])) { + $this->container['searchableAttributes'] = $data['searchableAttributes']; + } + if (isset($data['attributesForFaceting'])) { + $this->container['attributesForFaceting'] = $data['attributesForFaceting']; + } + if (isset($data['unretrievableAttributes'])) { + $this->container['unretrievableAttributes'] = $data['unretrievableAttributes']; + } + if (isset($data['attributesToRetrieve'])) { + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; + } + if (isset($data['restrictSearchableAttributes'])) { + $this->container['restrictSearchableAttributes'] = $data['restrictSearchableAttributes']; + } + if (isset($data['ranking'])) { + $this->container['ranking'] = $data['ranking']; + } + if (isset($data['customRanking'])) { + $this->container['customRanking'] = $data['customRanking']; + } + if (isset($data['relevancyStrictness'])) { + $this->container['relevancyStrictness'] = $data['relevancyStrictness']; + } + if (isset($data['attributesToHighlight'])) { + $this->container['attributesToHighlight'] = $data['attributesToHighlight']; + } + if (isset($data['attributesToSnippet'])) { + $this->container['attributesToSnippet'] = $data['attributesToSnippet']; + } + if (isset($data['highlightPreTag'])) { + $this->container['highlightPreTag'] = $data['highlightPreTag']; + } + if (isset($data['highlightPostTag'])) { + $this->container['highlightPostTag'] = $data['highlightPostTag']; + } + if (isset($data['snippetEllipsisText'])) { + $this->container['snippetEllipsisText'] = $data['snippetEllipsisText']; + } + if (isset($data['restrictHighlightAndSnippetArrays'])) { + $this->container['restrictHighlightAndSnippetArrays'] = $data['restrictHighlightAndSnippetArrays']; + } + if (isset($data['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + if (isset($data['minWordSizefor1Typo'])) { + $this->container['minWordSizefor1Typo'] = $data['minWordSizefor1Typo']; + } + if (isset($data['minWordSizefor2Typos'])) { + $this->container['minWordSizefor2Typos'] = $data['minWordSizefor2Typos']; + } + if (isset($data['typoTolerance'])) { + $this->container['typoTolerance'] = $data['typoTolerance']; + } + if (isset($data['allowTyposOnNumericTokens'])) { + $this->container['allowTyposOnNumericTokens'] = $data['allowTyposOnNumericTokens']; + } + if (isset($data['disableTypoToleranceOnAttributes'])) { + $this->container['disableTypoToleranceOnAttributes'] = $data['disableTypoToleranceOnAttributes']; + } + if (isset($data['separatorsToIndex'])) { + $this->container['separatorsToIndex'] = $data['separatorsToIndex']; + } + if (isset($data['ignorePlurals'])) { + $this->container['ignorePlurals'] = $data['ignorePlurals']; + } + if (isset($data['removeStopWords'])) { + $this->container['removeStopWords'] = $data['removeStopWords']; + } + if (isset($data['keepDiacriticsOnCharacters'])) { + $this->container['keepDiacriticsOnCharacters'] = $data['keepDiacriticsOnCharacters']; + } + if (isset($data['queryLanguages'])) { + $this->container['queryLanguages'] = $data['queryLanguages']; + } + if (isset($data['decompoundQuery'])) { + $this->container['decompoundQuery'] = $data['decompoundQuery']; + } + if (isset($data['enableRules'])) { + $this->container['enableRules'] = $data['enableRules']; + } + if (isset($data['enablePersonalization'])) { + $this->container['enablePersonalization'] = $data['enablePersonalization']; + } + if (isset($data['queryType'])) { + $this->container['queryType'] = $data['queryType']; + } + if (isset($data['removeWordsIfNoResults'])) { + $this->container['removeWordsIfNoResults'] = $data['removeWordsIfNoResults']; + } + if (isset($data['advancedSyntax'])) { + $this->container['advancedSyntax'] = $data['advancedSyntax']; + } + if (isset($data['optionalWords'])) { + $this->container['optionalWords'] = $data['optionalWords']; + } + if (isset($data['disableExactOnAttributes'])) { + $this->container['disableExactOnAttributes'] = $data['disableExactOnAttributes']; + } + if (isset($data['exactOnSingleWordQuery'])) { + $this->container['exactOnSingleWordQuery'] = $data['exactOnSingleWordQuery']; + } + if (isset($data['alternativesAsExact'])) { + $this->container['alternativesAsExact'] = $data['alternativesAsExact']; + } + if (isset($data['advancedSyntaxFeatures'])) { + $this->container['advancedSyntaxFeatures'] = $data['advancedSyntaxFeatures']; + } + if (isset($data['distinct'])) { + $this->container['distinct'] = $data['distinct']; + } + if (isset($data['synonyms'])) { + $this->container['synonyms'] = $data['synonyms']; + } + if (isset($data['replaceSynonymsInHighlight'])) { + $this->container['replaceSynonymsInHighlight'] = $data['replaceSynonymsInHighlight']; + } + if (isset($data['minProximity'])) { + $this->container['minProximity'] = $data['minProximity']; + } + if (isset($data['responseFields'])) { + $this->container['responseFields'] = $data['responseFields']; + } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } + if (isset($data['attributeCriteriaComputedByMinProximity'])) { + $this->container['attributeCriteriaComputedByMinProximity'] = $data['attributeCriteriaComputedByMinProximity']; + } + if (isset($data['renderingContent'])) { + $this->container['renderingContent'] = $data['renderingContent']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (isset($this->container['typoTolerance']) && !in_array($this->container['typoTolerance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'typoTolerance', must be one of '%s'", + $this->container['typoTolerance'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getQueryTypeAllowableValues(); + if (isset($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'queryType', must be one of '%s'", + $this->container['queryType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (isset($this->container['removeWordsIfNoResults']) && !in_array($this->container['removeWordsIfNoResults'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $this->container['removeWordsIfNoResults'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (isset($this->container['exactOnSingleWordQuery']) && !in_array($this->container['exactOnSingleWordQuery'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $this->container['exactOnSingleWordQuery'], + implode("', '", $allowedValues) + ); + } + + if (isset($this->container['distinct']) && ($this->container['distinct'] > 4)) { + $invalidProperties[] = "invalid value for 'distinct', must be smaller than or equal to 4."; + } + + if (isset($this->container['distinct']) && ($this->container['distinct'] < 0)) { + $invalidProperties[] = "invalid value for 'distinct', must be bigger than or equal to 0."; + } + + if (isset($this->container['minProximity']) && ($this->container['minProximity'] > 7)) { + $invalidProperties[] = "invalid value for 'minProximity', must be smaller than or equal to 7."; + } + + if (isset($this->container['minProximity']) && ($this->container['minProximity'] < 1)) { + $invalidProperties[] = "invalid value for 'minProximity', must be bigger than or equal to 1."; + } + + if (isset($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets searchableAttributes + * + * @return string[]|null + */ + public function getSearchableAttributes() + { + return $this->container['searchableAttributes'] ?? null; + } + + /** + * Sets searchableAttributes + * + * @param string[]|null $searchableAttributes the complete list of attributes used for searching + * + * @return self + */ + public function setSearchableAttributes($searchableAttributes) + { + $this->container['searchableAttributes'] = $searchableAttributes; + + return $this; + } + + /** + * Gets attributesForFaceting + * + * @return string[]|null + */ + public function getAttributesForFaceting() + { + return $this->container['attributesForFaceting'] ?? null; + } + + /** + * Sets attributesForFaceting + * + * @param string[]|null $attributesForFaceting the complete list of attributes that will be used for faceting + * + * @return self + */ + public function setAttributesForFaceting($attributesForFaceting) + { + $this->container['attributesForFaceting'] = $attributesForFaceting; + + return $this; + } + + /** + * Gets unretrievableAttributes + * + * @return string[]|null + */ + public function getUnretrievableAttributes() + { + return $this->container['unretrievableAttributes'] ?? null; + } + + /** + * Sets unretrievableAttributes + * + * @param string[]|null $unretrievableAttributes list of attributes that can't be retrieved at query time + * + * @return self + */ + public function setUnretrievableAttributes($unretrievableAttributes) + { + $this->container['unretrievableAttributes'] = $unretrievableAttributes; + + return $this; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve'] ?? null; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve this parameter controls which attributes to retrieve and which not to retrieve + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets restrictSearchableAttributes + * + * @return string[]|null + */ + public function getRestrictSearchableAttributes() + { + return $this->container['restrictSearchableAttributes'] ?? null; + } + + /** + * Sets restrictSearchableAttributes + * + * @param string[]|null $restrictSearchableAttributes restricts a given query to look in only a subset of your searchable attributes + * + * @return self + */ + public function setRestrictSearchableAttributes($restrictSearchableAttributes) + { + $this->container['restrictSearchableAttributes'] = $restrictSearchableAttributes; + + return $this; + } + + /** + * Gets ranking + * + * @return string[]|null + */ + public function getRanking() + { + return $this->container['ranking'] ?? null; + } + + /** + * Sets ranking + * + * @param string[]|null $ranking controls how Algolia should sort your results + * + * @return self + */ + public function setRanking($ranking) + { + $this->container['ranking'] = $ranking; + + return $this; + } + + /** + * Gets customRanking + * + * @return string[]|null + */ + public function getCustomRanking() + { + return $this->container['customRanking'] ?? null; + } + + /** + * Sets customRanking + * + * @param string[]|null $customRanking specifies the custom ranking criterion + * + * @return self + */ + public function setCustomRanking($customRanking) + { + $this->container['customRanking'] = $customRanking; + + return $this; + } + + /** + * Gets relevancyStrictness + * + * @return int|null + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness'] ?? null; + } + + /** + * Sets relevancyStrictness + * + * @param int|null $relevancyStrictness controls the relevancy threshold below which less relevant results aren't included in the results + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets attributesToHighlight + * + * @return string[]|null + */ + public function getAttributesToHighlight() + { + return $this->container['attributesToHighlight'] ?? null; + } + + /** + * Sets attributesToHighlight + * + * @param string[]|null $attributesToHighlight list of attributes to highlight + * + * @return self + */ + public function setAttributesToHighlight($attributesToHighlight) + { + $this->container['attributesToHighlight'] = $attributesToHighlight; + + return $this; + } + + /** + * Gets attributesToSnippet + * + * @return string[]|null + */ + public function getAttributesToSnippet() + { + return $this->container['attributesToSnippet'] ?? null; + } + + /** + * Sets attributesToSnippet + * + * @param string[]|null $attributesToSnippet list of attributes to snippet, with an optional maximum number of words to snippet + * + * @return self + */ + public function setAttributesToSnippet($attributesToSnippet) + { + $this->container['attributesToSnippet'] = $attributesToSnippet; + + return $this; + } + + /** + * Gets highlightPreTag + * + * @return string|null + */ + public function getHighlightPreTag() + { + return $this->container['highlightPreTag'] ?? null; + } + + /** + * Sets highlightPreTag + * + * @param string|null $highlightPreTag the HTML string to insert before the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPreTag($highlightPreTag) + { + $this->container['highlightPreTag'] = $highlightPreTag; + + return $this; + } + + /** + * Gets highlightPostTag + * + * @return string|null + */ + public function getHighlightPostTag() + { + return $this->container['highlightPostTag'] ?? null; + } + + /** + * Sets highlightPostTag + * + * @param string|null $highlightPostTag the HTML string to insert after the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPostTag($highlightPostTag) + { + $this->container['highlightPostTag'] = $highlightPostTag; + + return $this; + } + + /** + * Gets snippetEllipsisText + * + * @return string|null + */ + public function getSnippetEllipsisText() + { + return $this->container['snippetEllipsisText'] ?? null; + } + + /** + * Sets snippetEllipsisText + * + * @param string|null $snippetEllipsisText string used as an ellipsis indicator when a snippet is truncated + * + * @return self + */ + public function setSnippetEllipsisText($snippetEllipsisText) + { + $this->container['snippetEllipsisText'] = $snippetEllipsisText; + + return $this; + } + + /** + * Gets restrictHighlightAndSnippetArrays + * + * @return bool|null + */ + public function getRestrictHighlightAndSnippetArrays() + { + return $this->container['restrictHighlightAndSnippetArrays'] ?? null; + } + + /** + * Sets restrictHighlightAndSnippetArrays + * + * @param bool|null $restrictHighlightAndSnippetArrays restrict highlighting and snippeting to items that matched the query + * + * @return self + */ + public function setRestrictHighlightAndSnippetArrays($restrictHighlightAndSnippetArrays) + { + $this->container['restrictHighlightAndSnippetArrays'] = $restrictHighlightAndSnippetArrays; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets minWordSizefor1Typo + * + * @return int|null + */ + public function getMinWordSizefor1Typo() + { + return $this->container['minWordSizefor1Typo'] ?? null; + } + + /** + * Sets minWordSizefor1Typo + * + * @param int|null $minWordSizefor1Typo minimum number of characters a word in the query string must contain to accept matches with 1 typo + * + * @return self + */ + public function setMinWordSizefor1Typo($minWordSizefor1Typo) + { + $this->container['minWordSizefor1Typo'] = $minWordSizefor1Typo; + + return $this; + } + + /** + * Gets minWordSizefor2Typos + * + * @return int|null + */ + public function getMinWordSizefor2Typos() + { + return $this->container['minWordSizefor2Typos'] ?? null; + } + + /** + * Sets minWordSizefor2Typos + * + * @param int|null $minWordSizefor2Typos minimum number of characters a word in the query string must contain to accept matches with 2 typos + * + * @return self + */ + public function setMinWordSizefor2Typos($minWordSizefor2Typos) + { + $this->container['minWordSizefor2Typos'] = $minWordSizefor2Typos; + + return $this; + } + + /** + * Gets typoTolerance + * + * @return string|null + */ + public function getTypoTolerance() + { + return $this->container['typoTolerance'] ?? null; + } + + /** + * Sets typoTolerance + * + * @param string|null $typoTolerance controls whether typo tolerance is enabled and how it is applied + * + * @return self + */ + public function setTypoTolerance($typoTolerance) + { + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($typoTolerance) && !in_array($typoTolerance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'typoTolerance', must be one of '%s'", + $typoTolerance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['typoTolerance'] = $typoTolerance; + + return $this; + } + + /** + * Gets allowTyposOnNumericTokens + * + * @return bool|null + */ + public function getAllowTyposOnNumericTokens() + { + return $this->container['allowTyposOnNumericTokens'] ?? null; + } + + /** + * Sets allowTyposOnNumericTokens + * + * @param bool|null $allowTyposOnNumericTokens whether to allow typos on numbers (\"numeric tokens\") in the query string + * + * @return self + */ + public function setAllowTyposOnNumericTokens($allowTyposOnNumericTokens) + { + $this->container['allowTyposOnNumericTokens'] = $allowTyposOnNumericTokens; + + return $this; + } + + /** + * Gets disableTypoToleranceOnAttributes + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnAttributes() + { + return $this->container['disableTypoToleranceOnAttributes'] ?? null; + } + + /** + * Sets disableTypoToleranceOnAttributes + * + * @param string[]|null $disableTypoToleranceOnAttributes list of attributes on which you want to disable typo tolerance + * + * @return self + */ + public function setDisableTypoToleranceOnAttributes($disableTypoToleranceOnAttributes) + { + $this->container['disableTypoToleranceOnAttributes'] = $disableTypoToleranceOnAttributes; + + return $this; + } + + /** + * Gets separatorsToIndex + * + * @return string|null + */ + public function getSeparatorsToIndex() + { + return $this->container['separatorsToIndex'] ?? null; + } + + /** + * Sets separatorsToIndex + * + * @param string|null $separatorsToIndex control which separators are indexed + * + * @return self + */ + public function setSeparatorsToIndex($separatorsToIndex) + { + $this->container['separatorsToIndex'] = $separatorsToIndex; + + return $this; + } + + /** + * Gets ignorePlurals + * + * @return string|null + */ + public function getIgnorePlurals() + { + return $this->container['ignorePlurals'] ?? null; + } + + /** + * Sets ignorePlurals + * + * @param string|null $ignorePlurals treats singular, plurals, and other forms of declensions as matching terms + * + * @return self + */ + public function setIgnorePlurals($ignorePlurals) + { + $this->container['ignorePlurals'] = $ignorePlurals; + + return $this; + } + + /** + * Gets removeStopWords + * + * @return string|null + */ + public function getRemoveStopWords() + { + return $this->container['removeStopWords'] ?? null; + } + + /** + * Sets removeStopWords + * + * @param string|null $removeStopWords removes stop (common) words from the query before executing it + * + * @return self + */ + public function setRemoveStopWords($removeStopWords) + { + $this->container['removeStopWords'] = $removeStopWords; + + return $this; + } + + /** + * Gets keepDiacriticsOnCharacters + * + * @return string|null + */ + public function getKeepDiacriticsOnCharacters() + { + return $this->container['keepDiacriticsOnCharacters'] ?? null; + } + + /** + * Sets keepDiacriticsOnCharacters + * + * @param string|null $keepDiacriticsOnCharacters list of characters that the engine shouldn't automatically normalize + * + * @return self + */ + public function setKeepDiacriticsOnCharacters($keepDiacriticsOnCharacters) + { + $this->container['keepDiacriticsOnCharacters'] = $keepDiacriticsOnCharacters; + + return $this; + } + + /** + * Gets queryLanguages + * + * @return string[]|null + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages'] ?? null; + } + + /** + * Sets queryLanguages + * + * @param string[]|null $queryLanguages sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets decompoundQuery + * + * @return bool|null + */ + public function getDecompoundQuery() + { + return $this->container['decompoundQuery'] ?? null; + } + + /** + * Sets decompoundQuery + * + * @param bool|null $decompoundQuery splits compound words into their composing atoms in the query + * + * @return self + */ + public function setDecompoundQuery($decompoundQuery) + { + $this->container['decompoundQuery'] = $decompoundQuery; + + return $this; + } + + /** + * Gets enableRules + * + * @return bool|null + */ + public function getEnableRules() + { + return $this->container['enableRules'] ?? null; + } + + /** + * Sets enableRules + * + * @param bool|null $enableRules whether Rules should be globally enabled + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets enablePersonalization + * + * @return bool|null + */ + public function getEnablePersonalization() + { + return $this->container['enablePersonalization'] ?? null; + } + + /** + * Sets enablePersonalization + * + * @param bool|null $enablePersonalization enable the Personalization feature + * + * @return self + */ + public function setEnablePersonalization($enablePersonalization) + { + $this->container['enablePersonalization'] = $enablePersonalization; + + return $this; + } + + /** + * Gets queryType + * + * @return string|null + */ + public function getQueryType() + { + return $this->container['queryType'] ?? null; + } + + /** + * Sets queryType + * + * @param string|null $queryType controls if and how query words are interpreted as prefixes + * + * @return self + */ + public function setQueryType($queryType) + { + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($queryType) && !in_array($queryType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'queryType', must be one of '%s'", + $queryType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['queryType'] = $queryType; + + return $this; + } + + /** + * Gets removeWordsIfNoResults + * + * @return string|null + */ + public function getRemoveWordsIfNoResults() + { + return $this->container['removeWordsIfNoResults'] ?? null; + } + + /** + * Sets removeWordsIfNoResults + * + * @param string|null $removeWordsIfNoResults selects a strategy to remove words from the query when it doesn't match any hits + * + * @return self + */ + public function setRemoveWordsIfNoResults($removeWordsIfNoResults) + { + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($removeWordsIfNoResults) && !in_array($removeWordsIfNoResults, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $removeWordsIfNoResults, + implode("', '", $allowedValues) + ) + ); + } + $this->container['removeWordsIfNoResults'] = $removeWordsIfNoResults; + + return $this; + } + + /** + * Gets advancedSyntax + * + * @return bool|null + */ + public function getAdvancedSyntax() + { + return $this->container['advancedSyntax'] ?? null; + } + + /** + * Sets advancedSyntax + * + * @param bool|null $advancedSyntax enables the advanced query syntax + * + * @return self + */ + public function setAdvancedSyntax($advancedSyntax) + { + $this->container['advancedSyntax'] = $advancedSyntax; + + return $this; + } + + /** + * Gets optionalWords + * + * @return string[]|null + */ + public function getOptionalWords() + { + return $this->container['optionalWords'] ?? null; + } + + /** + * Sets optionalWords + * + * @param string[]|null $optionalWords a list of words that should be considered as optional when found in the query + * + * @return self + */ + public function setOptionalWords($optionalWords) + { + $this->container['optionalWords'] = $optionalWords; + + return $this; + } + + /** + * Gets disableExactOnAttributes + * + * @return string[]|null + */ + public function getDisableExactOnAttributes() + { + return $this->container['disableExactOnAttributes'] ?? null; + } + + /** + * Sets disableExactOnAttributes + * + * @param string[]|null $disableExactOnAttributes list of attributes on which you want to disable the exact ranking criterion + * + * @return self + */ + public function setDisableExactOnAttributes($disableExactOnAttributes) + { + $this->container['disableExactOnAttributes'] = $disableExactOnAttributes; + + return $this; + } + + /** + * Gets exactOnSingleWordQuery + * + * @return string|null + */ + public function getExactOnSingleWordQuery() + { + return $this->container['exactOnSingleWordQuery'] ?? null; + } + + /** + * Sets exactOnSingleWordQuery + * + * @param string|null $exactOnSingleWordQuery controls how the exact ranking criterion is computed when the query contains only one word + * + * @return self + */ + public function setExactOnSingleWordQuery($exactOnSingleWordQuery) + { + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($exactOnSingleWordQuery) && !in_array($exactOnSingleWordQuery, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $exactOnSingleWordQuery, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exactOnSingleWordQuery'] = $exactOnSingleWordQuery; + + return $this; + } + + /** + * Gets alternativesAsExact + * + * @return string[]|null + */ + public function getAlternativesAsExact() + { + return $this->container['alternativesAsExact'] ?? null; + } + + /** + * Sets alternativesAsExact + * + * @param string[]|null $alternativesAsExact list of alternatives that should be considered an exact match by the exact ranking criterion + * + * @return self + */ + public function setAlternativesAsExact($alternativesAsExact) + { + $allowedValues = $this->getAlternativesAsExactAllowableValues(); + if (!is_null($alternativesAsExact) && array_diff($alternativesAsExact, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'alternativesAsExact', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['alternativesAsExact'] = $alternativesAsExact; + + return $this; + } + + /** + * Gets advancedSyntaxFeatures + * + * @return string[]|null + */ + public function getAdvancedSyntaxFeatures() + { + return $this->container['advancedSyntaxFeatures'] ?? null; + } + + /** + * Sets advancedSyntaxFeatures + * + * @param string[]|null $advancedSyntaxFeatures allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled + * + * @return self + */ + public function setAdvancedSyntaxFeatures($advancedSyntaxFeatures) + { + $allowedValues = $this->getAdvancedSyntaxFeaturesAllowableValues(); + if (!is_null($advancedSyntaxFeatures) && array_diff($advancedSyntaxFeatures, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'advancedSyntaxFeatures', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['advancedSyntaxFeatures'] = $advancedSyntaxFeatures; + + return $this; + } + + /** + * Gets distinct + * + * @return int|null + */ + public function getDistinct() + { + return $this->container['distinct'] ?? null; + } + + /** + * Sets distinct + * + * @param int|null $distinct enables de-duplication or grouping of results + * + * @return self + */ + public function setDistinct($distinct) + { + if (!is_null($distinct) && ($distinct > 4)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling IndexSettingsAsSearchParams., must be smaller than or equal to 4.'); + } + if (!is_null($distinct) && ($distinct < 0)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling IndexSettingsAsSearchParams., must be bigger than or equal to 0.'); + } + + $this->container['distinct'] = $distinct; + + return $this; + } + + /** + * Gets synonyms + * + * @return bool|null + */ + public function getSynonyms() + { + return $this->container['synonyms'] ?? null; + } + + /** + * Sets synonyms + * + * @param bool|null $synonyms whether to take into account an index's synonyms for a particular search + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets replaceSynonymsInHighlight + * + * @return bool|null + */ + public function getReplaceSynonymsInHighlight() + { + return $this->container['replaceSynonymsInHighlight'] ?? null; + } + + /** + * Sets replaceSynonymsInHighlight + * + * @param bool|null $replaceSynonymsInHighlight whether to highlight and snippet the original word that matches the synonym or the synonym itself + * + * @return self + */ + public function setReplaceSynonymsInHighlight($replaceSynonymsInHighlight) + { + $this->container['replaceSynonymsInHighlight'] = $replaceSynonymsInHighlight; + + return $this; + } + + /** + * Gets minProximity + * + * @return int|null + */ + public function getMinProximity() + { + return $this->container['minProximity'] ?? null; + } + + /** + * Sets minProximity + * + * @param int|null $minProximity precision of the proximity ranking criterion + * + * @return self + */ + public function setMinProximity($minProximity) + { + if (!is_null($minProximity) && ($minProximity > 7)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling IndexSettingsAsSearchParams., must be smaller than or equal to 7.'); + } + if (!is_null($minProximity) && ($minProximity < 1)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling IndexSettingsAsSearchParams., must be bigger than or equal to 1.'); + } + + $this->container['minProximity'] = $minProximity; + + return $this; + } + + /** + * Gets responseFields + * + * @return string[]|null + */ + public function getResponseFields() + { + return $this->container['responseFields'] ?? null; + } + + /** + * Sets responseFields + * + * @param string[]|null $responseFields Choose which fields to return in the API response. This parameters applies to search and browse queries. + * + * @return self + */ + public function setResponseFields($responseFields) + { + $this->container['responseFields'] = $responseFields; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling IndexSettingsAsSearchParams., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets attributeCriteriaComputedByMinProximity + * + * @return bool|null + */ + public function getAttributeCriteriaComputedByMinProximity() + { + return $this->container['attributeCriteriaComputedByMinProximity'] ?? null; + } + + /** + * Sets attributeCriteriaComputedByMinProximity + * + * @param bool|null $attributeCriteriaComputedByMinProximity when attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage + * + * @return self + */ + public function setAttributeCriteriaComputedByMinProximity($attributeCriteriaComputedByMinProximity) + { + $this->container['attributeCriteriaComputedByMinProximity'] = $attributeCriteriaComputedByMinProximity; + + return $this; + } + + /** + * Gets renderingContent + * + * @return object|null + */ + public function getRenderingContent() + { + return $this->container['renderingContent'] ?? null; + } + + /** + * Sets renderingContent + * + * @param object|null $renderingContent Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/ModelInterface.php b/clients/algoliasearch-client-php/lib/Model/Recommend/ModelInterface.php new file mode 100644 index 0000000000..52c4b1d349 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/ModelInterface.php @@ -0,0 +1,54 @@ + 'int', + 'firstMatchedWord' => 'int', + 'geoDistance' => 'int', + 'geoPrecision' => 'int', + 'matchedGeoLocation' => 'array', + 'nbExactWords' => 'int', + 'nbTypos' => 'int', + 'promoted' => 'bool', + 'proximityDistance' => 'int', + 'userScore' => 'int', + 'word' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'filters' => null, + 'firstMatchedWord' => null, + 'geoDistance' => null, + 'geoPrecision' => null, + 'matchedGeoLocation' => null, + 'nbExactWords' => null, + 'nbTypos' => null, + 'promoted' => null, + 'proximityDistance' => null, + 'userScore' => null, + 'word' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'filters' => 'setFilters', + 'firstMatchedWord' => 'setFirstMatchedWord', + 'geoDistance' => 'setGeoDistance', + 'geoPrecision' => 'setGeoPrecision', + 'matchedGeoLocation' => 'setMatchedGeoLocation', + 'nbExactWords' => 'setNbExactWords', + 'nbTypos' => 'setNbTypos', + 'promoted' => 'setPromoted', + 'proximityDistance' => 'setProximityDistance', + 'userScore' => 'setUserScore', + 'word' => 'setWord', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'filters' => 'getFilters', + 'firstMatchedWord' => 'getFirstMatchedWord', + 'geoDistance' => 'getGeoDistance', + 'geoPrecision' => 'getGeoPrecision', + 'matchedGeoLocation' => 'getMatchedGeoLocation', + 'nbExactWords' => 'getNbExactWords', + 'nbTypos' => 'getNbTypos', + 'promoted' => 'getPromoted', + 'proximityDistance' => 'getProximityDistance', + 'userScore' => 'getUserScore', + 'word' => 'getWord', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['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['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['word'])) { + $this->container['word'] = $data['word']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets filters + * + * @return int|null + */ + public function getFilters() + { + return $this->container['filters'] ?? null; + } + + /** + * Sets filters + * + * @param int|null $filters this field is reserved for advanced usage + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets firstMatchedWord + * + * @return int|null + */ + public function getFirstMatchedWord() + { + return $this->container['firstMatchedWord'] ?? null; + } + + /** + * Sets firstMatchedWord + * + * @param int|null $firstMatchedWord position of the most important matched attribute in the attributes to index list + * + * @return self + */ + public function setFirstMatchedWord($firstMatchedWord) + { + $this->container['firstMatchedWord'] = $firstMatchedWord; + + return $this; + } + + /** + * Gets geoDistance + * + * @return int|null + */ + public function getGeoDistance() + { + return $this->container['geoDistance'] ?? null; + } + + /** + * Sets geoDistance + * + * @param int|null $geoDistance distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters) + * + * @return self + */ + public function setGeoDistance($geoDistance) + { + $this->container['geoDistance'] = $geoDistance; + + return $this; + } + + /** + * Gets geoPrecision + * + * @return int|null + */ + public function getGeoPrecision() + { + return $this->container['geoPrecision'] ?? null; + } + + /** + * Sets geoPrecision + * + * @param int|null $geoPrecision precision used when computing the geo distance, in meters + * + * @return self + */ + public function setGeoPrecision($geoPrecision) + { + $this->container['geoPrecision'] = $geoPrecision; + + return $this; + } + + /** + * Gets matchedGeoLocation + * + * @return array|null + */ + public function getMatchedGeoLocation() + { + return $this->container['matchedGeoLocation'] ?? null; + } + + /** + * Sets matchedGeoLocation + * + * @param array|null $matchedGeoLocation matchedGeoLocation + * + * @return self + */ + public function setMatchedGeoLocation($matchedGeoLocation) + { + $this->container['matchedGeoLocation'] = $matchedGeoLocation; + + return $this; + } + + /** + * Gets nbExactWords + * + * @return int|null + */ + public function getNbExactWords() + { + return $this->container['nbExactWords'] ?? null; + } + + /** + * Sets nbExactWords + * + * @param int|null $nbExactWords number of exactly matched words + * + * @return self + */ + public function setNbExactWords($nbExactWords) + { + $this->container['nbExactWords'] = $nbExactWords; + + return $this; + } + + /** + * Gets nbTypos + * + * @return int|null + */ + public function getNbTypos() + { + return $this->container['nbTypos'] ?? null; + } + + /** + * Sets nbTypos + * + * @param int|null $nbTypos number of typos encountered when matching the record + * + * @return self + */ + public function setNbTypos($nbTypos) + { + $this->container['nbTypos'] = $nbTypos; + + return $this; + } + + /** + * Gets promoted + * + * @return bool|null + */ + public function getPromoted() + { + return $this->container['promoted'] ?? null; + } + + /** + * Sets promoted + * + * @param bool|null $promoted present and set to true if a Rule promoted the hit + * + * @return self + */ + public function setPromoted($promoted) + { + $this->container['promoted'] = $promoted; + + return $this; + } + + /** + * Gets proximityDistance + * + * @return int|null + */ + public function getProximityDistance() + { + return $this->container['proximityDistance'] ?? null; + } + + /** + * Sets proximityDistance + * + * @param int|null $proximityDistance when the query contains more than one word, the sum of the distances between matched words (in meters) + * + * @return self + */ + public function setProximityDistance($proximityDistance) + { + $this->container['proximityDistance'] = $proximityDistance; + + return $this; + } + + /** + * Gets userScore + * + * @return int|null + */ + public function getUserScore() + { + return $this->container['userScore'] ?? null; + } + + /** + * Sets userScore + * + * @param int|null $userScore custom ranking for the object, expressed as a single integer value + * + * @return self + */ + public function setUserScore($userScore) + { + $this->container['userScore'] = $userScore; + + return $this; + } + + /** + * Gets word + * + * @return int|null + */ + public function getWord() + { + return $this->container['word'] ?? null; + } + + /** + * Sets word + * + * @param int|null $word number of matched words, including prefixes and typos + * + * @return self + */ + public function setWord($word) + { + $this->container['word'] = $word; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/RankingInfoMatchedGeoLocation.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RankingInfoMatchedGeoLocation.php new file mode 100644 index 0000000000..172d62d8b1 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RankingInfoMatchedGeoLocation.php @@ -0,0 +1,269 @@ + 'double', + 'lng' => 'double', + '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 property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'lat' => 'setLat', + 'lng' => 'setLng', + 'distance' => 'setDistance', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'lat' => 'getLat', + 'lng' => 'getLng', + 'distance' => 'getDistance', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['lat'])) { + $this->container['lat'] = $data['lat']; + } + if (isset($data['lng'])) { + $this->container['lng'] = $data['lng']; + } + if (isset($data['distance'])) { + $this->container['distance'] = $data['distance']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets lat + * + * @return float|null + */ + public function getLat() + { + return $this->container['lat'] ?? null; + } + + /** + * Sets lat + * + * @param float|null $lat latitude of the matched location + * + * @return self + */ + public function setLat($lat) + { + $this->container['lat'] = $lat; + + return $this; + } + + /** + * Gets lng + * + * @return float|null + */ + public function getLng() + { + return $this->container['lng'] ?? null; + } + + /** + * Sets lng + * + * @param float|null $lng longitude of the matched location + * + * @return self + */ + public function setLng($lng) + { + $this->container['lng'] = $lng; + + return $this; + } + + /** + * Gets distance + * + * @return int|null + */ + public function getDistance() + { + return $this->container['distance'] ?? null; + } + + /** + * Sets distance + * + * @param int|null $distance distance between the matched location and the search location (in meters) + * + * @return self + */ + public function setDistance($distance) + { + $this->container['distance'] = $distance; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendHit.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendHit.php new file mode 100644 index 0000000000..12f13290bb --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendHit.php @@ -0,0 +1,385 @@ + 'string', + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\Recommend\HighlightResult', + 'snippetResult' => '\Algolia\AlgoliaSearch\Model\Recommend\SnippetResult', + 'rankingInfo' => '\Algolia\AlgoliaSearch\Model\Recommend\RankingInfo', + 'distinctSeqID' => 'int', + 'score' => 'double', + ]; + + /** + * 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, + 'score' => 'double', + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'highlightResult' => 'setHighlightResult', + 'snippetResult' => 'setSnippetResult', + 'rankingInfo' => 'setRankingInfo', + 'distinctSeqID' => 'setDistinctSeqID', + 'score' => 'setScore', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'highlightResult' => 'getHighlightResult', + 'snippetResult' => 'getSnippetResult', + 'rankingInfo' => 'getRankingInfo', + 'distinctSeqID' => 'getDistinctSeqID', + 'score' => 'getScore', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['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']; + } + if (isset($data['score'])) { + $this->container['score'] = $data['score']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['objectID']) || $this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if (!isset($this->container['score']) || $this->container['score'] === null) { + $invalidProperties[] = "'score' can't be null"; + } + if (($this->container['score'] > 100)) { + $invalidProperties[] = "invalid value for 'score', must be smaller than or equal to 100."; + } + + if (($this->container['score'] < 0)) { + $invalidProperties[] = "invalid value for 'score', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets highlightResult + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\HighlightResult|null + */ + public function getHighlightResult() + { + return $this->container['highlightResult'] ?? null; + } + + /** + * Sets highlightResult + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\HighlightResult|null $highlightResult highlightResult + * + * @return self + */ + public function setHighlightResult($highlightResult) + { + $this->container['highlightResult'] = $highlightResult; + + return $this; + } + + /** + * Gets snippetResult + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\SnippetResult|null + */ + public function getSnippetResult() + { + return $this->container['snippetResult'] ?? null; + } + + /** + * Sets snippetResult + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\SnippetResult|null $snippetResult snippetResult + * + * @return self + */ + public function setSnippetResult($snippetResult) + { + $this->container['snippetResult'] = $snippetResult; + + return $this; + } + + /** + * Gets rankingInfo + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\RankingInfo|null + */ + public function getRankingInfo() + { + return $this->container['rankingInfo'] ?? null; + } + + /** + * Sets rankingInfo + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\RankingInfo|null $rankingInfo rankingInfo + * + * @return self + */ + public function setRankingInfo($rankingInfo) + { + $this->container['rankingInfo'] = $rankingInfo; + + return $this; + } + + /** + * Gets distinctSeqID + * + * @return int|null + */ + public function getDistinctSeqID() + { + return $this->container['distinctSeqID'] ?? null; + } + + /** + * Sets distinctSeqID + * + * @param int|null $distinctSeqID distinctSeqID + * + * @return self + */ + public function setDistinctSeqID($distinctSeqID) + { + $this->container['distinctSeqID'] = $distinctSeqID; + + return $this; + } + + /** + * Gets score + * + * @return float + */ + public function getScore() + { + return $this->container['score'] ?? null; + } + + /** + * Sets score + * + * @param float $score the recommendation score + * + * @return self + */ + public function setScore($score) + { + if (($score > 100)) { + throw new \InvalidArgumentException('invalid value for $score when calling RecommendHit., must be smaller than or equal to 100.'); + } + if (($score < 0)) { + throw new \InvalidArgumentException('invalid value for $score when calling RecommendHit., must be bigger than or equal to 0.'); + } + + $this->container['score'] = $score; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendHits.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendHits.php new file mode 100644 index 0000000000..2902018c77 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendHits.php @@ -0,0 +1,207 @@ + '\Algolia\AlgoliaSearch\Model\Recommend\RecommendHit[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'hits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['hits'])) { + $this->container['hits'] = $data['hits']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets hits + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\RecommendHit[]|null + */ + public function getHits() + { + return $this->container['hits'] ?? null; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\RecommendHit[]|null $hits hits + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationModels.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationModels.php new file mode 100644 index 0000000000..ed0df1e023 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationModels.php @@ -0,0 +1,35 @@ + '\Algolia\AlgoliaSearch\Model\Recommend\RecommendationModels', + 'objectID' => 'string', + 'indexName' => 'string', + 'threshold' => 'int', + 'maxRecommendations' => 'int', + 'queryParameters' => '\Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject', + 'fallbackParameters' => '\Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'model' => null, + 'objectID' => null, + 'indexName' => null, + 'threshold' => null, + 'maxRecommendations' => null, + 'queryParameters' => null, + 'fallbackParameters' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'model' => 'setModel', + 'objectID' => 'setObjectID', + 'indexName' => 'setIndexName', + 'threshold' => 'setThreshold', + 'maxRecommendations' => 'setMaxRecommendations', + 'queryParameters' => 'setQueryParameters', + 'fallbackParameters' => 'setFallbackParameters', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'model' => 'getModel', + 'objectID' => 'getObjectID', + 'indexName' => 'getIndexName', + 'threshold' => 'getThreshold', + 'maxRecommendations' => 'getMaxRecommendations', + 'queryParameters' => 'getQueryParameters', + 'fallbackParameters' => 'getFallbackParameters', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['model'])) { + $this->container['model'] = $data['model']; + } + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + if (isset($data['threshold'])) { + $this->container['threshold'] = $data['threshold']; + } + if (isset($data['maxRecommendations'])) { + $this->container['maxRecommendations'] = $data['maxRecommendations']; + } + if (isset($data['queryParameters'])) { + $this->container['queryParameters'] = $data['queryParameters']; + } + if (isset($data['fallbackParameters'])) { + $this->container['fallbackParameters'] = $data['fallbackParameters']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['model']) || $this->container['model'] === null) { + $invalidProperties[] = "'model' can't be null"; + } + if (!isset($this->container['objectID']) || $this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if (!isset($this->container['indexName']) || $this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + if (!isset($this->container['threshold']) || $this->container['threshold'] === null) { + $invalidProperties[] = "'threshold' can't be null"; + } + if (($this->container['threshold'] > 100)) { + $invalidProperties[] = "invalid value for 'threshold', must be smaller than or equal to 100."; + } + + if (($this->container['threshold'] < 0)) { + $invalidProperties[] = "invalid value for 'threshold', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets model + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\RecommendationModels + */ + public function getModel() + { + return $this->container['model'] ?? null; + } + + /** + * Sets model + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\RecommendationModels $model model + * + * @return self + */ + public function setModel($model) + { + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string $indexName the Algolia index name + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets threshold + * + * @return int + */ + public function getThreshold() + { + return $this->container['threshold'] ?? null; + } + + /** + * Sets threshold + * + * @param int $threshold the threshold to use when filtering recommendations by their score + * + * @return self + */ + public function setThreshold($threshold) + { + if (($threshold > 100)) { + throw new \InvalidArgumentException('invalid value for $threshold when calling RecommendationRequest., must be smaller than or equal to 100.'); + } + if (($threshold < 0)) { + throw new \InvalidArgumentException('invalid value for $threshold when calling RecommendationRequest., must be bigger than or equal to 0.'); + } + + $this->container['threshold'] = $threshold; + + return $this; + } + + /** + * Gets maxRecommendations + * + * @return int|null + */ + public function getMaxRecommendations() + { + return $this->container['maxRecommendations'] ?? null; + } + + /** + * Sets maxRecommendations + * + * @param int|null $maxRecommendations The max number of recommendations to retrieve. If it's set to 0, all the recommendations of the objectID may be returned. + * + * @return self + */ + public function setMaxRecommendations($maxRecommendations) + { + $this->container['maxRecommendations'] = $maxRecommendations; + + return $this; + } + + /** + * Gets queryParameters + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null + */ + public function getQueryParameters() + { + return $this->container['queryParameters'] ?? null; + } + + /** + * Sets queryParameters + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null $queryParameters queryParameters + * + * @return self + */ + public function setQueryParameters($queryParameters) + { + $this->container['queryParameters'] = $queryParameters; + + return $this; + } + + /** + * Gets fallbackParameters + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null + */ + public function getFallbackParameters() + { + return $this->container['fallbackParameters'] ?? null; + } + + /** + * Sets fallbackParameters + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null $fallbackParameters fallbackParameters + * + * @return self + */ + public function setFallbackParameters($fallbackParameters) + { + $this->container['fallbackParameters'] = $fallbackParameters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsRequest.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsRequest.php new file mode 100644 index 0000000000..e6f6ae9768 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsRequest.php @@ -0,0 +1,483 @@ + '\Algolia\AlgoliaSearch\Model\Recommend\RecommendationModels', + 'facetName' => 'string', + 'facetValue' => 'string', + 'indexName' => 'string', + 'threshold' => 'int', + 'maxRecommendations' => 'int', + 'queryParameters' => '\Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject', + 'fallbackParameters' => '\Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject', + 'objectID' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'model' => null, + 'facetName' => null, + 'facetValue' => null, + 'indexName' => null, + 'threshold' => null, + 'maxRecommendations' => null, + 'queryParameters' => null, + 'fallbackParameters' => null, + 'objectID' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'model' => 'setModel', + 'facetName' => 'setFacetName', + 'facetValue' => 'setFacetValue', + 'indexName' => 'setIndexName', + 'threshold' => 'setThreshold', + 'maxRecommendations' => 'setMaxRecommendations', + 'queryParameters' => 'setQueryParameters', + 'fallbackParameters' => 'setFallbackParameters', + 'objectID' => 'setObjectID', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'model' => 'getModel', + 'facetName' => 'getFacetName', + 'facetValue' => 'getFacetValue', + 'indexName' => 'getIndexName', + 'threshold' => 'getThreshold', + 'maxRecommendations' => 'getMaxRecommendations', + 'queryParameters' => 'getQueryParameters', + 'fallbackParameters' => 'getFallbackParameters', + 'objectID' => 'getObjectID', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['model'])) { + $this->container['model'] = $data['model']; + } + if (isset($data['facetName'])) { + $this->container['facetName'] = $data['facetName']; + } + if (isset($data['facetValue'])) { + $this->container['facetValue'] = $data['facetValue']; + } + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + if (isset($data['threshold'])) { + $this->container['threshold'] = $data['threshold']; + } + if (isset($data['maxRecommendations'])) { + $this->container['maxRecommendations'] = $data['maxRecommendations']; + } + if (isset($data['queryParameters'])) { + $this->container['queryParameters'] = $data['queryParameters']; + } + if (isset($data['fallbackParameters'])) { + $this->container['fallbackParameters'] = $data['fallbackParameters']; + } + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['model']) || $this->container['model'] === null) { + $invalidProperties[] = "'model' can't be null"; + } + if (!isset($this->container['indexName']) || $this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + if (!isset($this->container['threshold']) || $this->container['threshold'] === null) { + $invalidProperties[] = "'threshold' can't be null"; + } + if (($this->container['threshold'] > 100)) { + $invalidProperties[] = "invalid value for 'threshold', must be smaller than or equal to 100."; + } + + if (($this->container['threshold'] < 0)) { + $invalidProperties[] = "invalid value for 'threshold', must be bigger than or equal to 0."; + } + + if (!isset($this->container['objectID']) || $this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets model + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\RecommendationModels + */ + public function getModel() + { + return $this->container['model'] ?? null; + } + + /** + * Sets model + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\RecommendationModels $model model + * + * @return self + */ + public function setModel($model) + { + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets facetName + * + * @return string|null + */ + public function getFacetName() + { + return $this->container['facetName'] ?? null; + } + + /** + * Sets facetName + * + * @param string|null $facetName the facet name to use for trending models + * + * @return self + */ + public function setFacetName($facetName) + { + $this->container['facetName'] = $facetName; + + return $this; + } + + /** + * Gets facetValue + * + * @return string|null + */ + public function getFacetValue() + { + return $this->container['facetValue'] ?? null; + } + + /** + * Sets facetValue + * + * @param string|null $facetValue the facet value to use for trending models + * + * @return self + */ + public function setFacetValue($facetValue) + { + $this->container['facetValue'] = $facetValue; + + return $this; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string $indexName the Algolia index name + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets threshold + * + * @return int + */ + public function getThreshold() + { + return $this->container['threshold'] ?? null; + } + + /** + * Sets threshold + * + * @param int $threshold the threshold to use when filtering recommendations by their score + * + * @return self + */ + public function setThreshold($threshold) + { + if (($threshold > 100)) { + throw new \InvalidArgumentException('invalid value for $threshold when calling RecommendationsRequest., must be smaller than or equal to 100.'); + } + if (($threshold < 0)) { + throw new \InvalidArgumentException('invalid value for $threshold when calling RecommendationsRequest., must be bigger than or equal to 0.'); + } + + $this->container['threshold'] = $threshold; + + return $this; + } + + /** + * Gets maxRecommendations + * + * @return int|null + */ + public function getMaxRecommendations() + { + return $this->container['maxRecommendations'] ?? null; + } + + /** + * Sets maxRecommendations + * + * @param int|null $maxRecommendations The max number of recommendations to retrieve. If it's set to 0, all the recommendations of the objectID may be returned. + * + * @return self + */ + public function setMaxRecommendations($maxRecommendations) + { + $this->container['maxRecommendations'] = $maxRecommendations; + + return $this; + } + + /** + * Gets queryParameters + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null + */ + public function getQueryParameters() + { + return $this->container['queryParameters'] ?? null; + } + + /** + * Sets queryParameters + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null $queryParameters queryParameters + * + * @return self + */ + public function setQueryParameters($queryParameters) + { + $this->container['queryParameters'] = $queryParameters; + + return $this; + } + + /** + * Gets fallbackParameters + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null + */ + public function getFallbackParameters() + { + return $this->container['fallbackParameters'] ?? null; + } + + /** + * Sets fallbackParameters + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null $fallbackParameters fallbackParameters + * + * @return self + */ + public function setFallbackParameters($fallbackParameters) + { + $this->container['fallbackParameters'] = $fallbackParameters; + + return $this; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsResponse.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsResponse.php new file mode 100644 index 0000000000..bbd798eaa7 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RecommendationsResponse.php @@ -0,0 +1,990 @@ + 'int', + 'abTestVariantID' => 'int', + 'aroundLatLng' => 'string', + 'automaticRadius' => 'string', + 'exhaustiveFacetsCount' => 'bool', + 'exhaustiveNbHits' => 'bool', + 'exhaustiveTypo' => 'bool', + 'facets' => 'array>', + 'facetsStats' => 'array', + 'hitsPerPage' => 'int', + 'index' => 'string', + 'indexUsed' => 'string', + 'message' => 'string', + 'nbHits' => 'int', + 'nbPages' => 'int', + 'nbSortedHits' => 'int', + 'page' => 'int', + 'params' => 'string', + 'parsedQuery' => 'string', + 'processingTimeMS' => 'int', + 'query' => 'string', + 'queryAfterRemoval' => 'string', + 'serverUsed' => 'string', + 'userData' => 'object', + 'hits' => '\Algolia\AlgoliaSearch\Model\Recommend\RecommendHit[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'abTestID' => null, + 'abTestVariantID' => null, + 'aroundLatLng' => null, + 'automaticRadius' => null, + 'exhaustiveFacetsCount' => null, + 'exhaustiveNbHits' => null, + 'exhaustiveTypo' => null, + 'facets' => null, + 'facetsStats' => null, + 'hitsPerPage' => null, + 'index' => null, + 'indexUsed' => null, + 'message' => null, + 'nbHits' => null, + 'nbPages' => null, + 'nbSortedHits' => null, + 'page' => null, + 'params' => null, + 'parsedQuery' => null, + 'processingTimeMS' => null, + 'query' => null, + 'queryAfterRemoval' => null, + 'serverUsed' => null, + 'userData' => null, + 'hits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abTestID' => 'setAbTestID', + 'abTestVariantID' => 'setAbTestVariantID', + 'aroundLatLng' => 'setAroundLatLng', + 'automaticRadius' => 'setAutomaticRadius', + 'exhaustiveFacetsCount' => 'setExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'setExhaustiveNbHits', + 'exhaustiveTypo' => 'setExhaustiveTypo', + 'facets' => 'setFacets', + 'facetsStats' => 'setFacetsStats', + 'hitsPerPage' => 'setHitsPerPage', + 'index' => 'setIndex', + 'indexUsed' => 'setIndexUsed', + 'message' => 'setMessage', + 'nbHits' => 'setNbHits', + 'nbPages' => 'setNbPages', + 'nbSortedHits' => 'setNbSortedHits', + 'page' => 'setPage', + 'params' => 'setParams', + 'parsedQuery' => 'setParsedQuery', + 'processingTimeMS' => 'setProcessingTimeMS', + 'query' => 'setQuery', + 'queryAfterRemoval' => 'setQueryAfterRemoval', + 'serverUsed' => 'setServerUsed', + 'userData' => 'setUserData', + 'hits' => 'setHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abTestID' => 'getAbTestID', + 'abTestVariantID' => 'getAbTestVariantID', + 'aroundLatLng' => 'getAroundLatLng', + 'automaticRadius' => 'getAutomaticRadius', + 'exhaustiveFacetsCount' => 'getExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'getExhaustiveNbHits', + 'exhaustiveTypo' => 'getExhaustiveTypo', + 'facets' => 'getFacets', + 'facetsStats' => 'getFacetsStats', + 'hitsPerPage' => 'getHitsPerPage', + 'index' => 'getIndex', + 'indexUsed' => 'getIndexUsed', + 'message' => 'getMessage', + 'nbHits' => 'getNbHits', + 'nbPages' => 'getNbPages', + 'nbSortedHits' => 'getNbSortedHits', + 'page' => 'getPage', + 'params' => 'getParams', + 'parsedQuery' => 'getParsedQuery', + 'processingTimeMS' => 'getProcessingTimeMS', + 'query' => 'getQuery', + 'queryAfterRemoval' => 'getQueryAfterRemoval', + 'serverUsed' => 'getServerUsed', + 'userData' => 'getUserData', + 'hits' => 'getHits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['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['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['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + 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['nbHits'])) { + $this->container['nbHits'] = $data['nbHits']; + } + if (isset($data['nbPages'])) { + $this->container['nbPages'] = $data['nbPages']; + } + if (isset($data['nbSortedHits'])) { + $this->container['nbSortedHits'] = $data['nbSortedHits']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['params'])) { + $this->container['params'] = $data['params']; + } + if (isset($data['parsedQuery'])) { + $this->container['parsedQuery'] = $data['parsedQuery']; + } + if (isset($data['processingTimeMS'])) { + $this->container['processingTimeMS'] = $data['processingTimeMS']; + } + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['queryAfterRemoval'])) { + $this->container['queryAfterRemoval'] = $data['queryAfterRemoval']; + } + if (isset($data['serverUsed'])) { + $this->container['serverUsed'] = $data['serverUsed']; + } + if (isset($data['userData'])) { + $this->container['userData'] = $data['userData']; + } + if (isset($data['hits'])) { + $this->container['hits'] = $data['hits']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (isset($this->container['aroundLatLng']) && !preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $this->container['aroundLatLng'])) { + $invalidProperties[] = "invalid value for 'aroundLatLng', must be conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."; + } + + if (!isset($this->container['exhaustiveNbHits']) || $this->container['exhaustiveNbHits'] === null) { + $invalidProperties[] = "'exhaustiveNbHits' can't be null"; + } + if (!isset($this->container['exhaustiveTypo']) || $this->container['exhaustiveTypo'] === null) { + $invalidProperties[] = "'exhaustiveTypo' can't be null"; + } + if (!isset($this->container['hitsPerPage']) || $this->container['hitsPerPage'] === null) { + $invalidProperties[] = "'hitsPerPage' can't be null"; + } + if (!isset($this->container['nbHits']) || $this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if (!isset($this->container['nbPages']) || $this->container['nbPages'] === null) { + $invalidProperties[] = "'nbPages' can't be null"; + } + if (!isset($this->container['page']) || $this->container['page'] === null) { + $invalidProperties[] = "'page' can't be null"; + } + if (!isset($this->container['params']) || $this->container['params'] === null) { + $invalidProperties[] = "'params' can't be null"; + } + if (!isset($this->container['processingTimeMS']) || $this->container['processingTimeMS'] === null) { + $invalidProperties[] = "'processingTimeMS' can't be null"; + } + if (!isset($this->container['query']) || $this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + if (!isset($this->container['hits']) || $this->container['hits'] === null) { + $invalidProperties[] = "'hits' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets abTestID + * + * @return int|null + */ + public function getAbTestID() + { + return $this->container['abTestID'] ?? null; + } + + /** + * Sets abTestID + * + * @param int|null $abTestID if a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets abTestVariantID + * + * @return int|null + */ + public function getAbTestVariantID() + { + return $this->container['abTestVariantID'] ?? null; + } + + /** + * Sets abTestVariantID + * + * @param int|null $abTestVariantID if a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used + * + * @return self + */ + public function setAbTestVariantID($abTestVariantID) + { + $this->container['abTestVariantID'] = $abTestVariantID; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng'] ?? null; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng the computed geo location + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + if (!is_null($aroundLatLng) && (!preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $aroundLatLng))) { + throw new \InvalidArgumentException("invalid value for $aroundLatLng when calling RecommendationsResponse., must conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."); + } + + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets automaticRadius + * + * @return string|null + */ + public function getAutomaticRadius() + { + return $this->container['automaticRadius'] ?? null; + } + + /** + * Sets automaticRadius + * + * @param string|null $automaticRadius The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. + * + * @return self + */ + public function setAutomaticRadius($automaticRadius) + { + $this->container['automaticRadius'] = $automaticRadius; + + return $this; + } + + /** + * Gets exhaustiveFacetsCount + * + * @return bool|null + */ + public function getExhaustiveFacetsCount() + { + return $this->container['exhaustiveFacetsCount'] ?? null; + } + + /** + * Sets exhaustiveFacetsCount + * + * @param bool|null $exhaustiveFacetsCount whether the facet count is exhaustive or approximate + * + * @return self + */ + public function setExhaustiveFacetsCount($exhaustiveFacetsCount) + { + $this->container['exhaustiveFacetsCount'] = $exhaustiveFacetsCount; + + return $this; + } + + /** + * Gets exhaustiveNbHits + * + * @return bool + */ + public function getExhaustiveNbHits() + { + return $this->container['exhaustiveNbHits'] ?? null; + } + + /** + * Sets exhaustiveNbHits + * + * @param bool $exhaustiveNbHits indicate if the nbHits count was exhaustive or approximate + * + * @return self + */ + public function setExhaustiveNbHits($exhaustiveNbHits) + { + $this->container['exhaustiveNbHits'] = $exhaustiveNbHits; + + return $this; + } + + /** + * Gets exhaustiveTypo + * + * @return bool + */ + public function getExhaustiveTypo() + { + return $this->container['exhaustiveTypo'] ?? null; + } + + /** + * Sets exhaustiveTypo + * + * @param bool $exhaustiveTypo indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * + * @return self + */ + public function setExhaustiveTypo($exhaustiveTypo) + { + $this->container['exhaustiveTypo'] = $exhaustiveTypo; + + return $this; + } + + /** + * Gets facets + * + * @return array>|null + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets + * + * @param array>|null $facets a mapping of each facet name to the corresponding facet counts + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets facetsStats + * + * @return array|null + */ + public function getFacetsStats() + { + return $this->container['facetsStats'] ?? null; + } + + /** + * Sets facetsStats + * + * @param array|null $facetsStats statistics for numerical facets + * + * @return self + */ + public function setFacetsStats($facetsStats) + { + $this->container['facetsStats'] = $facetsStats; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets index + * + * @return string|null + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index + * + * @param string|null $index index name used for the query + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets indexUsed + * + * @return string|null + */ + public function getIndexUsed() + { + return $this->container['indexUsed'] ?? null; + } + + /** + * Sets indexUsed + * + * @param string|null $indexUsed Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. + * + * @return self + */ + public function setIndexUsed($indexUsed) + { + $this->container['indexUsed'] = $indexUsed; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string|null $message used to return warnings about the query + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits'] ?? null; + } + + /** + * Sets nbHits + * + * @param int $nbHits number of hits that the search query matched + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets nbPages + * + * @return int + */ + public function getNbPages() + { + return $this->container['nbPages'] ?? null; + } + + /** + * Sets nbPages + * + * @param int $nbPages number of pages available for the current query + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + + /** + * Gets nbSortedHits + * + * @return int|null + */ + public function getNbSortedHits() + { + return $this->container['nbSortedHits'] ?? null; + } + + /** + * Sets nbSortedHits + * + * @param int|null $nbSortedHits the number of hits selected and sorted by the relevant sort algorithm + * + * @return self + */ + public function setNbSortedHits($nbSortedHits) + { + $this->container['nbSortedHits'] = $nbSortedHits; + + return $this; + } + + /** + * Gets page + * + * @return int + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets params + * + * @return string + */ + public function getParams() + { + return $this->container['params'] ?? null; + } + + /** + * Sets params + * + * @param string $params a url-encoded string of all search parameters + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets parsedQuery + * + * @return string|null + */ + public function getParsedQuery() + { + return $this->container['parsedQuery'] ?? null; + } + + /** + * Sets parsedQuery + * + * @param string|null $parsedQuery the query string that will be searched, after normalization + * + * @return self + */ + public function setParsedQuery($parsedQuery) + { + $this->container['parsedQuery'] = $parsedQuery; + + return $this; + } + + /** + * Gets processingTimeMS + * + * @return int + */ + public function getProcessingTimeMS() + { + return $this->container['processingTimeMS'] ?? 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 query + * + * @return string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets queryAfterRemoval + * + * @return string|null + */ + public function getQueryAfterRemoval() + { + return $this->container['queryAfterRemoval'] ?? null; + } + + /** + * Sets queryAfterRemoval + * + * @param string|null $queryAfterRemoval a markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set + * + * @return self + */ + public function setQueryAfterRemoval($queryAfterRemoval) + { + $this->container['queryAfterRemoval'] = $queryAfterRemoval; + + return $this; + } + + /** + * Gets serverUsed + * + * @return string|null + */ + public function getServerUsed() + { + return $this->container['serverUsed'] ?? null; + } + + /** + * Sets serverUsed + * + * @param string|null $serverUsed actual host name of the server that processed the request + * + * @return self + */ + public function setServerUsed($serverUsed) + { + $this->container['serverUsed'] = $serverUsed; + + return $this; + } + + /** + * Gets userData + * + * @return object|null + */ + public function getUserData() + { + return $this->container['userData'] ?? null; + } + + /** + * Sets userData + * + * @param object|null $userData lets you store custom data in your indices + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + + /** + * Gets hits + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\RecommendHit[] + */ + public function getHits() + { + return $this->container['hits'] ?? null; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\RecommendHit[] $hits hits + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/RequiredSearchParams.php b/clients/algoliasearch-client-php/lib/Model/Recommend/RequiredSearchParams.php new file mode 100644 index 0000000000..bd0735ad5f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/RequiredSearchParams.php @@ -0,0 +1,211 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'query' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['query']) || $this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/SearchParamsObject.php b/clients/algoliasearch-client-php/lib/Model/Recommend/SearchParamsObject.php new file mode 100644 index 0000000000..8deadb7f18 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/SearchParamsObject.php @@ -0,0 +1,2826 @@ + 'string', + 'filters' => 'string', + 'facetFilters' => 'string[]', + 'optionalFilters' => 'string[]', + 'numericFilters' => 'string[]', + 'tagFilters' => 'string[]', + 'sumOrFiltersScores' => 'bool', + 'facets' => 'string[]', + 'maxValuesPerFacet' => 'int', + 'facetingAfterDistinct' => 'bool', + 'sortFacetValuesBy' => 'string', + 'page' => 'int', + 'offset' => 'int', + 'length' => 'int', + 'aroundLatLng' => 'string', + 'aroundLatLngViaIP' => 'bool', + 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Recommend\AroundRadius', + 'aroundPrecision' => 'int', + 'minimumAroundRadius' => 'int', + 'insideBoundingBox' => 'float[]', + 'insidePolygon' => 'float[]', + 'naturalLanguages' => 'string[]', + 'ruleContexts' => 'string[]', + 'personalizationImpact' => 'int', + 'userToken' => 'string', + 'getRankingInfo' => 'bool', + 'clickAnalytics' => 'bool', + 'analytics' => 'bool', + 'analyticsTags' => 'string[]', + 'percentileComputation' => 'bool', + 'enableABTest' => 'bool', + 'enableReRanking' => 'bool', + 'query' => 'string', + 'searchableAttributes' => 'string[]', + 'attributesForFaceting' => 'string[]', + 'unretrievableAttributes' => 'string[]', + 'attributesToRetrieve' => 'string[]', + 'restrictSearchableAttributes' => 'string[]', + 'ranking' => 'string[]', + 'customRanking' => 'string[]', + 'relevancyStrictness' => 'int', + 'attributesToHighlight' => 'string[]', + 'attributesToSnippet' => 'string[]', + 'highlightPreTag' => 'string', + 'highlightPostTag' => 'string', + 'snippetEllipsisText' => 'string', + 'restrictHighlightAndSnippetArrays' => 'bool', + 'hitsPerPage' => 'int', + 'minWordSizefor1Typo' => 'int', + 'minWordSizefor2Typos' => 'int', + 'typoTolerance' => 'string', + 'allowTyposOnNumericTokens' => 'bool', + 'disableTypoToleranceOnAttributes' => 'string[]', + 'separatorsToIndex' => 'string', + 'ignorePlurals' => 'string', + 'removeStopWords' => 'string', + 'keepDiacriticsOnCharacters' => 'string', + 'queryLanguages' => 'string[]', + 'decompoundQuery' => 'bool', + 'enableRules' => 'bool', + 'enablePersonalization' => 'bool', + 'queryType' => 'string', + 'removeWordsIfNoResults' => 'string', + 'advancedSyntax' => 'bool', + 'optionalWords' => 'string[]', + 'disableExactOnAttributes' => 'string[]', + 'exactOnSingleWordQuery' => 'string', + 'alternativesAsExact' => 'string[]', + 'advancedSyntaxFeatures' => 'string[]', + 'distinct' => 'int', + 'synonyms' => 'bool', + 'replaceSynonymsInHighlight' => 'bool', + 'minProximity' => 'int', + 'responseFields' => 'string[]', + 'maxFacetHits' => 'int', + 'attributeCriteriaComputedByMinProximity' => 'bool', + 'renderingContent' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'similarQuery' => null, + 'filters' => null, + 'facetFilters' => null, + 'optionalFilters' => null, + 'numericFilters' => null, + 'tagFilters' => null, + 'sumOrFiltersScores' => null, + 'facets' => null, + 'maxValuesPerFacet' => null, + 'facetingAfterDistinct' => null, + 'sortFacetValuesBy' => null, + 'page' => null, + 'offset' => null, + 'length' => null, + 'aroundLatLng' => null, + 'aroundLatLngViaIP' => null, + 'aroundRadius' => null, + 'aroundPrecision' => null, + 'minimumAroundRadius' => null, + 'insideBoundingBox' => null, + 'insidePolygon' => null, + 'naturalLanguages' => null, + 'ruleContexts' => null, + 'personalizationImpact' => null, + 'userToken' => null, + 'getRankingInfo' => null, + 'clickAnalytics' => null, + 'analytics' => null, + 'analyticsTags' => null, + 'percentileComputation' => null, + 'enableABTest' => null, + 'enableReRanking' => null, + 'query' => null, + 'searchableAttributes' => null, + 'attributesForFaceting' => null, + 'unretrievableAttributes' => null, + 'attributesToRetrieve' => null, + 'restrictSearchableAttributes' => null, + 'ranking' => null, + 'customRanking' => null, + 'relevancyStrictness' => null, + 'attributesToHighlight' => null, + 'attributesToSnippet' => null, + 'highlightPreTag' => null, + 'highlightPostTag' => null, + 'snippetEllipsisText' => null, + 'restrictHighlightAndSnippetArrays' => null, + 'hitsPerPage' => null, + 'minWordSizefor1Typo' => null, + 'minWordSizefor2Typos' => null, + 'typoTolerance' => null, + 'allowTyposOnNumericTokens' => null, + 'disableTypoToleranceOnAttributes' => null, + 'separatorsToIndex' => null, + 'ignorePlurals' => null, + 'removeStopWords' => null, + 'keepDiacriticsOnCharacters' => null, + 'queryLanguages' => null, + 'decompoundQuery' => null, + 'enableRules' => null, + 'enablePersonalization' => null, + 'queryType' => null, + 'removeWordsIfNoResults' => null, + 'advancedSyntax' => null, + 'optionalWords' => null, + 'disableExactOnAttributes' => null, + 'exactOnSingleWordQuery' => null, + 'alternativesAsExact' => null, + 'advancedSyntaxFeatures' => null, + 'distinct' => null, + 'synonyms' => null, + 'replaceSynonymsInHighlight' => null, + 'minProximity' => null, + 'responseFields' => null, + 'maxFacetHits' => null, + 'attributeCriteriaComputedByMinProximity' => null, + 'renderingContent' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'similarQuery' => 'setSimilarQuery', + 'filters' => 'setFilters', + 'facetFilters' => 'setFacetFilters', + 'optionalFilters' => 'setOptionalFilters', + 'numericFilters' => 'setNumericFilters', + 'tagFilters' => 'setTagFilters', + 'sumOrFiltersScores' => 'setSumOrFiltersScores', + 'facets' => 'setFacets', + 'maxValuesPerFacet' => 'setMaxValuesPerFacet', + 'facetingAfterDistinct' => 'setFacetingAfterDistinct', + 'sortFacetValuesBy' => 'setSortFacetValuesBy', + 'page' => 'setPage', + 'offset' => 'setOffset', + 'length' => 'setLength', + 'aroundLatLng' => 'setAroundLatLng', + 'aroundLatLngViaIP' => 'setAroundLatLngViaIP', + 'aroundRadius' => 'setAroundRadius', + 'aroundPrecision' => 'setAroundPrecision', + 'minimumAroundRadius' => 'setMinimumAroundRadius', + 'insideBoundingBox' => 'setInsideBoundingBox', + 'insidePolygon' => 'setInsidePolygon', + 'naturalLanguages' => 'setNaturalLanguages', + 'ruleContexts' => 'setRuleContexts', + 'personalizationImpact' => 'setPersonalizationImpact', + 'userToken' => 'setUserToken', + 'getRankingInfo' => 'setGetRankingInfo', + 'clickAnalytics' => 'setClickAnalytics', + 'analytics' => 'setAnalytics', + 'analyticsTags' => 'setAnalyticsTags', + 'percentileComputation' => 'setPercentileComputation', + 'enableABTest' => 'setEnableABTest', + 'enableReRanking' => 'setEnableReRanking', + 'query' => 'setQuery', + 'searchableAttributes' => 'setSearchableAttributes', + 'attributesForFaceting' => 'setAttributesForFaceting', + 'unretrievableAttributes' => 'setUnretrievableAttributes', + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'restrictSearchableAttributes' => 'setRestrictSearchableAttributes', + 'ranking' => 'setRanking', + 'customRanking' => 'setCustomRanking', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'attributesToHighlight' => 'setAttributesToHighlight', + 'attributesToSnippet' => 'setAttributesToSnippet', + 'highlightPreTag' => 'setHighlightPreTag', + 'highlightPostTag' => 'setHighlightPostTag', + 'snippetEllipsisText' => 'setSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'setRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'setHitsPerPage', + 'minWordSizefor1Typo' => 'setMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'setMinWordSizefor2Typos', + 'typoTolerance' => 'setTypoTolerance', + 'allowTyposOnNumericTokens' => 'setAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'setDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'setSeparatorsToIndex', + 'ignorePlurals' => 'setIgnorePlurals', + 'removeStopWords' => 'setRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'setKeepDiacriticsOnCharacters', + 'queryLanguages' => 'setQueryLanguages', + 'decompoundQuery' => 'setDecompoundQuery', + 'enableRules' => 'setEnableRules', + 'enablePersonalization' => 'setEnablePersonalization', + 'queryType' => 'setQueryType', + 'removeWordsIfNoResults' => 'setRemoveWordsIfNoResults', + 'advancedSyntax' => 'setAdvancedSyntax', + 'optionalWords' => 'setOptionalWords', + 'disableExactOnAttributes' => 'setDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'setExactOnSingleWordQuery', + 'alternativesAsExact' => 'setAlternativesAsExact', + 'advancedSyntaxFeatures' => 'setAdvancedSyntaxFeatures', + 'distinct' => 'setDistinct', + 'synonyms' => 'setSynonyms', + 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', + 'minProximity' => 'setMinProximity', + 'responseFields' => 'setResponseFields', + 'maxFacetHits' => 'setMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'setRenderingContent', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'similarQuery' => 'getSimilarQuery', + 'filters' => 'getFilters', + 'facetFilters' => 'getFacetFilters', + 'optionalFilters' => 'getOptionalFilters', + 'numericFilters' => 'getNumericFilters', + 'tagFilters' => 'getTagFilters', + 'sumOrFiltersScores' => 'getSumOrFiltersScores', + 'facets' => 'getFacets', + 'maxValuesPerFacet' => 'getMaxValuesPerFacet', + 'facetingAfterDistinct' => 'getFacetingAfterDistinct', + 'sortFacetValuesBy' => 'getSortFacetValuesBy', + 'page' => 'getPage', + 'offset' => 'getOffset', + 'length' => 'getLength', + 'aroundLatLng' => 'getAroundLatLng', + 'aroundLatLngViaIP' => 'getAroundLatLngViaIP', + 'aroundRadius' => 'getAroundRadius', + 'aroundPrecision' => 'getAroundPrecision', + 'minimumAroundRadius' => 'getMinimumAroundRadius', + 'insideBoundingBox' => 'getInsideBoundingBox', + 'insidePolygon' => 'getInsidePolygon', + 'naturalLanguages' => 'getNaturalLanguages', + 'ruleContexts' => 'getRuleContexts', + 'personalizationImpact' => 'getPersonalizationImpact', + 'userToken' => 'getUserToken', + 'getRankingInfo' => 'getGetRankingInfo', + 'clickAnalytics' => 'getClickAnalytics', + 'analytics' => 'getAnalytics', + 'analyticsTags' => 'getAnalyticsTags', + 'percentileComputation' => 'getPercentileComputation', + 'enableABTest' => 'getEnableABTest', + 'enableReRanking' => 'getEnableReRanking', + 'query' => 'getQuery', + 'searchableAttributes' => 'getSearchableAttributes', + 'attributesForFaceting' => 'getAttributesForFaceting', + 'unretrievableAttributes' => 'getUnretrievableAttributes', + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'restrictSearchableAttributes' => 'getRestrictSearchableAttributes', + 'ranking' => 'getRanking', + 'customRanking' => 'getCustomRanking', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'attributesToHighlight' => 'getAttributesToHighlight', + 'attributesToSnippet' => 'getAttributesToSnippet', + 'highlightPreTag' => 'getHighlightPreTag', + 'highlightPostTag' => 'getHighlightPostTag', + 'snippetEllipsisText' => 'getSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'getRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'getHitsPerPage', + 'minWordSizefor1Typo' => 'getMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'getMinWordSizefor2Typos', + 'typoTolerance' => 'getTypoTolerance', + 'allowTyposOnNumericTokens' => 'getAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'getDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'getSeparatorsToIndex', + 'ignorePlurals' => 'getIgnorePlurals', + 'removeStopWords' => 'getRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'getKeepDiacriticsOnCharacters', + 'queryLanguages' => 'getQueryLanguages', + 'decompoundQuery' => 'getDecompoundQuery', + 'enableRules' => 'getEnableRules', + 'enablePersonalization' => 'getEnablePersonalization', + 'queryType' => 'getQueryType', + 'removeWordsIfNoResults' => 'getRemoveWordsIfNoResults', + 'advancedSyntax' => 'getAdvancedSyntax', + 'optionalWords' => 'getOptionalWords', + 'disableExactOnAttributes' => 'getDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'getExactOnSingleWordQuery', + 'alternativesAsExact' => 'getAlternativesAsExact', + 'advancedSyntaxFeatures' => 'getAdvancedSyntaxFeatures', + 'distinct' => 'getDistinct', + 'synonyms' => 'getSynonyms', + 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', + 'minProximity' => 'getMinProximity', + 'responseFields' => 'getResponseFields', + 'maxFacetHits' => 'getMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'getRenderingContent', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + const TYPO_TOLERANCE_TRUE = 'true'; + const TYPO_TOLERANCE_FALSE = 'false'; + const TYPO_TOLERANCE_MIN = 'min'; + const TYPO_TOLERANCE_STRICT = 'strict'; + const QUERY_TYPE_PREFIX_LAST = 'prefixLast'; + const QUERY_TYPE_PREFIX_ALL = 'prefixAll'; + const QUERY_TYPE_PREFIX_NONE = 'prefixNone'; + const REMOVE_WORDS_IF_NO_RESULTS_NONE = 'none'; + const REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS = 'lastWords'; + const REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS = 'firstWords'; + const REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL = 'allOptional'; + const EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE = 'attribute'; + const EXACT_ON_SINGLE_WORD_QUERY_NONE = 'none'; + const EXACT_ON_SINGLE_WORD_QUERY_WORD = 'word'; + const ALTERNATIVES_AS_EXACT_IGNORE_PLURALS = 'ignorePlurals'; + const ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM = 'singleWordSynonym'; + const ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM = 'multiWordsSynonym'; + const ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE = 'exactPhrase'; + const ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS = 'excludeWords'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypoToleranceAllowableValues() + { + return [ + self::TYPO_TOLERANCE_TRUE, + self::TYPO_TOLERANCE_FALSE, + self::TYPO_TOLERANCE_MIN, + self::TYPO_TOLERANCE_STRICT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getQueryTypeAllowableValues() + { + return [ + self::QUERY_TYPE_PREFIX_LAST, + self::QUERY_TYPE_PREFIX_ALL, + self::QUERY_TYPE_PREFIX_NONE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemoveWordsIfNoResultsAllowableValues() + { + return [ + self::REMOVE_WORDS_IF_NO_RESULTS_NONE, + self::REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExactOnSingleWordQueryAllowableValues() + { + return [ + self::EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE, + self::EXACT_ON_SINGLE_WORD_QUERY_NONE, + self::EXACT_ON_SINGLE_WORD_QUERY_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAlternativesAsExactAllowableValues() + { + return [ + self::ALTERNATIVES_AS_EXACT_IGNORE_PLURALS, + self::ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM, + self::ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdvancedSyntaxFeaturesAllowableValues() + { + return [ + self::ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE, + self::ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['similarQuery'])) { + $this->container['similarQuery'] = $data['similarQuery']; + } + if (isset($data['filters'])) { + $this->container['filters'] = $data['filters']; + } + 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['tagFilters'])) { + $this->container['tagFilters'] = $data['tagFilters']; + } + if (isset($data['sumOrFiltersScores'])) { + $this->container['sumOrFiltersScores'] = $data['sumOrFiltersScores']; + } + if (isset($data['facets'])) { + $this->container['facets'] = $data['facets']; + } + if (isset($data['maxValuesPerFacet'])) { + $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; + } + if (isset($data['facetingAfterDistinct'])) { + $this->container['facetingAfterDistinct'] = $data['facetingAfterDistinct']; + } + if (isset($data['sortFacetValuesBy'])) { + $this->container['sortFacetValuesBy'] = $data['sortFacetValuesBy']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['offset'])) { + $this->container['offset'] = $data['offset']; + } + if (isset($data['length'])) { + $this->container['length'] = $data['length']; + } + 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['naturalLanguages'])) { + $this->container['naturalLanguages'] = $data['naturalLanguages']; + } + if (isset($data['ruleContexts'])) { + $this->container['ruleContexts'] = $data['ruleContexts']; + } + if (isset($data['personalizationImpact'])) { + $this->container['personalizationImpact'] = $data['personalizationImpact']; + } + if (isset($data['userToken'])) { + $this->container['userToken'] = $data['userToken']; + } + if (isset($data['getRankingInfo'])) { + $this->container['getRankingInfo'] = $data['getRankingInfo']; + } + 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['percentileComputation'])) { + $this->container['percentileComputation'] = $data['percentileComputation']; + } + if (isset($data['enableABTest'])) { + $this->container['enableABTest'] = $data['enableABTest']; + } + if (isset($data['enableReRanking'])) { + $this->container['enableReRanking'] = $data['enableReRanking']; + } + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['searchableAttributes'])) { + $this->container['searchableAttributes'] = $data['searchableAttributes']; + } + if (isset($data['attributesForFaceting'])) { + $this->container['attributesForFaceting'] = $data['attributesForFaceting']; + } + if (isset($data['unretrievableAttributes'])) { + $this->container['unretrievableAttributes'] = $data['unretrievableAttributes']; + } + if (isset($data['attributesToRetrieve'])) { + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; + } + if (isset($data['restrictSearchableAttributes'])) { + $this->container['restrictSearchableAttributes'] = $data['restrictSearchableAttributes']; + } + if (isset($data['ranking'])) { + $this->container['ranking'] = $data['ranking']; + } + if (isset($data['customRanking'])) { + $this->container['customRanking'] = $data['customRanking']; + } + if (isset($data['relevancyStrictness'])) { + $this->container['relevancyStrictness'] = $data['relevancyStrictness']; + } + if (isset($data['attributesToHighlight'])) { + $this->container['attributesToHighlight'] = $data['attributesToHighlight']; + } + if (isset($data['attributesToSnippet'])) { + $this->container['attributesToSnippet'] = $data['attributesToSnippet']; + } + if (isset($data['highlightPreTag'])) { + $this->container['highlightPreTag'] = $data['highlightPreTag']; + } + if (isset($data['highlightPostTag'])) { + $this->container['highlightPostTag'] = $data['highlightPostTag']; + } + if (isset($data['snippetEllipsisText'])) { + $this->container['snippetEllipsisText'] = $data['snippetEllipsisText']; + } + if (isset($data['restrictHighlightAndSnippetArrays'])) { + $this->container['restrictHighlightAndSnippetArrays'] = $data['restrictHighlightAndSnippetArrays']; + } + if (isset($data['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + if (isset($data['minWordSizefor1Typo'])) { + $this->container['minWordSizefor1Typo'] = $data['minWordSizefor1Typo']; + } + if (isset($data['minWordSizefor2Typos'])) { + $this->container['minWordSizefor2Typos'] = $data['minWordSizefor2Typos']; + } + if (isset($data['typoTolerance'])) { + $this->container['typoTolerance'] = $data['typoTolerance']; + } + if (isset($data['allowTyposOnNumericTokens'])) { + $this->container['allowTyposOnNumericTokens'] = $data['allowTyposOnNumericTokens']; + } + if (isset($data['disableTypoToleranceOnAttributes'])) { + $this->container['disableTypoToleranceOnAttributes'] = $data['disableTypoToleranceOnAttributes']; + } + if (isset($data['separatorsToIndex'])) { + $this->container['separatorsToIndex'] = $data['separatorsToIndex']; + } + if (isset($data['ignorePlurals'])) { + $this->container['ignorePlurals'] = $data['ignorePlurals']; + } + if (isset($data['removeStopWords'])) { + $this->container['removeStopWords'] = $data['removeStopWords']; + } + if (isset($data['keepDiacriticsOnCharacters'])) { + $this->container['keepDiacriticsOnCharacters'] = $data['keepDiacriticsOnCharacters']; + } + if (isset($data['queryLanguages'])) { + $this->container['queryLanguages'] = $data['queryLanguages']; + } + if (isset($data['decompoundQuery'])) { + $this->container['decompoundQuery'] = $data['decompoundQuery']; + } + if (isset($data['enableRules'])) { + $this->container['enableRules'] = $data['enableRules']; + } + if (isset($data['enablePersonalization'])) { + $this->container['enablePersonalization'] = $data['enablePersonalization']; + } + if (isset($data['queryType'])) { + $this->container['queryType'] = $data['queryType']; + } + if (isset($data['removeWordsIfNoResults'])) { + $this->container['removeWordsIfNoResults'] = $data['removeWordsIfNoResults']; + } + if (isset($data['advancedSyntax'])) { + $this->container['advancedSyntax'] = $data['advancedSyntax']; + } + if (isset($data['optionalWords'])) { + $this->container['optionalWords'] = $data['optionalWords']; + } + if (isset($data['disableExactOnAttributes'])) { + $this->container['disableExactOnAttributes'] = $data['disableExactOnAttributes']; + } + if (isset($data['exactOnSingleWordQuery'])) { + $this->container['exactOnSingleWordQuery'] = $data['exactOnSingleWordQuery']; + } + if (isset($data['alternativesAsExact'])) { + $this->container['alternativesAsExact'] = $data['alternativesAsExact']; + } + if (isset($data['advancedSyntaxFeatures'])) { + $this->container['advancedSyntaxFeatures'] = $data['advancedSyntaxFeatures']; + } + if (isset($data['distinct'])) { + $this->container['distinct'] = $data['distinct']; + } + if (isset($data['synonyms'])) { + $this->container['synonyms'] = $data['synonyms']; + } + if (isset($data['replaceSynonymsInHighlight'])) { + $this->container['replaceSynonymsInHighlight'] = $data['replaceSynonymsInHighlight']; + } + if (isset($data['minProximity'])) { + $this->container['minProximity'] = $data['minProximity']; + } + if (isset($data['responseFields'])) { + $this->container['responseFields'] = $data['responseFields']; + } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } + if (isset($data['attributeCriteriaComputedByMinProximity'])) { + $this->container['attributeCriteriaComputedByMinProximity'] = $data['attributeCriteriaComputedByMinProximity']; + } + if (isset($data['renderingContent'])) { + $this->container['renderingContent'] = $data['renderingContent']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (isset($this->container['length']) && ($this->container['length'] > 1000)) { + $invalidProperties[] = "invalid value for 'length', must be smaller than or equal to 1000."; + } + + if (isset($this->container['length']) && ($this->container['length'] < 1)) { + $invalidProperties[] = "invalid value for 'length', must be bigger than or equal to 1."; + } + + if (isset($this->container['minimumAroundRadius']) && ($this->container['minimumAroundRadius'] < 1)) { + $invalidProperties[] = "invalid value for 'minimumAroundRadius', must be bigger than or equal to 1."; + } + + if (!isset($this->container['query']) || $this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (isset($this->container['typoTolerance']) && !in_array($this->container['typoTolerance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'typoTolerance', must be one of '%s'", + $this->container['typoTolerance'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getQueryTypeAllowableValues(); + if (isset($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'queryType', must be one of '%s'", + $this->container['queryType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (isset($this->container['removeWordsIfNoResults']) && !in_array($this->container['removeWordsIfNoResults'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $this->container['removeWordsIfNoResults'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (isset($this->container['exactOnSingleWordQuery']) && !in_array($this->container['exactOnSingleWordQuery'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $this->container['exactOnSingleWordQuery'], + implode("', '", $allowedValues) + ); + } + + if (isset($this->container['distinct']) && ($this->container['distinct'] > 4)) { + $invalidProperties[] = "invalid value for 'distinct', must be smaller than or equal to 4."; + } + + if (isset($this->container['distinct']) && ($this->container['distinct'] < 0)) { + $invalidProperties[] = "invalid value for 'distinct', must be bigger than or equal to 0."; + } + + if (isset($this->container['minProximity']) && ($this->container['minProximity'] > 7)) { + $invalidProperties[] = "invalid value for 'minProximity', must be smaller than or equal to 7."; + } + + if (isset($this->container['minProximity']) && ($this->container['minProximity'] < 1)) { + $invalidProperties[] = "invalid value for 'minProximity', must be bigger than or equal to 1."; + } + + if (isset($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets similarQuery + * + * @return string|null + */ + public function getSimilarQuery() + { + return $this->container['similarQuery'] ?? null; + } + + /** + * Sets similarQuery + * + * @param string|null $similarQuery overrides the query parameter and performs a more generic search that can be used to find \"similar\" results + * + * @return self + */ + public function setSimilarQuery($similarQuery) + { + $this->container['similarQuery'] = $similarQuery; + + return $this; + } + + /** + * Gets filters + * + * @return string|null + */ + public function getFilters() + { + return $this->container['filters'] ?? null; + } + + /** + * Sets filters + * + * @param string|null $filters filter the query with numeric, facet and/or tag filters + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets facetFilters + * + * @return string[]|null + */ + public function getFacetFilters() + { + return $this->container['facetFilters'] ?? null; + } + + /** + * Sets facetFilters + * + * @param string[]|null $facetFilters filter hits by facet value + * + * @return self + */ + public function setFacetFilters($facetFilters) + { + $this->container['facetFilters'] = $facetFilters; + + return $this; + } + + /** + * Gets optionalFilters + * + * @return string[]|null + */ + public function getOptionalFilters() + { + return $this->container['optionalFilters'] ?? null; + } + + /** + * Sets optionalFilters + * + * @param string[]|null $optionalFilters create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter + * + * @return self + */ + public function setOptionalFilters($optionalFilters) + { + $this->container['optionalFilters'] = $optionalFilters; + + return $this; + } + + /** + * Gets numericFilters + * + * @return string[]|null + */ + public function getNumericFilters() + { + return $this->container['numericFilters'] ?? null; + } + + /** + * Sets numericFilters + * + * @param string[]|null $numericFilters filter on numeric attributes + * + * @return self + */ + public function setNumericFilters($numericFilters) + { + $this->container['numericFilters'] = $numericFilters; + + return $this; + } + + /** + * Gets tagFilters + * + * @return string[]|null + */ + public function getTagFilters() + { + return $this->container['tagFilters'] ?? null; + } + + /** + * Sets tagFilters + * + * @param string[]|null $tagFilters filter hits by tags + * + * @return self + */ + public function setTagFilters($tagFilters) + { + $this->container['tagFilters'] = $tagFilters; + + return $this; + } + + /** + * Gets sumOrFiltersScores + * + * @return bool|null + */ + public function getSumOrFiltersScores() + { + return $this->container['sumOrFiltersScores'] ?? null; + } + + /** + * Sets sumOrFiltersScores + * + * @param bool|null $sumOrFiltersScores determines how to calculate the total score for filtering + * + * @return self + */ + public function setSumOrFiltersScores($sumOrFiltersScores) + { + $this->container['sumOrFiltersScores'] = $sumOrFiltersScores; + + return $this; + } + + /** + * Gets facets + * + * @return string[]|null + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets + * + * @param string[]|null $facets retrieve facets and their facet values + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets maxValuesPerFacet + * + * @return int|null + */ + public function getMaxValuesPerFacet() + { + return $this->container['maxValuesPerFacet'] ?? null; + } + + /** + * Sets maxValuesPerFacet + * + * @param int|null $maxValuesPerFacet maximum number of facet values to return for each facet during a regular search + * + * @return self + */ + public function setMaxValuesPerFacet($maxValuesPerFacet) + { + $this->container['maxValuesPerFacet'] = $maxValuesPerFacet; + + return $this; + } + + /** + * Gets facetingAfterDistinct + * + * @return bool|null + */ + public function getFacetingAfterDistinct() + { + return $this->container['facetingAfterDistinct'] ?? null; + } + + /** + * Sets facetingAfterDistinct + * + * @param bool|null $facetingAfterDistinct force faceting to be applied after de-duplication (via the Distinct setting) + * + * @return self + */ + public function setFacetingAfterDistinct($facetingAfterDistinct) + { + $this->container['facetingAfterDistinct'] = $facetingAfterDistinct; + + return $this; + } + + /** + * Gets sortFacetValuesBy + * + * @return string|null + */ + public function getSortFacetValuesBy() + { + return $this->container['sortFacetValuesBy'] ?? null; + } + + /** + * Sets sortFacetValuesBy + * + * @param string|null $sortFacetValuesBy controls how facet values are fetched + * + * @return self + */ + public function setSortFacetValuesBy($sortFacetValuesBy) + { + $this->container['sortFacetValuesBy'] = $sortFacetValuesBy; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int|null $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets offset + * + * @return int|null + */ + public function getOffset() + { + return $this->container['offset'] ?? null; + } + + /** + * Sets offset + * + * @param int|null $offset specify the offset of the first hit to return + * + * @return self + */ + public function setOffset($offset) + { + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets length + * + * @return int|null + */ + public function getLength() + { + return $this->container['length'] ?? null; + } + + /** + * Sets length + * + * @param int|null $length set the number of hits to retrieve (used only with offset) + * + * @return self + */ + public function setLength($length) + { + if (!is_null($length) && ($length > 1000)) { + throw new \InvalidArgumentException('invalid value for $length when calling SearchParamsObject., must be smaller than or equal to 1000.'); + } + if (!is_null($length) && ($length < 1)) { + throw new \InvalidArgumentException('invalid value for $length when calling SearchParamsObject., must be bigger than or equal to 1.'); + } + + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng'] ?? null; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng search for entries around a central geolocation, enabling a geo search within a circular area + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets aroundLatLngViaIP + * + * @return bool|null + */ + public function getAroundLatLngViaIP() + { + return $this->container['aroundLatLngViaIP'] ?? null; + } + + /** + * Sets aroundLatLngViaIP + * + * @param bool|null $aroundLatLngViaIP search for entries around a given location automatically computed from the requester's IP address + * + * @return self + */ + public function setAroundLatLngViaIP($aroundLatLngViaIP) + { + $this->container['aroundLatLngViaIP'] = $aroundLatLngViaIP; + + return $this; + } + + /** + * Gets aroundRadius + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\AroundRadius|null + */ + public function getAroundRadius() + { + return $this->container['aroundRadius'] ?? null; + } + + /** + * Sets aroundRadius + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\AroundRadius|null $aroundRadius aroundRadius + * + * @return self + */ + public function setAroundRadius($aroundRadius) + { + $this->container['aroundRadius'] = $aroundRadius; + + return $this; + } + + /** + * Gets aroundPrecision + * + * @return int|null + */ + public function getAroundPrecision() + { + return $this->container['aroundPrecision'] ?? null; + } + + /** + * Sets aroundPrecision + * + * @param int|null $aroundPrecision precision of geo search (in meters), to add grouping by geo location to the ranking formula + * + * @return self + */ + public function setAroundPrecision($aroundPrecision) + { + $this->container['aroundPrecision'] = $aroundPrecision; + + return $this; + } + + /** + * Gets minimumAroundRadius + * + * @return int|null + */ + public function getMinimumAroundRadius() + { + return $this->container['minimumAroundRadius'] ?? null; + } + + /** + * Sets minimumAroundRadius + * + * @param int|null $minimumAroundRadius minimum radius (in meters) used for a geo search when aroundRadius is not set + * + * @return self + */ + public function setMinimumAroundRadius($minimumAroundRadius) + { + if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { + throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling SearchParamsObject., must be bigger than or equal to 1.'); + } + + $this->container['minimumAroundRadius'] = $minimumAroundRadius; + + return $this; + } + + /** + * Gets insideBoundingBox + * + * @return float[]|null + */ + public function getInsideBoundingBox() + { + return $this->container['insideBoundingBox'] ?? null; + } + + /** + * Sets insideBoundingBox + * + * @param float[]|null $insideBoundingBox search inside a rectangular area (in geo coordinates) + * + * @return self + */ + public function setInsideBoundingBox($insideBoundingBox) + { + $this->container['insideBoundingBox'] = $insideBoundingBox; + + return $this; + } + + /** + * Gets insidePolygon + * + * @return float[]|null + */ + public function getInsidePolygon() + { + return $this->container['insidePolygon'] ?? null; + } + + /** + * Sets insidePolygon + * + * @param float[]|null $insidePolygon search inside a polygon (in geo coordinates) + * + * @return self + */ + public function setInsidePolygon($insidePolygon) + { + $this->container['insidePolygon'] = $insidePolygon; + + return $this; + } + + /** + * Gets naturalLanguages + * + * @return string[]|null + */ + public function getNaturalLanguages() + { + return $this->container['naturalLanguages'] ?? null; + } + + /** + * Sets naturalLanguages + * + * @param string[]|null $naturalLanguages This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. + * + * @return self + */ + public function setNaturalLanguages($naturalLanguages) + { + $this->container['naturalLanguages'] = $naturalLanguages; + + return $this; + } + + /** + * Gets ruleContexts + * + * @return string[]|null + */ + public function getRuleContexts() + { + return $this->container['ruleContexts'] ?? null; + } + + /** + * Sets ruleContexts + * + * @param string[]|null $ruleContexts enables contextual rules + * + * @return self + */ + public function setRuleContexts($ruleContexts) + { + $this->container['ruleContexts'] = $ruleContexts; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int|null + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact'] ?? null; + } + + /** + * Sets personalizationImpact + * + * @param int|null $personalizationImpact define the impact of the Personalization feature + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + return $this; + } + + /** + * Gets userToken + * + * @return string|null + */ + public function getUserToken() + { + return $this->container['userToken'] ?? null; + } + + /** + * Sets userToken + * + * @param string|null $userToken associates a certain user token with the current search + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets getRankingInfo + * + * @return bool|null + */ + public function getGetRankingInfo() + { + return $this->container['getRankingInfo'] ?? null; + } + + /** + * Sets getRankingInfo + * + * @param bool|null $getRankingInfo retrieve detailed ranking information + * + * @return self + */ + public function setGetRankingInfo($getRankingInfo) + { + $this->container['getRankingInfo'] = $getRankingInfo; + + return $this; + } + + /** + * Gets clickAnalytics + * + * @return bool|null + */ + public function getClickAnalytics() + { + return $this->container['clickAnalytics'] ?? null; + } + + /** + * Sets clickAnalytics + * + * @param bool|null $clickAnalytics enable the Click Analytics feature + * + * @return self + */ + public function setClickAnalytics($clickAnalytics) + { + $this->container['clickAnalytics'] = $clickAnalytics; + + return $this; + } + + /** + * Gets analytics + * + * @return bool|null + */ + public function getAnalytics() + { + return $this->container['analytics'] ?? null; + } + + /** + * Sets analytics + * + * @param bool|null $analytics whether the current query will be taken into account in the Analytics + * + * @return self + */ + public function setAnalytics($analytics) + { + $this->container['analytics'] = $analytics; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[]|null + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags'] ?? null; + } + + /** + * Sets analyticsTags + * + * @param string[]|null $analyticsTags list of tags to apply to the query for analytics purposes + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets percentileComputation + * + * @return bool|null + */ + public function getPercentileComputation() + { + return $this->container['percentileComputation'] ?? null; + } + + /** + * Sets percentileComputation + * + * @param bool|null $percentileComputation whether to include or exclude a query from the processing-time percentile computation + * + * @return self + */ + public function setPercentileComputation($percentileComputation) + { + $this->container['percentileComputation'] = $percentileComputation; + + return $this; + } + + /** + * Gets enableABTest + * + * @return bool|null + */ + public function getEnableABTest() + { + return $this->container['enableABTest'] ?? null; + } + + /** + * Sets enableABTest + * + * @param bool|null $enableABTest whether this search should participate in running AB tests + * + * @return self + */ + public function setEnableABTest($enableABTest) + { + $this->container['enableABTest'] = $enableABTest; + + return $this; + } + + /** + * Gets enableReRanking + * + * @return bool|null + */ + public function getEnableReRanking() + { + return $this->container['enableReRanking'] ?? null; + } + + /** + * Sets enableReRanking + * + * @param bool|null $enableReRanking whether this search should use AI Re-Ranking + * + * @return self + */ + public function setEnableReRanking($enableReRanking) + { + $this->container['enableReRanking'] = $enableReRanking; + + return $this; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets searchableAttributes + * + * @return string[]|null + */ + public function getSearchableAttributes() + { + return $this->container['searchableAttributes'] ?? null; + } + + /** + * Sets searchableAttributes + * + * @param string[]|null $searchableAttributes the complete list of attributes used for searching + * + * @return self + */ + public function setSearchableAttributes($searchableAttributes) + { + $this->container['searchableAttributes'] = $searchableAttributes; + + return $this; + } + + /** + * Gets attributesForFaceting + * + * @return string[]|null + */ + public function getAttributesForFaceting() + { + return $this->container['attributesForFaceting'] ?? null; + } + + /** + * Sets attributesForFaceting + * + * @param string[]|null $attributesForFaceting the complete list of attributes that will be used for faceting + * + * @return self + */ + public function setAttributesForFaceting($attributesForFaceting) + { + $this->container['attributesForFaceting'] = $attributesForFaceting; + + return $this; + } + + /** + * Gets unretrievableAttributes + * + * @return string[]|null + */ + public function getUnretrievableAttributes() + { + return $this->container['unretrievableAttributes'] ?? null; + } + + /** + * Sets unretrievableAttributes + * + * @param string[]|null $unretrievableAttributes list of attributes that can't be retrieved at query time + * + * @return self + */ + public function setUnretrievableAttributes($unretrievableAttributes) + { + $this->container['unretrievableAttributes'] = $unretrievableAttributes; + + return $this; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve'] ?? null; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve this parameter controls which attributes to retrieve and which not to retrieve + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets restrictSearchableAttributes + * + * @return string[]|null + */ + public function getRestrictSearchableAttributes() + { + return $this->container['restrictSearchableAttributes'] ?? null; + } + + /** + * Sets restrictSearchableAttributes + * + * @param string[]|null $restrictSearchableAttributes restricts a given query to look in only a subset of your searchable attributes + * + * @return self + */ + public function setRestrictSearchableAttributes($restrictSearchableAttributes) + { + $this->container['restrictSearchableAttributes'] = $restrictSearchableAttributes; + + return $this; + } + + /** + * Gets ranking + * + * @return string[]|null + */ + public function getRanking() + { + return $this->container['ranking'] ?? null; + } + + /** + * Sets ranking + * + * @param string[]|null $ranking controls how Algolia should sort your results + * + * @return self + */ + public function setRanking($ranking) + { + $this->container['ranking'] = $ranking; + + return $this; + } + + /** + * Gets customRanking + * + * @return string[]|null + */ + public function getCustomRanking() + { + return $this->container['customRanking'] ?? null; + } + + /** + * Sets customRanking + * + * @param string[]|null $customRanking specifies the custom ranking criterion + * + * @return self + */ + public function setCustomRanking($customRanking) + { + $this->container['customRanking'] = $customRanking; + + return $this; + } + + /** + * Gets relevancyStrictness + * + * @return int|null + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness'] ?? null; + } + + /** + * Sets relevancyStrictness + * + * @param int|null $relevancyStrictness controls the relevancy threshold below which less relevant results aren't included in the results + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets attributesToHighlight + * + * @return string[]|null + */ + public function getAttributesToHighlight() + { + return $this->container['attributesToHighlight'] ?? null; + } + + /** + * Sets attributesToHighlight + * + * @param string[]|null $attributesToHighlight list of attributes to highlight + * + * @return self + */ + public function setAttributesToHighlight($attributesToHighlight) + { + $this->container['attributesToHighlight'] = $attributesToHighlight; + + return $this; + } + + /** + * Gets attributesToSnippet + * + * @return string[]|null + */ + public function getAttributesToSnippet() + { + return $this->container['attributesToSnippet'] ?? null; + } + + /** + * Sets attributesToSnippet + * + * @param string[]|null $attributesToSnippet list of attributes to snippet, with an optional maximum number of words to snippet + * + * @return self + */ + public function setAttributesToSnippet($attributesToSnippet) + { + $this->container['attributesToSnippet'] = $attributesToSnippet; + + return $this; + } + + /** + * Gets highlightPreTag + * + * @return string|null + */ + public function getHighlightPreTag() + { + return $this->container['highlightPreTag'] ?? null; + } + + /** + * Sets highlightPreTag + * + * @param string|null $highlightPreTag the HTML string to insert before the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPreTag($highlightPreTag) + { + $this->container['highlightPreTag'] = $highlightPreTag; + + return $this; + } + + /** + * Gets highlightPostTag + * + * @return string|null + */ + public function getHighlightPostTag() + { + return $this->container['highlightPostTag'] ?? null; + } + + /** + * Sets highlightPostTag + * + * @param string|null $highlightPostTag the HTML string to insert after the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPostTag($highlightPostTag) + { + $this->container['highlightPostTag'] = $highlightPostTag; + + return $this; + } + + /** + * Gets snippetEllipsisText + * + * @return string|null + */ + public function getSnippetEllipsisText() + { + return $this->container['snippetEllipsisText'] ?? null; + } + + /** + * Sets snippetEllipsisText + * + * @param string|null $snippetEllipsisText string used as an ellipsis indicator when a snippet is truncated + * + * @return self + */ + public function setSnippetEllipsisText($snippetEllipsisText) + { + $this->container['snippetEllipsisText'] = $snippetEllipsisText; + + return $this; + } + + /** + * Gets restrictHighlightAndSnippetArrays + * + * @return bool|null + */ + public function getRestrictHighlightAndSnippetArrays() + { + return $this->container['restrictHighlightAndSnippetArrays'] ?? null; + } + + /** + * Sets restrictHighlightAndSnippetArrays + * + * @param bool|null $restrictHighlightAndSnippetArrays restrict highlighting and snippeting to items that matched the query + * + * @return self + */ + public function setRestrictHighlightAndSnippetArrays($restrictHighlightAndSnippetArrays) + { + $this->container['restrictHighlightAndSnippetArrays'] = $restrictHighlightAndSnippetArrays; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets minWordSizefor1Typo + * + * @return int|null + */ + public function getMinWordSizefor1Typo() + { + return $this->container['minWordSizefor1Typo'] ?? null; + } + + /** + * Sets minWordSizefor1Typo + * + * @param int|null $minWordSizefor1Typo minimum number of characters a word in the query string must contain to accept matches with 1 typo + * + * @return self + */ + public function setMinWordSizefor1Typo($minWordSizefor1Typo) + { + $this->container['minWordSizefor1Typo'] = $minWordSizefor1Typo; + + return $this; + } + + /** + * Gets minWordSizefor2Typos + * + * @return int|null + */ + public function getMinWordSizefor2Typos() + { + return $this->container['minWordSizefor2Typos'] ?? null; + } + + /** + * Sets minWordSizefor2Typos + * + * @param int|null $minWordSizefor2Typos minimum number of characters a word in the query string must contain to accept matches with 2 typos + * + * @return self + */ + public function setMinWordSizefor2Typos($minWordSizefor2Typos) + { + $this->container['minWordSizefor2Typos'] = $minWordSizefor2Typos; + + return $this; + } + + /** + * Gets typoTolerance + * + * @return string|null + */ + public function getTypoTolerance() + { + return $this->container['typoTolerance'] ?? null; + } + + /** + * Sets typoTolerance + * + * @param string|null $typoTolerance controls whether typo tolerance is enabled and how it is applied + * + * @return self + */ + public function setTypoTolerance($typoTolerance) + { + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($typoTolerance) && !in_array($typoTolerance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'typoTolerance', must be one of '%s'", + $typoTolerance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['typoTolerance'] = $typoTolerance; + + return $this; + } + + /** + * Gets allowTyposOnNumericTokens + * + * @return bool|null + */ + public function getAllowTyposOnNumericTokens() + { + return $this->container['allowTyposOnNumericTokens'] ?? null; + } + + /** + * Sets allowTyposOnNumericTokens + * + * @param bool|null $allowTyposOnNumericTokens whether to allow typos on numbers (\"numeric tokens\") in the query string + * + * @return self + */ + public function setAllowTyposOnNumericTokens($allowTyposOnNumericTokens) + { + $this->container['allowTyposOnNumericTokens'] = $allowTyposOnNumericTokens; + + return $this; + } + + /** + * Gets disableTypoToleranceOnAttributes + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnAttributes() + { + return $this->container['disableTypoToleranceOnAttributes'] ?? null; + } + + /** + * Sets disableTypoToleranceOnAttributes + * + * @param string[]|null $disableTypoToleranceOnAttributes list of attributes on which you want to disable typo tolerance + * + * @return self + */ + public function setDisableTypoToleranceOnAttributes($disableTypoToleranceOnAttributes) + { + $this->container['disableTypoToleranceOnAttributes'] = $disableTypoToleranceOnAttributes; + + return $this; + } + + /** + * Gets separatorsToIndex + * + * @return string|null + */ + public function getSeparatorsToIndex() + { + return $this->container['separatorsToIndex'] ?? null; + } + + /** + * Sets separatorsToIndex + * + * @param string|null $separatorsToIndex control which separators are indexed + * + * @return self + */ + public function setSeparatorsToIndex($separatorsToIndex) + { + $this->container['separatorsToIndex'] = $separatorsToIndex; + + return $this; + } + + /** + * Gets ignorePlurals + * + * @return string|null + */ + public function getIgnorePlurals() + { + return $this->container['ignorePlurals'] ?? null; + } + + /** + * Sets ignorePlurals + * + * @param string|null $ignorePlurals treats singular, plurals, and other forms of declensions as matching terms + * + * @return self + */ + public function setIgnorePlurals($ignorePlurals) + { + $this->container['ignorePlurals'] = $ignorePlurals; + + return $this; + } + + /** + * Gets removeStopWords + * + * @return string|null + */ + public function getRemoveStopWords() + { + return $this->container['removeStopWords'] ?? null; + } + + /** + * Sets removeStopWords + * + * @param string|null $removeStopWords removes stop (common) words from the query before executing it + * + * @return self + */ + public function setRemoveStopWords($removeStopWords) + { + $this->container['removeStopWords'] = $removeStopWords; + + return $this; + } + + /** + * Gets keepDiacriticsOnCharacters + * + * @return string|null + */ + public function getKeepDiacriticsOnCharacters() + { + return $this->container['keepDiacriticsOnCharacters'] ?? null; + } + + /** + * Sets keepDiacriticsOnCharacters + * + * @param string|null $keepDiacriticsOnCharacters list of characters that the engine shouldn't automatically normalize + * + * @return self + */ + public function setKeepDiacriticsOnCharacters($keepDiacriticsOnCharacters) + { + $this->container['keepDiacriticsOnCharacters'] = $keepDiacriticsOnCharacters; + + return $this; + } + + /** + * Gets queryLanguages + * + * @return string[]|null + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages'] ?? null; + } + + /** + * Sets queryLanguages + * + * @param string[]|null $queryLanguages sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets decompoundQuery + * + * @return bool|null + */ + public function getDecompoundQuery() + { + return $this->container['decompoundQuery'] ?? null; + } + + /** + * Sets decompoundQuery + * + * @param bool|null $decompoundQuery splits compound words into their composing atoms in the query + * + * @return self + */ + public function setDecompoundQuery($decompoundQuery) + { + $this->container['decompoundQuery'] = $decompoundQuery; + + return $this; + } + + /** + * Gets enableRules + * + * @return bool|null + */ + public function getEnableRules() + { + return $this->container['enableRules'] ?? null; + } + + /** + * Sets enableRules + * + * @param bool|null $enableRules whether Rules should be globally enabled + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets enablePersonalization + * + * @return bool|null + */ + public function getEnablePersonalization() + { + return $this->container['enablePersonalization'] ?? null; + } + + /** + * Sets enablePersonalization + * + * @param bool|null $enablePersonalization enable the Personalization feature + * + * @return self + */ + public function setEnablePersonalization($enablePersonalization) + { + $this->container['enablePersonalization'] = $enablePersonalization; + + return $this; + } + + /** + * Gets queryType + * + * @return string|null + */ + public function getQueryType() + { + return $this->container['queryType'] ?? null; + } + + /** + * Sets queryType + * + * @param string|null $queryType controls if and how query words are interpreted as prefixes + * + * @return self + */ + public function setQueryType($queryType) + { + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($queryType) && !in_array($queryType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'queryType', must be one of '%s'", + $queryType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['queryType'] = $queryType; + + return $this; + } + + /** + * Gets removeWordsIfNoResults + * + * @return string|null + */ + public function getRemoveWordsIfNoResults() + { + return $this->container['removeWordsIfNoResults'] ?? null; + } + + /** + * Sets removeWordsIfNoResults + * + * @param string|null $removeWordsIfNoResults selects a strategy to remove words from the query when it doesn't match any hits + * + * @return self + */ + public function setRemoveWordsIfNoResults($removeWordsIfNoResults) + { + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($removeWordsIfNoResults) && !in_array($removeWordsIfNoResults, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $removeWordsIfNoResults, + implode("', '", $allowedValues) + ) + ); + } + $this->container['removeWordsIfNoResults'] = $removeWordsIfNoResults; + + return $this; + } + + /** + * Gets advancedSyntax + * + * @return bool|null + */ + public function getAdvancedSyntax() + { + return $this->container['advancedSyntax'] ?? null; + } + + /** + * Sets advancedSyntax + * + * @param bool|null $advancedSyntax enables the advanced query syntax + * + * @return self + */ + public function setAdvancedSyntax($advancedSyntax) + { + $this->container['advancedSyntax'] = $advancedSyntax; + + return $this; + } + + /** + * Gets optionalWords + * + * @return string[]|null + */ + public function getOptionalWords() + { + return $this->container['optionalWords'] ?? null; + } + + /** + * Sets optionalWords + * + * @param string[]|null $optionalWords a list of words that should be considered as optional when found in the query + * + * @return self + */ + public function setOptionalWords($optionalWords) + { + $this->container['optionalWords'] = $optionalWords; + + return $this; + } + + /** + * Gets disableExactOnAttributes + * + * @return string[]|null + */ + public function getDisableExactOnAttributes() + { + return $this->container['disableExactOnAttributes'] ?? null; + } + + /** + * Sets disableExactOnAttributes + * + * @param string[]|null $disableExactOnAttributes list of attributes on which you want to disable the exact ranking criterion + * + * @return self + */ + public function setDisableExactOnAttributes($disableExactOnAttributes) + { + $this->container['disableExactOnAttributes'] = $disableExactOnAttributes; + + return $this; + } + + /** + * Gets exactOnSingleWordQuery + * + * @return string|null + */ + public function getExactOnSingleWordQuery() + { + return $this->container['exactOnSingleWordQuery'] ?? null; + } + + /** + * Sets exactOnSingleWordQuery + * + * @param string|null $exactOnSingleWordQuery controls how the exact ranking criterion is computed when the query contains only one word + * + * @return self + */ + public function setExactOnSingleWordQuery($exactOnSingleWordQuery) + { + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($exactOnSingleWordQuery) && !in_array($exactOnSingleWordQuery, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $exactOnSingleWordQuery, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exactOnSingleWordQuery'] = $exactOnSingleWordQuery; + + return $this; + } + + /** + * Gets alternativesAsExact + * + * @return string[]|null + */ + public function getAlternativesAsExact() + { + return $this->container['alternativesAsExact'] ?? null; + } + + /** + * Sets alternativesAsExact + * + * @param string[]|null $alternativesAsExact list of alternatives that should be considered an exact match by the exact ranking criterion + * + * @return self + */ + public function setAlternativesAsExact($alternativesAsExact) + { + $allowedValues = $this->getAlternativesAsExactAllowableValues(); + if (!is_null($alternativesAsExact) && array_diff($alternativesAsExact, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'alternativesAsExact', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['alternativesAsExact'] = $alternativesAsExact; + + return $this; + } + + /** + * Gets advancedSyntaxFeatures + * + * @return string[]|null + */ + public function getAdvancedSyntaxFeatures() + { + return $this->container['advancedSyntaxFeatures'] ?? null; + } + + /** + * Sets advancedSyntaxFeatures + * + * @param string[]|null $advancedSyntaxFeatures allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled + * + * @return self + */ + public function setAdvancedSyntaxFeatures($advancedSyntaxFeatures) + { + $allowedValues = $this->getAdvancedSyntaxFeaturesAllowableValues(); + if (!is_null($advancedSyntaxFeatures) && array_diff($advancedSyntaxFeatures, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'advancedSyntaxFeatures', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['advancedSyntaxFeatures'] = $advancedSyntaxFeatures; + + return $this; + } + + /** + * Gets distinct + * + * @return int|null + */ + public function getDistinct() + { + return $this->container['distinct'] ?? null; + } + + /** + * Sets distinct + * + * @param int|null $distinct enables de-duplication or grouping of results + * + * @return self + */ + public function setDistinct($distinct) + { + if (!is_null($distinct) && ($distinct > 4)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling SearchParamsObject., must be smaller than or equal to 4.'); + } + if (!is_null($distinct) && ($distinct < 0)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling SearchParamsObject., must be bigger than or equal to 0.'); + } + + $this->container['distinct'] = $distinct; + + return $this; + } + + /** + * Gets synonyms + * + * @return bool|null + */ + public function getSynonyms() + { + return $this->container['synonyms'] ?? null; + } + + /** + * Sets synonyms + * + * @param bool|null $synonyms whether to take into account an index's synonyms for a particular search + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets replaceSynonymsInHighlight + * + * @return bool|null + */ + public function getReplaceSynonymsInHighlight() + { + return $this->container['replaceSynonymsInHighlight'] ?? null; + } + + /** + * Sets replaceSynonymsInHighlight + * + * @param bool|null $replaceSynonymsInHighlight whether to highlight and snippet the original word that matches the synonym or the synonym itself + * + * @return self + */ + public function setReplaceSynonymsInHighlight($replaceSynonymsInHighlight) + { + $this->container['replaceSynonymsInHighlight'] = $replaceSynonymsInHighlight; + + return $this; + } + + /** + * Gets minProximity + * + * @return int|null + */ + public function getMinProximity() + { + return $this->container['minProximity'] ?? null; + } + + /** + * Sets minProximity + * + * @param int|null $minProximity precision of the proximity ranking criterion + * + * @return self + */ + public function setMinProximity($minProximity) + { + if (!is_null($minProximity) && ($minProximity > 7)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling SearchParamsObject., must be smaller than or equal to 7.'); + } + if (!is_null($minProximity) && ($minProximity < 1)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling SearchParamsObject., must be bigger than or equal to 1.'); + } + + $this->container['minProximity'] = $minProximity; + + return $this; + } + + /** + * Gets responseFields + * + * @return string[]|null + */ + public function getResponseFields() + { + return $this->container['responseFields'] ?? null; + } + + /** + * Sets responseFields + * + * @param string[]|null $responseFields Choose which fields to return in the API response. This parameters applies to search and browse queries. + * + * @return self + */ + public function setResponseFields($responseFields) + { + $this->container['responseFields'] = $responseFields; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling SearchParamsObject., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets attributeCriteriaComputedByMinProximity + * + * @return bool|null + */ + public function getAttributeCriteriaComputedByMinProximity() + { + return $this->container['attributeCriteriaComputedByMinProximity'] ?? null; + } + + /** + * Sets attributeCriteriaComputedByMinProximity + * + * @param bool|null $attributeCriteriaComputedByMinProximity when attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage + * + * @return self + */ + public function setAttributeCriteriaComputedByMinProximity($attributeCriteriaComputedByMinProximity) + { + $this->container['attributeCriteriaComputedByMinProximity'] = $attributeCriteriaComputedByMinProximity; + + return $this; + } + + /** + * Gets renderingContent + * + * @return object|null + */ + public function getRenderingContent() + { + return $this->container['renderingContent'] ?? null; + } + + /** + * Sets renderingContent + * + * @param object|null $renderingContent Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/SnippetResult.php b/clients/algoliasearch-client-php/lib/Model/Recommend/SnippetResult.php new file mode 100644 index 0000000000..a5f4008bbf --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/SnippetResult.php @@ -0,0 +1,275 @@ + 'string', + 'matchLevel' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'value' => null, + 'matchLevel' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'matchLevel' => 'setMatchLevel', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'matchLevel' => 'getMatchLevel', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + const MATCH_LEVEL_NONE = 'none'; + const MATCH_LEVEL_PARTIAL = 'partial'; + const MATCH_LEVEL_FULL = 'full'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMatchLevelAllowableValues() + { + return [ + self::MATCH_LEVEL_NONE, + self::MATCH_LEVEL_PARTIAL, + self::MATCH_LEVEL_FULL, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['value'])) { + $this->container['value'] = $data['value']; + } + if (isset($data['matchLevel'])) { + $this->container['matchLevel'] = $data['matchLevel']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMatchLevelAllowableValues(); + if (isset($this->container['matchLevel']) && !in_array($this->container['matchLevel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'matchLevel', must be one of '%s'", + $this->container['matchLevel'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value + * + * @param string|null $value markup text with occurrences highlighted + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matchLevel + * + * @return string|null + */ + public function getMatchLevel() + { + return $this->container['matchLevel'] ?? null; + } + + /** + * Sets matchLevel + * + * @param string|null $matchLevel indicates how well the attribute matched the search query + * + * @return self + */ + public function setMatchLevel($matchLevel) + { + $allowedValues = $this->getMatchLevelAllowableValues(); + if (!is_null($matchLevel) && !in_array($matchLevel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'matchLevel', must be one of '%s'", + $matchLevel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['matchLevel'] = $matchLevel; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Recommend/TrendingModels.php b/clients/algoliasearch-client-php/lib/Model/Recommend/TrendingModels.php new file mode 100644 index 0000000000..c3ee097dc2 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Recommend/TrendingModels.php @@ -0,0 +1,35 @@ + '\Algolia\AlgoliaSearch\Model\Recommend\TrendingModels', + 'facetName' => 'string', + 'facetValue' => 'string', + 'indexName' => 'string', + 'threshold' => 'int', + 'maxRecommendations' => 'int', + 'queryParameters' => '\Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject', + 'fallbackParameters' => '\Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'model' => null, + 'facetName' => null, + 'facetValue' => null, + 'indexName' => null, + 'threshold' => null, + 'maxRecommendations' => null, + 'queryParameters' => null, + 'fallbackParameters' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'model' => 'setModel', + 'facetName' => 'setFacetName', + 'facetValue' => 'setFacetValue', + 'indexName' => 'setIndexName', + 'threshold' => 'setThreshold', + 'maxRecommendations' => 'setMaxRecommendations', + 'queryParameters' => 'setQueryParameters', + 'fallbackParameters' => 'setFallbackParameters', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'model' => 'getModel', + 'facetName' => 'getFacetName', + 'facetValue' => 'getFacetValue', + 'indexName' => 'getIndexName', + 'threshold' => 'getThreshold', + 'maxRecommendations' => 'getMaxRecommendations', + 'queryParameters' => 'getQueryParameters', + 'fallbackParameters' => 'getFallbackParameters', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['model'])) { + $this->container['model'] = $data['model']; + } + if (isset($data['facetName'])) { + $this->container['facetName'] = $data['facetName']; + } + if (isset($data['facetValue'])) { + $this->container['facetValue'] = $data['facetValue']; + } + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + if (isset($data['threshold'])) { + $this->container['threshold'] = $data['threshold']; + } + if (isset($data['maxRecommendations'])) { + $this->container['maxRecommendations'] = $data['maxRecommendations']; + } + if (isset($data['queryParameters'])) { + $this->container['queryParameters'] = $data['queryParameters']; + } + if (isset($data['fallbackParameters'])) { + $this->container['fallbackParameters'] = $data['fallbackParameters']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['model']) || $this->container['model'] === null) { + $invalidProperties[] = "'model' can't be null"; + } + if (!isset($this->container['indexName']) || $this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + if (!isset($this->container['threshold']) || $this->container['threshold'] === null) { + $invalidProperties[] = "'threshold' can't be null"; + } + if (($this->container['threshold'] > 100)) { + $invalidProperties[] = "invalid value for 'threshold', must be smaller than or equal to 100."; + } + + if (($this->container['threshold'] < 0)) { + $invalidProperties[] = "invalid value for 'threshold', must be bigger than or equal to 0."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets model + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\TrendingModels + */ + public function getModel() + { + return $this->container['model'] ?? null; + } + + /** + * Sets model + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\TrendingModels $model model + * + * @return self + */ + public function setModel($model) + { + $this->container['model'] = $model; + + return $this; + } + + /** + * Gets facetName + * + * @return string|null + */ + public function getFacetName() + { + return $this->container['facetName'] ?? null; + } + + /** + * Sets facetName + * + * @param string|null $facetName the facet name to use for trending models + * + * @return self + */ + public function setFacetName($facetName) + { + $this->container['facetName'] = $facetName; + + return $this; + } + + /** + * Gets facetValue + * + * @return string|null + */ + public function getFacetValue() + { + return $this->container['facetValue'] ?? null; + } + + /** + * Sets facetValue + * + * @param string|null $facetValue the facet value to use for trending models + * + * @return self + */ + public function setFacetValue($facetValue) + { + $this->container['facetValue'] = $facetValue; + + return $this; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string $indexName the Algolia index name + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets threshold + * + * @return int + */ + public function getThreshold() + { + return $this->container['threshold'] ?? null; + } + + /** + * Sets threshold + * + * @param int $threshold the threshold to use when filtering recommendations by their score + * + * @return self + */ + public function setThreshold($threshold) + { + if (($threshold > 100)) { + throw new \InvalidArgumentException('invalid value for $threshold when calling TrendingRequest., must be smaller than or equal to 100.'); + } + if (($threshold < 0)) { + throw new \InvalidArgumentException('invalid value for $threshold when calling TrendingRequest., must be bigger than or equal to 0.'); + } + + $this->container['threshold'] = $threshold; + + return $this; + } + + /** + * Gets maxRecommendations + * + * @return int|null + */ + public function getMaxRecommendations() + { + return $this->container['maxRecommendations'] ?? null; + } + + /** + * Sets maxRecommendations + * + * @param int|null $maxRecommendations The max number of recommendations to retrieve. If it's set to 0, all the recommendations of the objectID may be returned. + * + * @return self + */ + public function setMaxRecommendations($maxRecommendations) + { + $this->container['maxRecommendations'] = $maxRecommendations; + + return $this; + } + + /** + * Gets queryParameters + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null + */ + public function getQueryParameters() + { + return $this->container['queryParameters'] ?? null; + } + + /** + * Sets queryParameters + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null $queryParameters queryParameters + * + * @return self + */ + public function setQueryParameters($queryParameters) + { + $this->container['queryParameters'] = $queryParameters; + + return $this; + } + + /** + * Gets fallbackParameters + * + * @return \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null + */ + public function getFallbackParameters() + { + return $this->container['fallbackParameters'] ?? null; + } + + /** + * Sets fallbackParameters + * + * @param \Algolia\AlgoliaSearch\Model\Recommend\SearchParamsObject|null $fallbackParameters fallbackParameters + * + * @return self + */ + public function setFallbackParameters($fallbackParameters) + { + $this->container['fallbackParameters'] = $fallbackParameters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/Acl.php b/clients/algoliasearch-client-php/lib/Model/Search/Acl.php new file mode 100644 index 0000000000..0ced87e34d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/Acl.php @@ -0,0 +1,69 @@ + 'string', + 'createdAt' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'key' => null, + 'createdAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'key' => 'setKey', + 'createdAt' => 'setCreatedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'key' => 'getKey', + 'createdAt' => 'getCreatedAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['key'])) { + $this->container['key'] = $data['key']; + } + if (isset($data['createdAt'])) { + $this->container['createdAt'] = $data['createdAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['key']) || $this->container['key'] === null) { + $invalidProperties[] = "'key' can't be null"; + } + if (!isset($this->container['createdAt']) || $this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets key + * + * @return string + */ + public function getKey() + { + return $this->container['key'] ?? null; + } + + /** + * Sets key + * + * @param string $key key string + * + * @return self + */ + public function setKey($key) + { + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets createdAt + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['createdAt'] ?? null; + } + + /** + * Sets createdAt + * + * @param string $createdAt date of creation (ISO-8601 format) + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/Anchoring.php b/clients/algoliasearch-client-php/lib/Model/Search/Anchoring.php new file mode 100644 index 0000000000..3e71aba567 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/Anchoring.php @@ -0,0 +1,41 @@ + '\Algolia\AlgoliaSearch\Model\Search\Acl[]', + 'description' => 'string', + 'indexes' => 'string[]', + 'maxHitsPerQuery' => 'int', + 'maxQueriesPerIPPerHour' => 'int', + 'queryParameters' => 'string', + 'referers' => 'string[]', + 'validity' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'acl' => null, + 'description' => null, + 'indexes' => null, + 'maxHitsPerQuery' => null, + 'maxQueriesPerIPPerHour' => null, + 'queryParameters' => null, + 'referers' => null, + 'validity' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acl' => 'setAcl', + 'description' => 'setDescription', + 'indexes' => 'setIndexes', + 'maxHitsPerQuery' => 'setMaxHitsPerQuery', + 'maxQueriesPerIPPerHour' => 'setMaxQueriesPerIPPerHour', + 'queryParameters' => 'setQueryParameters', + 'referers' => 'setReferers', + 'validity' => 'setValidity', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acl' => 'getAcl', + 'description' => 'getDescription', + 'indexes' => 'getIndexes', + 'maxHitsPerQuery' => 'getMaxHitsPerQuery', + 'maxQueriesPerIPPerHour' => 'getMaxQueriesPerIPPerHour', + 'queryParameters' => 'getQueryParameters', + 'referers' => 'getReferers', + 'validity' => 'getValidity', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['acl'])) { + $this->container['acl'] = $data['acl']; + } + if (isset($data['description'])) { + $this->container['description'] = $data['description']; + } + if (isset($data['indexes'])) { + $this->container['indexes'] = $data['indexes']; + } + if (isset($data['maxHitsPerQuery'])) { + $this->container['maxHitsPerQuery'] = $data['maxHitsPerQuery']; + } + if (isset($data['maxQueriesPerIPPerHour'])) { + $this->container['maxQueriesPerIPPerHour'] = $data['maxQueriesPerIPPerHour']; + } + if (isset($data['queryParameters'])) { + $this->container['queryParameters'] = $data['queryParameters']; + } + if (isset($data['referers'])) { + $this->container['referers'] = $data['referers']; + } + if (isset($data['validity'])) { + $this->container['validity'] = $data['validity']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['acl']) || $this->container['acl'] === null) { + $invalidProperties[] = "'acl' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets acl + * + * @return \Algolia\AlgoliaSearch\Model\Search\Acl[] + */ + public function getAcl() + { + return $this->container['acl'] ?? null; + } + + /** + * Sets acl + * + * @param \Algolia\AlgoliaSearch\Model\Search\Acl[] $acl set of permissions associated with the key + * + * @return self + */ + public function setAcl($acl) + { + $this->container['acl'] = $acl; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description'] ?? null; + } + + /** + * Sets description + * + * @param string|null $description A comment used to identify a key more easily in the dashboard. It is not interpreted by the API. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets indexes + * + * @return string[]|null + */ + public function getIndexes() + { + return $this->container['indexes'] ?? null; + } + + /** + * Sets indexes + * + * @param string[]|null $indexes Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed. + * + * @return self + */ + public function setIndexes($indexes) + { + $this->container['indexes'] = $indexes; + + return $this; + } + + /** + * Gets maxHitsPerQuery + * + * @return int|null + */ + public function getMaxHitsPerQuery() + { + return $this->container['maxHitsPerQuery'] ?? null; + } + + /** + * Sets maxHitsPerQuery + * + * @param int|null $maxHitsPerQuery Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. + * + * @return self + */ + public function setMaxHitsPerQuery($maxHitsPerQuery) + { + $this->container['maxHitsPerQuery'] = $maxHitsPerQuery; + + return $this; + } + + /** + * Gets maxQueriesPerIPPerHour + * + * @return int|null + */ + public function getMaxQueriesPerIPPerHour() + { + return $this->container['maxQueriesPerIPPerHour'] ?? null; + } + + /** + * Sets maxQueriesPerIPPerHour + * + * @param int|null $maxQueriesPerIPPerHour maximum number of API calls per hour allowed from a given IP address or a user token + * + * @return self + */ + public function setMaxQueriesPerIPPerHour($maxQueriesPerIPPerHour) + { + $this->container['maxQueriesPerIPPerHour'] = $maxQueriesPerIPPerHour; + + return $this; + } + + /** + * Gets queryParameters + * + * @return string|null + */ + public function getQueryParameters() + { + return $this->container['queryParameters'] ?? null; + } + + /** + * Sets queryParameters + * + * @param string|null $queryParameters URL-encoded query string. Force some query parameters to be applied for each query made with this API key. + * + * @return self + */ + public function setQueryParameters($queryParameters) + { + $this->container['queryParameters'] = $queryParameters; + + return $this; + } + + /** + * Gets referers + * + * @return string[]|null + */ + public function getReferers() + { + return $this->container['referers'] ?? null; + } + + /** + * Sets referers + * + * @param string[]|null $referers Restrict this new API key to specific referers. If empty or blank, defaults to all referers. + * + * @return self + */ + public function setReferers($referers) + { + $this->container['referers'] = $referers; + + return $this; + } + + /** + * Gets validity + * + * @return int|null + */ + public function getValidity() + { + return $this->container['validity'] ?? null; + } + + /** + * Sets validity + * + * @param int|null $validity Validity limit for this key in seconds. The key will automatically be removed after this period of time. + * + * @return self + */ + public function setValidity($validity) + { + $this->container['validity'] = $validity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/AroundRadius.php b/clients/algoliasearch-client-php/lib/Model/Search/AroundRadius.php new file mode 100644 index 0000000000..96657587ad --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/AroundRadius.php @@ -0,0 +1,183 @@ +listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/AroundRadiusOneOf.php b/clients/algoliasearch-client-php/lib/Model/Search/AroundRadiusOneOf.php new file mode 100644 index 0000000000..e585780102 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/AroundRadiusOneOf.php @@ -0,0 +1,30 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'cluster' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cluster' => 'setCluster', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cluster' => 'getCluster', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['cluster'])) { + $this->container['cluster'] = $data['cluster']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['cluster']) || $this->container['cluster'] === null) { + $invalidProperties[] = "'cluster' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets cluster + * + * @return string + */ + public function getCluster() + { + return $this->container['cluster'] ?? null; + } + + /** + * Sets cluster + * + * @param string $cluster name of the cluster + * + * @return self + */ + public function setCluster($cluster) + { + $this->container['cluster'] = $cluster; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/AttributeOrBuiltInOperation.php b/clients/algoliasearch-client-php/lib/Model/Search/AttributeOrBuiltInOperation.php new file mode 100644 index 0000000000..62de1f9318 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/AttributeOrBuiltInOperation.php @@ -0,0 +1,245 @@ + '\Algolia\AlgoliaSearch\Model\Search\BuiltInOperationType', + 'value' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'operation' => null, + 'value' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['operation'])) { + $this->container['operation'] = $data['operation']; + } + if (isset($data['value'])) { + $this->container['value'] = $data['value']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['operation']) || $this->container['operation'] === null) { + $invalidProperties[] = "'operation' can't be null"; + } + if (!isset($this->container['value']) || $this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets operation + * + * @return \Algolia\AlgoliaSearch\Model\Search\BuiltInOperationType + */ + public function getOperation() + { + return $this->container['operation'] ?? null; + } + + /** + * Sets operation + * + * @param \Algolia\AlgoliaSearch\Model\Search\BuiltInOperationType $operation operation + * + * @return self + */ + public function setOperation($operation) + { + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value + * + * @param string $value the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/AutomaticFacetFilter.php b/clients/algoliasearch-client-php/lib/Model/Search/AutomaticFacetFilter.php new file mode 100644 index 0000000000..ed90d72ff0 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/AutomaticFacetFilter.php @@ -0,0 +1,275 @@ + 'string', + 'score' => 'int', + 'disjunctive' => 'bool', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'facet' => null, + 'score' => null, + 'disjunctive' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'facet' => 'setFacet', + 'score' => 'setScore', + 'disjunctive' => 'setDisjunctive', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'facet' => 'getFacet', + 'score' => 'getScore', + 'disjunctive' => 'getDisjunctive', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['facet'])) { + $this->container['facet'] = $data['facet']; + } + if (isset($data['score'])) { + $this->container['score'] = $data['score']; + } + if (isset($data['disjunctive'])) { + $this->container['disjunctive'] = $data['disjunctive']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['facet']) || $this->container['facet'] === null) { + $invalidProperties[] = "'facet' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets facet + * + * @return string + */ + public function getFacet() + { + return $this->container['facet'] ?? null; + } + + /** + * Sets facet + * + * @param string $facet Attribute to filter on. This must match a facet placeholder in the Rule's pattern. + * + * @return self + */ + public function setFacet($facet) + { + $this->container['facet'] = $facet; + + return $this; + } + + /** + * Gets score + * + * @return int|null + */ + public function getScore() + { + return $this->container['score'] ?? null; + } + + /** + * Sets score + * + * @param int|null $score Score for the filter. Typically used for optional or disjunctive filters. + * + * @return self + */ + public function setScore($score) + { + $this->container['score'] = $score; + + return $this; + } + + /** + * Gets disjunctive + * + * @return bool|null + */ + public function getDisjunctive() + { + return $this->container['disjunctive'] ?? null; + } + + /** + * Sets disjunctive + * + * @param bool|null $disjunctive whether the filter is disjunctive (true) or conjunctive (false) + * + * @return self + */ + public function setDisjunctive($disjunctive) + { + $this->container['disjunctive'] = $disjunctive; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BaseBrowseResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/BaseBrowseResponse.php new file mode 100644 index 0000000000..d366717439 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BaseBrowseResponse.php @@ -0,0 +1,211 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'cursor' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cursor' => 'setCursor', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cursor' => 'getCursor', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['cursor'])) { + $this->container['cursor'] = $data['cursor']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['cursor']) || $this->container['cursor'] === null) { + $invalidProperties[] = "'cursor' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets cursor + * + * @return string + */ + public function getCursor() + { + return $this->container['cursor'] ?? null; + } + + /** + * Sets cursor + * + * @param string $cursor Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. + * + * @return self + */ + public function setCursor($cursor) + { + $this->container['cursor'] = $cursor; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BaseIndexSettings.php b/clients/algoliasearch-client-php/lib/Model/Search/BaseIndexSettings.php new file mode 100644 index 0000000000..82e68bfefc --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BaseIndexSettings.php @@ -0,0 +1,548 @@ + 'string[]', + 'paginationLimitedTo' => 'int', + 'disableTypoToleranceOnWords' => 'string[]', + 'attributesToTransliterate' => 'string[]', + 'camelCaseAttributes' => 'string[]', + 'decompoundedAttributes' => 'object', + 'indexLanguages' => 'string[]', + 'filterPromotes' => 'bool', + 'disablePrefixOnAttributes' => 'string[]', + 'allowCompressionOfIntegerArray' => 'bool', + 'numericAttributesForFiltering' => 'string[]', + 'userData' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'replicas' => null, + 'paginationLimitedTo' => null, + 'disableTypoToleranceOnWords' => null, + 'attributesToTransliterate' => null, + 'camelCaseAttributes' => null, + 'decompoundedAttributes' => null, + 'indexLanguages' => null, + 'filterPromotes' => null, + 'disablePrefixOnAttributes' => null, + 'allowCompressionOfIntegerArray' => null, + 'numericAttributesForFiltering' => null, + 'userData' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'replicas' => 'setReplicas', + 'paginationLimitedTo' => 'setPaginationLimitedTo', + 'disableTypoToleranceOnWords' => 'setDisableTypoToleranceOnWords', + 'attributesToTransliterate' => 'setAttributesToTransliterate', + 'camelCaseAttributes' => 'setCamelCaseAttributes', + 'decompoundedAttributes' => 'setDecompoundedAttributes', + 'indexLanguages' => 'setIndexLanguages', + 'filterPromotes' => 'setFilterPromotes', + 'disablePrefixOnAttributes' => 'setDisablePrefixOnAttributes', + 'allowCompressionOfIntegerArray' => 'setAllowCompressionOfIntegerArray', + 'numericAttributesForFiltering' => 'setNumericAttributesForFiltering', + 'userData' => 'setUserData', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'replicas' => 'getReplicas', + 'paginationLimitedTo' => 'getPaginationLimitedTo', + 'disableTypoToleranceOnWords' => 'getDisableTypoToleranceOnWords', + 'attributesToTransliterate' => 'getAttributesToTransliterate', + 'camelCaseAttributes' => 'getCamelCaseAttributes', + 'decompoundedAttributes' => 'getDecompoundedAttributes', + 'indexLanguages' => 'getIndexLanguages', + 'filterPromotes' => 'getFilterPromotes', + 'disablePrefixOnAttributes' => 'getDisablePrefixOnAttributes', + 'allowCompressionOfIntegerArray' => 'getAllowCompressionOfIntegerArray', + 'numericAttributesForFiltering' => 'getNumericAttributesForFiltering', + 'userData' => 'getUserData', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['replicas'])) { + $this->container['replicas'] = $data['replicas']; + } + if (isset($data['paginationLimitedTo'])) { + $this->container['paginationLimitedTo'] = $data['paginationLimitedTo']; + } + if (isset($data['disableTypoToleranceOnWords'])) { + $this->container['disableTypoToleranceOnWords'] = $data['disableTypoToleranceOnWords']; + } + if (isset($data['attributesToTransliterate'])) { + $this->container['attributesToTransliterate'] = $data['attributesToTransliterate']; + } + if (isset($data['camelCaseAttributes'])) { + $this->container['camelCaseAttributes'] = $data['camelCaseAttributes']; + } + if (isset($data['decompoundedAttributes'])) { + $this->container['decompoundedAttributes'] = $data['decompoundedAttributes']; + } + if (isset($data['indexLanguages'])) { + $this->container['indexLanguages'] = $data['indexLanguages']; + } + if (isset($data['filterPromotes'])) { + $this->container['filterPromotes'] = $data['filterPromotes']; + } + if (isset($data['disablePrefixOnAttributes'])) { + $this->container['disablePrefixOnAttributes'] = $data['disablePrefixOnAttributes']; + } + if (isset($data['allowCompressionOfIntegerArray'])) { + $this->container['allowCompressionOfIntegerArray'] = $data['allowCompressionOfIntegerArray']; + } + if (isset($data['numericAttributesForFiltering'])) { + $this->container['numericAttributesForFiltering'] = $data['numericAttributesForFiltering']; + } + if (isset($data['userData'])) { + $this->container['userData'] = $data['userData']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets replicas + * + * @return string[]|null + */ + public function getReplicas() + { + return $this->container['replicas'] ?? null; + } + + /** + * Sets replicas + * + * @param string[]|null $replicas creates replicas, exact copies of an index + * + * @return self + */ + public function setReplicas($replicas) + { + $this->container['replicas'] = $replicas; + + return $this; + } + + /** + * Gets paginationLimitedTo + * + * @return int|null + */ + public function getPaginationLimitedTo() + { + return $this->container['paginationLimitedTo'] ?? null; + } + + /** + * Sets paginationLimitedTo + * + * @param int|null $paginationLimitedTo set the maximum number of hits accessible via pagination + * + * @return self + */ + public function setPaginationLimitedTo($paginationLimitedTo) + { + $this->container['paginationLimitedTo'] = $paginationLimitedTo; + + return $this; + } + + /** + * Gets disableTypoToleranceOnWords + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnWords() + { + return $this->container['disableTypoToleranceOnWords'] ?? null; + } + + /** + * Sets disableTypoToleranceOnWords + * + * @param string[]|null $disableTypoToleranceOnWords a list of words for which you want to turn off typo tolerance + * + * @return self + */ + public function setDisableTypoToleranceOnWords($disableTypoToleranceOnWords) + { + $this->container['disableTypoToleranceOnWords'] = $disableTypoToleranceOnWords; + + return $this; + } + + /** + * Gets attributesToTransliterate + * + * @return string[]|null + */ + public function getAttributesToTransliterate() + { + return $this->container['attributesToTransliterate'] ?? null; + } + + /** + * Sets attributesToTransliterate + * + * @param string[]|null $attributesToTransliterate specify on which attributes to apply transliteration + * + * @return self + */ + public function setAttributesToTransliterate($attributesToTransliterate) + { + $this->container['attributesToTransliterate'] = $attributesToTransliterate; + + return $this; + } + + /** + * Gets camelCaseAttributes + * + * @return string[]|null + */ + public function getCamelCaseAttributes() + { + return $this->container['camelCaseAttributes'] ?? null; + } + + /** + * Sets camelCaseAttributes + * + * @param string[]|null $camelCaseAttributes list of attributes on which to do a decomposition of camel case words + * + * @return self + */ + public function setCamelCaseAttributes($camelCaseAttributes) + { + $this->container['camelCaseAttributes'] = $camelCaseAttributes; + + return $this; + } + + /** + * Gets decompoundedAttributes + * + * @return object|null + */ + public function getDecompoundedAttributes() + { + return $this->container['decompoundedAttributes'] ?? null; + } + + /** + * Sets decompoundedAttributes + * + * @param object|null $decompoundedAttributes specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding + * + * @return self + */ + public function setDecompoundedAttributes($decompoundedAttributes) + { + $this->container['decompoundedAttributes'] = $decompoundedAttributes; + + return $this; + } + + /** + * Gets indexLanguages + * + * @return string[]|null + */ + public function getIndexLanguages() + { + return $this->container['indexLanguages'] ?? null; + } + + /** + * Sets indexLanguages + * + * @param string[]|null $indexLanguages sets the languages at the index level for language-specific processing such as tokenization and normalization + * + * @return self + */ + public function setIndexLanguages($indexLanguages) + { + $this->container['indexLanguages'] = $indexLanguages; + + return $this; + } + + /** + * Gets filterPromotes + * + * @return bool|null + */ + public function getFilterPromotes() + { + return $this->container['filterPromotes'] ?? null; + } + + /** + * Sets filterPromotes + * + * @param bool|null $filterPromotes whether promoted results should match the filters of the current search, except for geographic filters + * + * @return self + */ + public function setFilterPromotes($filterPromotes) + { + $this->container['filterPromotes'] = $filterPromotes; + + return $this; + } + + /** + * Gets disablePrefixOnAttributes + * + * @return string[]|null + */ + public function getDisablePrefixOnAttributes() + { + return $this->container['disablePrefixOnAttributes'] ?? null; + } + + /** + * Sets disablePrefixOnAttributes + * + * @param string[]|null $disablePrefixOnAttributes list of attributes on which you want to disable prefix matching + * + * @return self + */ + public function setDisablePrefixOnAttributes($disablePrefixOnAttributes) + { + $this->container['disablePrefixOnAttributes'] = $disablePrefixOnAttributes; + + return $this; + } + + /** + * Gets allowCompressionOfIntegerArray + * + * @return bool|null + */ + public function getAllowCompressionOfIntegerArray() + { + return $this->container['allowCompressionOfIntegerArray'] ?? null; + } + + /** + * Sets allowCompressionOfIntegerArray + * + * @param bool|null $allowCompressionOfIntegerArray enables compression of large integer arrays + * + * @return self + */ + public function setAllowCompressionOfIntegerArray($allowCompressionOfIntegerArray) + { + $this->container['allowCompressionOfIntegerArray'] = $allowCompressionOfIntegerArray; + + return $this; + } + + /** + * Gets numericAttributesForFiltering + * + * @return string[]|null + */ + public function getNumericAttributesForFiltering() + { + return $this->container['numericAttributesForFiltering'] ?? null; + } + + /** + * Sets numericAttributesForFiltering + * + * @param string[]|null $numericAttributesForFiltering list of numeric attributes that can be used as numerical filters + * + * @return self + */ + public function setNumericAttributesForFiltering($numericAttributesForFiltering) + { + $this->container['numericAttributesForFiltering'] = $numericAttributesForFiltering; + + return $this; + } + + /** + * Gets userData + * + * @return object|null + */ + public function getUserData() + { + return $this->container['userData'] ?? null; + } + + /** + * Sets userData + * + * @param object|null $userData lets you store custom data in your indices + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchParams.php b/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchParams.php new file mode 100644 index 0000000000..317bb33f0d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchParams.php @@ -0,0 +1,1191 @@ + 'string', + 'filters' => 'string', + 'facetFilters' => 'string[]', + 'optionalFilters' => 'string[]', + 'numericFilters' => 'string[]', + 'tagFilters' => 'string[]', + 'sumOrFiltersScores' => 'bool', + 'facets' => 'string[]', + 'maxValuesPerFacet' => 'int', + 'facetingAfterDistinct' => 'bool', + 'sortFacetValuesBy' => 'string', + 'page' => 'int', + 'offset' => 'int', + 'length' => 'int', + 'aroundLatLng' => 'string', + 'aroundLatLngViaIP' => 'bool', + 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', + 'aroundPrecision' => 'int', + 'minimumAroundRadius' => 'int', + 'insideBoundingBox' => 'float[]', + 'insidePolygon' => 'float[]', + 'naturalLanguages' => 'string[]', + 'ruleContexts' => 'string[]', + 'personalizationImpact' => 'int', + 'userToken' => 'string', + 'getRankingInfo' => 'bool', + 'clickAnalytics' => 'bool', + 'analytics' => 'bool', + 'analyticsTags' => 'string[]', + 'percentileComputation' => 'bool', + 'enableABTest' => 'bool', + 'enableReRanking' => 'bool', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'similarQuery' => null, + 'filters' => null, + 'facetFilters' => null, + 'optionalFilters' => null, + 'numericFilters' => null, + 'tagFilters' => null, + 'sumOrFiltersScores' => null, + 'facets' => null, + 'maxValuesPerFacet' => null, + 'facetingAfterDistinct' => null, + 'sortFacetValuesBy' => null, + 'page' => null, + 'offset' => null, + 'length' => null, + 'aroundLatLng' => null, + 'aroundLatLngViaIP' => null, + 'aroundRadius' => null, + 'aroundPrecision' => null, + 'minimumAroundRadius' => null, + 'insideBoundingBox' => null, + 'insidePolygon' => null, + 'naturalLanguages' => null, + 'ruleContexts' => null, + 'personalizationImpact' => null, + 'userToken' => null, + 'getRankingInfo' => null, + 'clickAnalytics' => null, + 'analytics' => null, + 'analyticsTags' => null, + 'percentileComputation' => null, + 'enableABTest' => null, + 'enableReRanking' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'similarQuery' => 'setSimilarQuery', + 'filters' => 'setFilters', + 'facetFilters' => 'setFacetFilters', + 'optionalFilters' => 'setOptionalFilters', + 'numericFilters' => 'setNumericFilters', + 'tagFilters' => 'setTagFilters', + 'sumOrFiltersScores' => 'setSumOrFiltersScores', + 'facets' => 'setFacets', + 'maxValuesPerFacet' => 'setMaxValuesPerFacet', + 'facetingAfterDistinct' => 'setFacetingAfterDistinct', + 'sortFacetValuesBy' => 'setSortFacetValuesBy', + 'page' => 'setPage', + 'offset' => 'setOffset', + 'length' => 'setLength', + 'aroundLatLng' => 'setAroundLatLng', + 'aroundLatLngViaIP' => 'setAroundLatLngViaIP', + 'aroundRadius' => 'setAroundRadius', + 'aroundPrecision' => 'setAroundPrecision', + 'minimumAroundRadius' => 'setMinimumAroundRadius', + 'insideBoundingBox' => 'setInsideBoundingBox', + 'insidePolygon' => 'setInsidePolygon', + 'naturalLanguages' => 'setNaturalLanguages', + 'ruleContexts' => 'setRuleContexts', + 'personalizationImpact' => 'setPersonalizationImpact', + 'userToken' => 'setUserToken', + 'getRankingInfo' => 'setGetRankingInfo', + 'clickAnalytics' => 'setClickAnalytics', + 'analytics' => 'setAnalytics', + 'analyticsTags' => 'setAnalyticsTags', + 'percentileComputation' => 'setPercentileComputation', + 'enableABTest' => 'setEnableABTest', + 'enableReRanking' => 'setEnableReRanking', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'similarQuery' => 'getSimilarQuery', + 'filters' => 'getFilters', + 'facetFilters' => 'getFacetFilters', + 'optionalFilters' => 'getOptionalFilters', + 'numericFilters' => 'getNumericFilters', + 'tagFilters' => 'getTagFilters', + 'sumOrFiltersScores' => 'getSumOrFiltersScores', + 'facets' => 'getFacets', + 'maxValuesPerFacet' => 'getMaxValuesPerFacet', + 'facetingAfterDistinct' => 'getFacetingAfterDistinct', + 'sortFacetValuesBy' => 'getSortFacetValuesBy', + 'page' => 'getPage', + 'offset' => 'getOffset', + 'length' => 'getLength', + 'aroundLatLng' => 'getAroundLatLng', + 'aroundLatLngViaIP' => 'getAroundLatLngViaIP', + 'aroundRadius' => 'getAroundRadius', + 'aroundPrecision' => 'getAroundPrecision', + 'minimumAroundRadius' => 'getMinimumAroundRadius', + 'insideBoundingBox' => 'getInsideBoundingBox', + 'insidePolygon' => 'getInsidePolygon', + 'naturalLanguages' => 'getNaturalLanguages', + 'ruleContexts' => 'getRuleContexts', + 'personalizationImpact' => 'getPersonalizationImpact', + 'userToken' => 'getUserToken', + 'getRankingInfo' => 'getGetRankingInfo', + 'clickAnalytics' => 'getClickAnalytics', + 'analytics' => 'getAnalytics', + 'analyticsTags' => 'getAnalyticsTags', + 'percentileComputation' => 'getPercentileComputation', + 'enableABTest' => 'getEnableABTest', + 'enableReRanking' => 'getEnableReRanking', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['similarQuery'])) { + $this->container['similarQuery'] = $data['similarQuery']; + } + if (isset($data['filters'])) { + $this->container['filters'] = $data['filters']; + } + 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['tagFilters'])) { + $this->container['tagFilters'] = $data['tagFilters']; + } + if (isset($data['sumOrFiltersScores'])) { + $this->container['sumOrFiltersScores'] = $data['sumOrFiltersScores']; + } + if (isset($data['facets'])) { + $this->container['facets'] = $data['facets']; + } + if (isset($data['maxValuesPerFacet'])) { + $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; + } + if (isset($data['facetingAfterDistinct'])) { + $this->container['facetingAfterDistinct'] = $data['facetingAfterDistinct']; + } + if (isset($data['sortFacetValuesBy'])) { + $this->container['sortFacetValuesBy'] = $data['sortFacetValuesBy']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['offset'])) { + $this->container['offset'] = $data['offset']; + } + if (isset($data['length'])) { + $this->container['length'] = $data['length']; + } + 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['naturalLanguages'])) { + $this->container['naturalLanguages'] = $data['naturalLanguages']; + } + if (isset($data['ruleContexts'])) { + $this->container['ruleContexts'] = $data['ruleContexts']; + } + if (isset($data['personalizationImpact'])) { + $this->container['personalizationImpact'] = $data['personalizationImpact']; + } + if (isset($data['userToken'])) { + $this->container['userToken'] = $data['userToken']; + } + if (isset($data['getRankingInfo'])) { + $this->container['getRankingInfo'] = $data['getRankingInfo']; + } + 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['percentileComputation'])) { + $this->container['percentileComputation'] = $data['percentileComputation']; + } + if (isset($data['enableABTest'])) { + $this->container['enableABTest'] = $data['enableABTest']; + } + if (isset($data['enableReRanking'])) { + $this->container['enableReRanking'] = $data['enableReRanking']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (isset($this->container['length']) && ($this->container['length'] > 1000)) { + $invalidProperties[] = "invalid value for 'length', must be smaller than or equal to 1000."; + } + + if (isset($this->container['length']) && ($this->container['length'] < 1)) { + $invalidProperties[] = "invalid value for 'length', must be bigger than or equal to 1."; + } + + if (isset($this->container['minimumAroundRadius']) && ($this->container['minimumAroundRadius'] < 1)) { + $invalidProperties[] = "invalid value for 'minimumAroundRadius', must be bigger than or equal to 1."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets similarQuery + * + * @return string|null + */ + public function getSimilarQuery() + { + return $this->container['similarQuery'] ?? null; + } + + /** + * Sets similarQuery + * + * @param string|null $similarQuery overrides the query parameter and performs a more generic search that can be used to find \"similar\" results + * + * @return self + */ + public function setSimilarQuery($similarQuery) + { + $this->container['similarQuery'] = $similarQuery; + + return $this; + } + + /** + * Gets filters + * + * @return string|null + */ + public function getFilters() + { + return $this->container['filters'] ?? null; + } + + /** + * Sets filters + * + * @param string|null $filters filter the query with numeric, facet and/or tag filters + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets facetFilters + * + * @return string[]|null + */ + public function getFacetFilters() + { + return $this->container['facetFilters'] ?? null; + } + + /** + * Sets facetFilters + * + * @param string[]|null $facetFilters filter hits by facet value + * + * @return self + */ + public function setFacetFilters($facetFilters) + { + $this->container['facetFilters'] = $facetFilters; + + return $this; + } + + /** + * Gets optionalFilters + * + * @return string[]|null + */ + public function getOptionalFilters() + { + return $this->container['optionalFilters'] ?? null; + } + + /** + * Sets optionalFilters + * + * @param string[]|null $optionalFilters create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter + * + * @return self + */ + public function setOptionalFilters($optionalFilters) + { + $this->container['optionalFilters'] = $optionalFilters; + + return $this; + } + + /** + * Gets numericFilters + * + * @return string[]|null + */ + public function getNumericFilters() + { + return $this->container['numericFilters'] ?? null; + } + + /** + * Sets numericFilters + * + * @param string[]|null $numericFilters filter on numeric attributes + * + * @return self + */ + public function setNumericFilters($numericFilters) + { + $this->container['numericFilters'] = $numericFilters; + + return $this; + } + + /** + * Gets tagFilters + * + * @return string[]|null + */ + public function getTagFilters() + { + return $this->container['tagFilters'] ?? null; + } + + /** + * Sets tagFilters + * + * @param string[]|null $tagFilters filter hits by tags + * + * @return self + */ + public function setTagFilters($tagFilters) + { + $this->container['tagFilters'] = $tagFilters; + + return $this; + } + + /** + * Gets sumOrFiltersScores + * + * @return bool|null + */ + public function getSumOrFiltersScores() + { + return $this->container['sumOrFiltersScores'] ?? null; + } + + /** + * Sets sumOrFiltersScores + * + * @param bool|null $sumOrFiltersScores determines how to calculate the total score for filtering + * + * @return self + */ + public function setSumOrFiltersScores($sumOrFiltersScores) + { + $this->container['sumOrFiltersScores'] = $sumOrFiltersScores; + + return $this; + } + + /** + * Gets facets + * + * @return string[]|null + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets + * + * @param string[]|null $facets retrieve facets and their facet values + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets maxValuesPerFacet + * + * @return int|null + */ + public function getMaxValuesPerFacet() + { + return $this->container['maxValuesPerFacet'] ?? null; + } + + /** + * Sets maxValuesPerFacet + * + * @param int|null $maxValuesPerFacet maximum number of facet values to return for each facet during a regular search + * + * @return self + */ + public function setMaxValuesPerFacet($maxValuesPerFacet) + { + $this->container['maxValuesPerFacet'] = $maxValuesPerFacet; + + return $this; + } + + /** + * Gets facetingAfterDistinct + * + * @return bool|null + */ + public function getFacetingAfterDistinct() + { + return $this->container['facetingAfterDistinct'] ?? null; + } + + /** + * Sets facetingAfterDistinct + * + * @param bool|null $facetingAfterDistinct force faceting to be applied after de-duplication (via the Distinct setting) + * + * @return self + */ + public function setFacetingAfterDistinct($facetingAfterDistinct) + { + $this->container['facetingAfterDistinct'] = $facetingAfterDistinct; + + return $this; + } + + /** + * Gets sortFacetValuesBy + * + * @return string|null + */ + public function getSortFacetValuesBy() + { + return $this->container['sortFacetValuesBy'] ?? null; + } + + /** + * Sets sortFacetValuesBy + * + * @param string|null $sortFacetValuesBy controls how facet values are fetched + * + * @return self + */ + public function setSortFacetValuesBy($sortFacetValuesBy) + { + $this->container['sortFacetValuesBy'] = $sortFacetValuesBy; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int|null $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets offset + * + * @return int|null + */ + public function getOffset() + { + return $this->container['offset'] ?? null; + } + + /** + * Sets offset + * + * @param int|null $offset specify the offset of the first hit to return + * + * @return self + */ + public function setOffset($offset) + { + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets length + * + * @return int|null + */ + public function getLength() + { + return $this->container['length'] ?? null; + } + + /** + * Sets length + * + * @param int|null $length set the number of hits to retrieve (used only with offset) + * + * @return self + */ + public function setLength($length) + { + if (!is_null($length) && ($length > 1000)) { + throw new \InvalidArgumentException('invalid value for $length when calling BaseSearchParams., must be smaller than or equal to 1000.'); + } + if (!is_null($length) && ($length < 1)) { + throw new \InvalidArgumentException('invalid value for $length when calling BaseSearchParams., must be bigger than or equal to 1.'); + } + + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng'] ?? null; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng search for entries around a central geolocation, enabling a geo search within a circular area + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets aroundLatLngViaIP + * + * @return bool|null + */ + public function getAroundLatLngViaIP() + { + return $this->container['aroundLatLngViaIP'] ?? null; + } + + /** + * Sets aroundLatLngViaIP + * + * @param bool|null $aroundLatLngViaIP search for entries around a given location automatically computed from the requester's IP address + * + * @return self + */ + public function setAroundLatLngViaIP($aroundLatLngViaIP) + { + $this->container['aroundLatLngViaIP'] = $aroundLatLngViaIP; + + return $this; + } + + /** + * Gets aroundRadius + * + * @return \Algolia\AlgoliaSearch\Model\Search\AroundRadius|null + */ + public function getAroundRadius() + { + return $this->container['aroundRadius'] ?? null; + } + + /** + * Sets aroundRadius + * + * @param \Algolia\AlgoliaSearch\Model\Search\AroundRadius|null $aroundRadius aroundRadius + * + * @return self + */ + public function setAroundRadius($aroundRadius) + { + $this->container['aroundRadius'] = $aroundRadius; + + return $this; + } + + /** + * Gets aroundPrecision + * + * @return int|null + */ + public function getAroundPrecision() + { + return $this->container['aroundPrecision'] ?? null; + } + + /** + * Sets aroundPrecision + * + * @param int|null $aroundPrecision precision of geo search (in meters), to add grouping by geo location to the ranking formula + * + * @return self + */ + public function setAroundPrecision($aroundPrecision) + { + $this->container['aroundPrecision'] = $aroundPrecision; + + return $this; + } + + /** + * Gets minimumAroundRadius + * + * @return int|null + */ + public function getMinimumAroundRadius() + { + return $this->container['minimumAroundRadius'] ?? null; + } + + /** + * Sets minimumAroundRadius + * + * @param int|null $minimumAroundRadius minimum radius (in meters) used for a geo search when aroundRadius is not set + * + * @return self + */ + public function setMinimumAroundRadius($minimumAroundRadius) + { + if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { + throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling BaseSearchParams., must be bigger than or equal to 1.'); + } + + $this->container['minimumAroundRadius'] = $minimumAroundRadius; + + return $this; + } + + /** + * Gets insideBoundingBox + * + * @return float[]|null + */ + public function getInsideBoundingBox() + { + return $this->container['insideBoundingBox'] ?? null; + } + + /** + * Sets insideBoundingBox + * + * @param float[]|null $insideBoundingBox search inside a rectangular area (in geo coordinates) + * + * @return self + */ + public function setInsideBoundingBox($insideBoundingBox) + { + $this->container['insideBoundingBox'] = $insideBoundingBox; + + return $this; + } + + /** + * Gets insidePolygon + * + * @return float[]|null + */ + public function getInsidePolygon() + { + return $this->container['insidePolygon'] ?? null; + } + + /** + * Sets insidePolygon + * + * @param float[]|null $insidePolygon search inside a polygon (in geo coordinates) + * + * @return self + */ + public function setInsidePolygon($insidePolygon) + { + $this->container['insidePolygon'] = $insidePolygon; + + return $this; + } + + /** + * Gets naturalLanguages + * + * @return string[]|null + */ + public function getNaturalLanguages() + { + return $this->container['naturalLanguages'] ?? null; + } + + /** + * Sets naturalLanguages + * + * @param string[]|null $naturalLanguages This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. + * + * @return self + */ + public function setNaturalLanguages($naturalLanguages) + { + $this->container['naturalLanguages'] = $naturalLanguages; + + return $this; + } + + /** + * Gets ruleContexts + * + * @return string[]|null + */ + public function getRuleContexts() + { + return $this->container['ruleContexts'] ?? null; + } + + /** + * Sets ruleContexts + * + * @param string[]|null $ruleContexts enables contextual rules + * + * @return self + */ + public function setRuleContexts($ruleContexts) + { + $this->container['ruleContexts'] = $ruleContexts; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int|null + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact'] ?? null; + } + + /** + * Sets personalizationImpact + * + * @param int|null $personalizationImpact define the impact of the Personalization feature + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + return $this; + } + + /** + * Gets userToken + * + * @return string|null + */ + public function getUserToken() + { + return $this->container['userToken'] ?? null; + } + + /** + * Sets userToken + * + * @param string|null $userToken associates a certain user token with the current search + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets getRankingInfo + * + * @return bool|null + */ + public function getGetRankingInfo() + { + return $this->container['getRankingInfo'] ?? null; + } + + /** + * Sets getRankingInfo + * + * @param bool|null $getRankingInfo retrieve detailed ranking information + * + * @return self + */ + public function setGetRankingInfo($getRankingInfo) + { + $this->container['getRankingInfo'] = $getRankingInfo; + + return $this; + } + + /** + * Gets clickAnalytics + * + * @return bool|null + */ + public function getClickAnalytics() + { + return $this->container['clickAnalytics'] ?? null; + } + + /** + * Sets clickAnalytics + * + * @param bool|null $clickAnalytics enable the Click Analytics feature + * + * @return self + */ + public function setClickAnalytics($clickAnalytics) + { + $this->container['clickAnalytics'] = $clickAnalytics; + + return $this; + } + + /** + * Gets analytics + * + * @return bool|null + */ + public function getAnalytics() + { + return $this->container['analytics'] ?? null; + } + + /** + * Sets analytics + * + * @param bool|null $analytics whether the current query will be taken into account in the Analytics + * + * @return self + */ + public function setAnalytics($analytics) + { + $this->container['analytics'] = $analytics; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[]|null + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags'] ?? null; + } + + /** + * Sets analyticsTags + * + * @param string[]|null $analyticsTags list of tags to apply to the query for analytics purposes + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets percentileComputation + * + * @return bool|null + */ + public function getPercentileComputation() + { + return $this->container['percentileComputation'] ?? null; + } + + /** + * Sets percentileComputation + * + * @param bool|null $percentileComputation whether to include or exclude a query from the processing-time percentile computation + * + * @return self + */ + public function setPercentileComputation($percentileComputation) + { + $this->container['percentileComputation'] = $percentileComputation; + + return $this; + } + + /** + * Gets enableABTest + * + * @return bool|null + */ + public function getEnableABTest() + { + return $this->container['enableABTest'] ?? null; + } + + /** + * Sets enableABTest + * + * @param bool|null $enableABTest whether this search should participate in running AB tests + * + * @return self + */ + public function setEnableABTest($enableABTest) + { + $this->container['enableABTest'] = $enableABTest; + + return $this; + } + + /** + * Gets enableReRanking + * + * @return bool|null + */ + public function getEnableReRanking() + { + return $this->container['enableReRanking'] ?? null; + } + + /** + * Sets enableReRanking + * + * @param bool|null $enableReRanking whether this search should use AI Re-Ranking + * + * @return self + */ + public function setEnableReRanking($enableReRanking) + { + $this->container['enableReRanking'] = $enableReRanking; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchResponse.php new file mode 100644 index 0000000000..df2d21acdc --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchResponse.php @@ -0,0 +1,956 @@ + 'int', + 'abTestVariantID' => 'int', + 'aroundLatLng' => 'string', + 'automaticRadius' => 'string', + 'exhaustiveFacetsCount' => 'bool', + 'exhaustiveNbHits' => 'bool', + 'exhaustiveTypo' => 'bool', + 'facets' => 'array>', + 'facetsStats' => 'array', + 'hitsPerPage' => 'int', + 'index' => 'string', + 'indexUsed' => 'string', + 'message' => 'string', + 'nbHits' => 'int', + 'nbPages' => 'int', + 'nbSortedHits' => 'int', + 'page' => 'int', + 'params' => 'string', + 'parsedQuery' => 'string', + 'processingTimeMS' => 'int', + 'query' => 'string', + 'queryAfterRemoval' => 'string', + 'serverUsed' => 'string', + 'userData' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'abTestID' => null, + 'abTestVariantID' => null, + 'aroundLatLng' => null, + 'automaticRadius' => null, + 'exhaustiveFacetsCount' => null, + 'exhaustiveNbHits' => null, + 'exhaustiveTypo' => null, + 'facets' => null, + 'facetsStats' => null, + 'hitsPerPage' => null, + 'index' => null, + 'indexUsed' => null, + 'message' => null, + 'nbHits' => null, + 'nbPages' => null, + 'nbSortedHits' => null, + 'page' => null, + 'params' => null, + 'parsedQuery' => null, + 'processingTimeMS' => null, + 'query' => null, + 'queryAfterRemoval' => null, + 'serverUsed' => null, + 'userData' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abTestID' => 'setAbTestID', + 'abTestVariantID' => 'setAbTestVariantID', + 'aroundLatLng' => 'setAroundLatLng', + 'automaticRadius' => 'setAutomaticRadius', + 'exhaustiveFacetsCount' => 'setExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'setExhaustiveNbHits', + 'exhaustiveTypo' => 'setExhaustiveTypo', + 'facets' => 'setFacets', + 'facetsStats' => 'setFacetsStats', + 'hitsPerPage' => 'setHitsPerPage', + 'index' => 'setIndex', + 'indexUsed' => 'setIndexUsed', + 'message' => 'setMessage', + 'nbHits' => 'setNbHits', + 'nbPages' => 'setNbPages', + 'nbSortedHits' => 'setNbSortedHits', + 'page' => 'setPage', + 'params' => 'setParams', + 'parsedQuery' => 'setParsedQuery', + 'processingTimeMS' => 'setProcessingTimeMS', + 'query' => 'setQuery', + 'queryAfterRemoval' => 'setQueryAfterRemoval', + 'serverUsed' => 'setServerUsed', + 'userData' => 'setUserData', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abTestID' => 'getAbTestID', + 'abTestVariantID' => 'getAbTestVariantID', + 'aroundLatLng' => 'getAroundLatLng', + 'automaticRadius' => 'getAutomaticRadius', + 'exhaustiveFacetsCount' => 'getExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'getExhaustiveNbHits', + 'exhaustiveTypo' => 'getExhaustiveTypo', + 'facets' => 'getFacets', + 'facetsStats' => 'getFacetsStats', + 'hitsPerPage' => 'getHitsPerPage', + 'index' => 'getIndex', + 'indexUsed' => 'getIndexUsed', + 'message' => 'getMessage', + 'nbHits' => 'getNbHits', + 'nbPages' => 'getNbPages', + 'nbSortedHits' => 'getNbSortedHits', + 'page' => 'getPage', + 'params' => 'getParams', + 'parsedQuery' => 'getParsedQuery', + 'processingTimeMS' => 'getProcessingTimeMS', + 'query' => 'getQuery', + 'queryAfterRemoval' => 'getQueryAfterRemoval', + 'serverUsed' => 'getServerUsed', + 'userData' => 'getUserData', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['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['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['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + 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['nbHits'])) { + $this->container['nbHits'] = $data['nbHits']; + } + if (isset($data['nbPages'])) { + $this->container['nbPages'] = $data['nbPages']; + } + if (isset($data['nbSortedHits'])) { + $this->container['nbSortedHits'] = $data['nbSortedHits']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['params'])) { + $this->container['params'] = $data['params']; + } + if (isset($data['parsedQuery'])) { + $this->container['parsedQuery'] = $data['parsedQuery']; + } + if (isset($data['processingTimeMS'])) { + $this->container['processingTimeMS'] = $data['processingTimeMS']; + } + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['queryAfterRemoval'])) { + $this->container['queryAfterRemoval'] = $data['queryAfterRemoval']; + } + if (isset($data['serverUsed'])) { + $this->container['serverUsed'] = $data['serverUsed']; + } + if (isset($data['userData'])) { + $this->container['userData'] = $data['userData']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (isset($this->container['aroundLatLng']) && !preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $this->container['aroundLatLng'])) { + $invalidProperties[] = "invalid value for 'aroundLatLng', must be conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."; + } + + if (!isset($this->container['exhaustiveNbHits']) || $this->container['exhaustiveNbHits'] === null) { + $invalidProperties[] = "'exhaustiveNbHits' can't be null"; + } + if (!isset($this->container['exhaustiveTypo']) || $this->container['exhaustiveTypo'] === null) { + $invalidProperties[] = "'exhaustiveTypo' can't be null"; + } + if (!isset($this->container['hitsPerPage']) || $this->container['hitsPerPage'] === null) { + $invalidProperties[] = "'hitsPerPage' can't be null"; + } + if (!isset($this->container['nbHits']) || $this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if (!isset($this->container['nbPages']) || $this->container['nbPages'] === null) { + $invalidProperties[] = "'nbPages' can't be null"; + } + if (!isset($this->container['page']) || $this->container['page'] === null) { + $invalidProperties[] = "'page' can't be null"; + } + if (!isset($this->container['params']) || $this->container['params'] === null) { + $invalidProperties[] = "'params' can't be null"; + } + if (!isset($this->container['processingTimeMS']) || $this->container['processingTimeMS'] === null) { + $invalidProperties[] = "'processingTimeMS' can't be null"; + } + if (!isset($this->container['query']) || $this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets abTestID + * + * @return int|null + */ + public function getAbTestID() + { + return $this->container['abTestID'] ?? null; + } + + /** + * Sets abTestID + * + * @param int|null $abTestID if a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets abTestVariantID + * + * @return int|null + */ + public function getAbTestVariantID() + { + return $this->container['abTestVariantID'] ?? null; + } + + /** + * Sets abTestVariantID + * + * @param int|null $abTestVariantID if a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used + * + * @return self + */ + public function setAbTestVariantID($abTestVariantID) + { + $this->container['abTestVariantID'] = $abTestVariantID; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng'] ?? null; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng the computed geo location + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + if (!is_null($aroundLatLng) && (!preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $aroundLatLng))) { + throw new \InvalidArgumentException("invalid value for $aroundLatLng when calling BaseSearchResponse., must conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."); + } + + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets automaticRadius + * + * @return string|null + */ + public function getAutomaticRadius() + { + return $this->container['automaticRadius'] ?? null; + } + + /** + * Sets automaticRadius + * + * @param string|null $automaticRadius The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. + * + * @return self + */ + public function setAutomaticRadius($automaticRadius) + { + $this->container['automaticRadius'] = $automaticRadius; + + return $this; + } + + /** + * Gets exhaustiveFacetsCount + * + * @return bool|null + */ + public function getExhaustiveFacetsCount() + { + return $this->container['exhaustiveFacetsCount'] ?? null; + } + + /** + * Sets exhaustiveFacetsCount + * + * @param bool|null $exhaustiveFacetsCount whether the facet count is exhaustive or approximate + * + * @return self + */ + public function setExhaustiveFacetsCount($exhaustiveFacetsCount) + { + $this->container['exhaustiveFacetsCount'] = $exhaustiveFacetsCount; + + return $this; + } + + /** + * Gets exhaustiveNbHits + * + * @return bool + */ + public function getExhaustiveNbHits() + { + return $this->container['exhaustiveNbHits'] ?? null; + } + + /** + * Sets exhaustiveNbHits + * + * @param bool $exhaustiveNbHits indicate if the nbHits count was exhaustive or approximate + * + * @return self + */ + public function setExhaustiveNbHits($exhaustiveNbHits) + { + $this->container['exhaustiveNbHits'] = $exhaustiveNbHits; + + return $this; + } + + /** + * Gets exhaustiveTypo + * + * @return bool + */ + public function getExhaustiveTypo() + { + return $this->container['exhaustiveTypo'] ?? null; + } + + /** + * Sets exhaustiveTypo + * + * @param bool $exhaustiveTypo indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * + * @return self + */ + public function setExhaustiveTypo($exhaustiveTypo) + { + $this->container['exhaustiveTypo'] = $exhaustiveTypo; + + return $this; + } + + /** + * Gets facets + * + * @return array>|null + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets + * + * @param array>|null $facets a mapping of each facet name to the corresponding facet counts + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets facetsStats + * + * @return array|null + */ + public function getFacetsStats() + { + return $this->container['facetsStats'] ?? null; + } + + /** + * Sets facetsStats + * + * @param array|null $facetsStats statistics for numerical facets + * + * @return self + */ + public function setFacetsStats($facetsStats) + { + $this->container['facetsStats'] = $facetsStats; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets index + * + * @return string|null + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index + * + * @param string|null $index index name used for the query + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets indexUsed + * + * @return string|null + */ + public function getIndexUsed() + { + return $this->container['indexUsed'] ?? null; + } + + /** + * Sets indexUsed + * + * @param string|null $indexUsed Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. + * + * @return self + */ + public function setIndexUsed($indexUsed) + { + $this->container['indexUsed'] = $indexUsed; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string|null $message used to return warnings about the query + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits'] ?? null; + } + + /** + * Sets nbHits + * + * @param int $nbHits number of hits that the search query matched + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets nbPages + * + * @return int + */ + public function getNbPages() + { + return $this->container['nbPages'] ?? null; + } + + /** + * Sets nbPages + * + * @param int $nbPages number of pages available for the current query + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + + /** + * Gets nbSortedHits + * + * @return int|null + */ + public function getNbSortedHits() + { + return $this->container['nbSortedHits'] ?? null; + } + + /** + * Sets nbSortedHits + * + * @param int|null $nbSortedHits the number of hits selected and sorted by the relevant sort algorithm + * + * @return self + */ + public function setNbSortedHits($nbSortedHits) + { + $this->container['nbSortedHits'] = $nbSortedHits; + + return $this; + } + + /** + * Gets page + * + * @return int + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets params + * + * @return string + */ + public function getParams() + { + return $this->container['params'] ?? null; + } + + /** + * Sets params + * + * @param string $params a url-encoded string of all search parameters + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets parsedQuery + * + * @return string|null + */ + public function getParsedQuery() + { + return $this->container['parsedQuery'] ?? null; + } + + /** + * Sets parsedQuery + * + * @param string|null $parsedQuery the query string that will be searched, after normalization + * + * @return self + */ + public function setParsedQuery($parsedQuery) + { + $this->container['parsedQuery'] = $parsedQuery; + + return $this; + } + + /** + * Gets processingTimeMS + * + * @return int + */ + public function getProcessingTimeMS() + { + return $this->container['processingTimeMS'] ?? 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 query + * + * @return string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets queryAfterRemoval + * + * @return string|null + */ + public function getQueryAfterRemoval() + { + return $this->container['queryAfterRemoval'] ?? null; + } + + /** + * Sets queryAfterRemoval + * + * @param string|null $queryAfterRemoval a markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set + * + * @return self + */ + public function setQueryAfterRemoval($queryAfterRemoval) + { + $this->container['queryAfterRemoval'] = $queryAfterRemoval; + + return $this; + } + + /** + * Gets serverUsed + * + * @return string|null + */ + public function getServerUsed() + { + return $this->container['serverUsed'] ?? null; + } + + /** + * Sets serverUsed + * + * @param string|null $serverUsed actual host name of the server that processed the request + * + * @return self + */ + public function setServerUsed($serverUsed) + { + $this->container['serverUsed'] = $serverUsed; + + return $this; + } + + /** + * Gets userData + * + * @return object|null + */ + public function getUserData() + { + return $this->container['userData'] ?? null; + } + + /** + * Sets userData + * + * @param object|null $userData lets you store custom data in your indices + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchResponseFacetsStats.php b/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchResponseFacetsStats.php new file mode 100644 index 0000000000..d91b33e106 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BaseSearchResponseFacetsStats.php @@ -0,0 +1,300 @@ + 'int', + 'max' => 'int', + 'avg' => 'int', + 'sum' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'min' => null, + 'max' => null, + 'avg' => null, + 'sum' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'min' => 'setMin', + 'max' => 'setMax', + 'avg' => 'setAvg', + 'sum' => 'setSum', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'min' => 'getMin', + 'max' => 'getMax', + 'avg' => 'getAvg', + 'sum' => 'getSum', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['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']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets min + * + * @return int|null + */ + public function getMin() + { + return $this->container['min'] ?? null; + } + + /** + * Sets min + * + * @param int|null $min the minimum value in the result set + * + * @return self + */ + public function setMin($min) + { + $this->container['min'] = $min; + + return $this; + } + + /** + * Gets max + * + * @return int|null + */ + public function getMax() + { + return $this->container['max'] ?? null; + } + + /** + * Sets max + * + * @param int|null $max the maximum value in the result set + * + * @return self + */ + public function setMax($max) + { + $this->container['max'] = $max; + + return $this; + } + + /** + * Gets avg + * + * @return int|null + */ + public function getAvg() + { + return $this->container['avg'] ?? null; + } + + /** + * Sets avg + * + * @param int|null $avg the average facet value in the result set + * + * @return self + */ + public function setAvg($avg) + { + $this->container['avg'] = $avg; + + return $this; + } + + /** + * Gets sum + * + * @return int|null + */ + public function getSum() + { + return $this->container['sum'] ?? null; + } + + /** + * Sets sum + * + * @param int|null $sum the sum of all values in the result set + * + * @return self + */ + public function setSum($sum) + { + $this->container['sum'] = $sum; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BatchAssignUserIdsParams.php b/clients/algoliasearch-client-php/lib/Model/Search/BatchAssignUserIdsParams.php new file mode 100644 index 0000000000..aa40ebcba3 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BatchAssignUserIdsParams.php @@ -0,0 +1,247 @@ + 'string', + 'users' => 'string[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'cluster' => null, + 'users' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'cluster' => 'setCluster', + 'users' => 'setUsers', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'cluster' => 'getCluster', + 'users' => 'getUsers', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['cluster'])) { + $this->container['cluster'] = $data['cluster']; + } + if (isset($data['users'])) { + $this->container['users'] = $data['users']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['cluster']) || $this->container['cluster'] === null) { + $invalidProperties[] = "'cluster' can't be null"; + } + if (!isset($this->container['users']) || $this->container['users'] === null) { + $invalidProperties[] = "'users' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets cluster + * + * @return string + */ + public function getCluster() + { + return $this->container['cluster'] ?? null; + } + + /** + * Sets cluster + * + * @param string $cluster name of the cluster + * + * @return self + */ + public function setCluster($cluster) + { + $this->container['cluster'] = $cluster; + + return $this; + } + + /** + * Gets users + * + * @return string[] + */ + public function getUsers() + { + return $this->container['users'] ?? null; + } + + /** + * Sets users + * + * @param string[] $users userIDs to assign. Note you cannot move users with this method. + * + * @return self + */ + public function setUsers($users) + { + $this->container['users'] = $users; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BatchDictionaryEntriesParams.php b/clients/algoliasearch-client-php/lib/Model/Search/BatchDictionaryEntriesParams.php new file mode 100644 index 0000000000..d4e4c1a113 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BatchDictionaryEntriesParams.php @@ -0,0 +1,244 @@ + 'bool', + 'requests' => '\Algolia\AlgoliaSearch\Model\Search\BatchDictionaryEntriesRequest[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'clearExistingDictionaryEntries' => null, + 'requests' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'clearExistingDictionaryEntries' => 'setClearExistingDictionaryEntries', + 'requests' => 'setRequests', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'clearExistingDictionaryEntries' => 'getClearExistingDictionaryEntries', + 'requests' => 'getRequests', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['clearExistingDictionaryEntries'])) { + $this->container['clearExistingDictionaryEntries'] = $data['clearExistingDictionaryEntries']; + } + if (isset($data['requests'])) { + $this->container['requests'] = $data['requests']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['requests']) || $this->container['requests'] === null) { + $invalidProperties[] = "'requests' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets clearExistingDictionaryEntries + * + * @return bool|null + */ + public function getClearExistingDictionaryEntries() + { + return $this->container['clearExistingDictionaryEntries'] ?? null; + } + + /** + * Sets clearExistingDictionaryEntries + * + * @param bool|null $clearExistingDictionaryEntries when `true`, start the batch by removing all the custom entries from the dictionary + * + * @return self + */ + public function setClearExistingDictionaryEntries($clearExistingDictionaryEntries) + { + $this->container['clearExistingDictionaryEntries'] = $clearExistingDictionaryEntries; + + return $this; + } + + /** + * Gets requests + * + * @return \Algolia\AlgoliaSearch\Model\Search\BatchDictionaryEntriesRequest[] + */ + public function getRequests() + { + return $this->container['requests'] ?? null; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\Search\BatchDictionaryEntriesRequest[] $requests List of operations to batch. Each operation is described by an `action` and a `body`. + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BatchDictionaryEntriesRequest.php b/clients/algoliasearch-client-php/lib/Model/Search/BatchDictionaryEntriesRequest.php new file mode 100644 index 0000000000..a6bab3b9e7 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BatchDictionaryEntriesRequest.php @@ -0,0 +1,245 @@ + '\Algolia\AlgoliaSearch\Model\Search\DictionaryAction', + 'body' => '\Algolia\AlgoliaSearch\Model\Search\DictionaryEntry', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'action' => null, + 'body' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction', + 'body' => 'setBody', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction', + 'body' => 'getBody', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['action'])) { + $this->container['action'] = $data['action']; + } + if (isset($data['body'])) { + $this->container['body'] = $data['body']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['action']) || $this->container['action'] === null) { + $invalidProperties[] = "'action' can't be null"; + } + if (!isset($this->container['body']) || $this->container['body'] === null) { + $invalidProperties[] = "'body' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets action + * + * @return \Algolia\AlgoliaSearch\Model\Search\DictionaryAction + */ + public function getAction() + { + return $this->container['action'] ?? null; + } + + /** + * Sets action + * + * @param \Algolia\AlgoliaSearch\Model\Search\DictionaryAction $action action + * + * @return self + */ + public function setAction($action) + { + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets body + * + * @return \Algolia\AlgoliaSearch\Model\Search\DictionaryEntry + */ + public function getBody() + { + return $this->container['body'] ?? null; + } + + /** + * Sets body + * + * @param \Algolia\AlgoliaSearch\Model\Search\DictionaryEntry $body body + * + * @return self + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BatchOperation.php b/clients/algoliasearch-client-php/lib/Model/Search/BatchOperation.php new file mode 100644 index 0000000000..67a0647784 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BatchOperation.php @@ -0,0 +1,238 @@ + '\Algolia\AlgoliaSearch\Model\Search\Action', + 'body' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'action' => null, + 'body' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction', + 'body' => 'setBody', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction', + 'body' => 'getBody', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['action'])) { + $this->container['action'] = $data['action']; + } + if (isset($data['body'])) { + $this->container['body'] = $data['body']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets action + * + * @return \Algolia\AlgoliaSearch\Model\Search\Action|null + */ + public function getAction() + { + return $this->container['action'] ?? null; + } + + /** + * Sets action + * + * @param \Algolia\AlgoliaSearch\Model\Search\Action|null $action action + * + * @return self + */ + public function setAction($action) + { + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets body + * + * @return object|null + */ + public function getBody() + { + return $this->container['body'] ?? null; + } + + /** + * Sets body + * + * @param object|null $body arguments to the operation (depends on the type of the operation) + * + * @return self + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BatchParams.php b/clients/algoliasearch-client-php/lib/Model/Search/BatchParams.php new file mode 100644 index 0000000000..fdc6eb8560 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BatchParams.php @@ -0,0 +1,209 @@ + '\Algolia\AlgoliaSearch\Model\Search\MultipleBatchOperation[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'requests' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['requests'])) { + $this->container['requests'] = $data['requests']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets requests + * + * @return \Algolia\AlgoliaSearch\Model\Search\MultipleBatchOperation[]|null + */ + public function getRequests() + { + return $this->container['requests'] ?? null; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\Search\MultipleBatchOperation[]|null $requests requests + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BatchResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/BatchResponse.php new file mode 100644 index 0000000000..55d1ba6bf6 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BatchResponse.php @@ -0,0 +1,238 @@ + 'int', + 'objectIDs' => 'string[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'taskID' => null, + 'objectIDs' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'taskID' => 'setTaskID', + 'objectIDs' => 'setObjectIDs', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'taskID' => 'getTaskID', + 'objectIDs' => 'getObjectIDs', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['taskID'])) { + $this->container['taskID'] = $data['taskID']; + } + if (isset($data['objectIDs'])) { + $this->container['objectIDs'] = $data['objectIDs']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets taskID + * + * @return int|null + */ + public function getTaskID() + { + return $this->container['taskID'] ?? null; + } + + /** + * Sets taskID + * + * @param int|null $taskID taskID of the task to wait for + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + + /** + * Gets objectIDs + * + * @return string[]|null + */ + public function getObjectIDs() + { + return $this->container['objectIDs'] ?? null; + } + + /** + * Sets objectIDs + * + * @param string[]|null $objectIDs list of objectID + * + * @return self + */ + public function setObjectIDs($objectIDs) + { + $this->container['objectIDs'] = $objectIDs; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BatchWriteParams.php b/clients/algoliasearch-client-php/lib/Model/Search/BatchWriteParams.php new file mode 100644 index 0000000000..132cac7905 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BatchWriteParams.php @@ -0,0 +1,209 @@ + '\Algolia\AlgoliaSearch\Model\Search\BatchOperation[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'requests' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['requests'])) { + $this->container['requests'] = $data['requests']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets requests + * + * @return \Algolia\AlgoliaSearch\Model\Search\BatchOperation[]|null + */ + public function getRequests() + { + return $this->container['requests'] ?? null; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\Search\BatchOperation[]|null $requests requests + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BrowseRequest.php b/clients/algoliasearch-client-php/lib/Model/Search/BrowseRequest.php new file mode 100644 index 0000000000..4f1d1c13dd --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BrowseRequest.php @@ -0,0 +1,238 @@ + 'string', + 'cursor' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'params' => null, + 'cursor' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'params' => 'setParams', + 'cursor' => 'setCursor', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'params' => 'getParams', + 'cursor' => 'getCursor', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['params'])) { + $this->container['params'] = $data['params']; + } + if (isset($data['cursor'])) { + $this->container['cursor'] = $data['cursor']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets params + * + * @return string|null + */ + public function getParams() + { + return $this->container['params'] ?? null; + } + + /** + * Sets params + * + * @param string|null $params search parameters as URL-encoded query string + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets cursor + * + * @return string|null + */ + public function getCursor() + { + return $this->container['cursor'] ?? null; + } + + /** + * Sets cursor + * + * @param string|null $cursor Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. + * + * @return self + */ + public function setCursor($cursor) + { + $this->container['cursor'] = $cursor; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BrowseResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/BrowseResponse.php new file mode 100644 index 0000000000..d7707a3c04 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BrowseResponse.php @@ -0,0 +1,1024 @@ + 'int', + 'abTestVariantID' => 'int', + 'aroundLatLng' => 'string', + 'automaticRadius' => 'string', + 'exhaustiveFacetsCount' => 'bool', + 'exhaustiveNbHits' => 'bool', + 'exhaustiveTypo' => 'bool', + 'facets' => 'array>', + 'facetsStats' => 'array', + 'hitsPerPage' => 'int', + 'index' => 'string', + 'indexUsed' => 'string', + 'message' => 'string', + 'nbHits' => 'int', + 'nbPages' => 'int', + 'nbSortedHits' => 'int', + 'page' => 'int', + 'params' => 'string', + 'parsedQuery' => 'string', + 'processingTimeMS' => 'int', + 'query' => 'string', + 'queryAfterRemoval' => 'string', + 'serverUsed' => 'string', + 'userData' => 'object', + 'hits' => '\Algolia\AlgoliaSearch\Model\Search\Hit[]', + 'cursor' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'abTestID' => null, + 'abTestVariantID' => null, + 'aroundLatLng' => null, + 'automaticRadius' => null, + 'exhaustiveFacetsCount' => null, + 'exhaustiveNbHits' => null, + 'exhaustiveTypo' => null, + 'facets' => null, + 'facetsStats' => null, + 'hitsPerPage' => null, + 'index' => null, + 'indexUsed' => null, + 'message' => null, + 'nbHits' => null, + 'nbPages' => null, + 'nbSortedHits' => null, + 'page' => null, + 'params' => null, + 'parsedQuery' => null, + 'processingTimeMS' => null, + 'query' => null, + 'queryAfterRemoval' => null, + 'serverUsed' => null, + 'userData' => null, + 'hits' => null, + 'cursor' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abTestID' => 'setAbTestID', + 'abTestVariantID' => 'setAbTestVariantID', + 'aroundLatLng' => 'setAroundLatLng', + 'automaticRadius' => 'setAutomaticRadius', + 'exhaustiveFacetsCount' => 'setExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'setExhaustiveNbHits', + 'exhaustiveTypo' => 'setExhaustiveTypo', + 'facets' => 'setFacets', + 'facetsStats' => 'setFacetsStats', + 'hitsPerPage' => 'setHitsPerPage', + 'index' => 'setIndex', + 'indexUsed' => 'setIndexUsed', + 'message' => 'setMessage', + 'nbHits' => 'setNbHits', + 'nbPages' => 'setNbPages', + 'nbSortedHits' => 'setNbSortedHits', + 'page' => 'setPage', + 'params' => 'setParams', + 'parsedQuery' => 'setParsedQuery', + 'processingTimeMS' => 'setProcessingTimeMS', + 'query' => 'setQuery', + 'queryAfterRemoval' => 'setQueryAfterRemoval', + 'serverUsed' => 'setServerUsed', + 'userData' => 'setUserData', + 'hits' => 'setHits', + 'cursor' => 'setCursor', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abTestID' => 'getAbTestID', + 'abTestVariantID' => 'getAbTestVariantID', + 'aroundLatLng' => 'getAroundLatLng', + 'automaticRadius' => 'getAutomaticRadius', + 'exhaustiveFacetsCount' => 'getExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'getExhaustiveNbHits', + 'exhaustiveTypo' => 'getExhaustiveTypo', + 'facets' => 'getFacets', + 'facetsStats' => 'getFacetsStats', + 'hitsPerPage' => 'getHitsPerPage', + 'index' => 'getIndex', + 'indexUsed' => 'getIndexUsed', + 'message' => 'getMessage', + 'nbHits' => 'getNbHits', + 'nbPages' => 'getNbPages', + 'nbSortedHits' => 'getNbSortedHits', + 'page' => 'getPage', + 'params' => 'getParams', + 'parsedQuery' => 'getParsedQuery', + 'processingTimeMS' => 'getProcessingTimeMS', + 'query' => 'getQuery', + 'queryAfterRemoval' => 'getQueryAfterRemoval', + 'serverUsed' => 'getServerUsed', + 'userData' => 'getUserData', + 'hits' => 'getHits', + 'cursor' => 'getCursor', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['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['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['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + 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['nbHits'])) { + $this->container['nbHits'] = $data['nbHits']; + } + if (isset($data['nbPages'])) { + $this->container['nbPages'] = $data['nbPages']; + } + if (isset($data['nbSortedHits'])) { + $this->container['nbSortedHits'] = $data['nbSortedHits']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['params'])) { + $this->container['params'] = $data['params']; + } + if (isset($data['parsedQuery'])) { + $this->container['parsedQuery'] = $data['parsedQuery']; + } + if (isset($data['processingTimeMS'])) { + $this->container['processingTimeMS'] = $data['processingTimeMS']; + } + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['queryAfterRemoval'])) { + $this->container['queryAfterRemoval'] = $data['queryAfterRemoval']; + } + if (isset($data['serverUsed'])) { + $this->container['serverUsed'] = $data['serverUsed']; + } + if (isset($data['userData'])) { + $this->container['userData'] = $data['userData']; + } + if (isset($data['hits'])) { + $this->container['hits'] = $data['hits']; + } + if (isset($data['cursor'])) { + $this->container['cursor'] = $data['cursor']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (isset($this->container['aroundLatLng']) && !preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $this->container['aroundLatLng'])) { + $invalidProperties[] = "invalid value for 'aroundLatLng', must be conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."; + } + + if (!isset($this->container['exhaustiveNbHits']) || $this->container['exhaustiveNbHits'] === null) { + $invalidProperties[] = "'exhaustiveNbHits' can't be null"; + } + if (!isset($this->container['exhaustiveTypo']) || $this->container['exhaustiveTypo'] === null) { + $invalidProperties[] = "'exhaustiveTypo' can't be null"; + } + if (!isset($this->container['hitsPerPage']) || $this->container['hitsPerPage'] === null) { + $invalidProperties[] = "'hitsPerPage' can't be null"; + } + if (!isset($this->container['nbHits']) || $this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if (!isset($this->container['nbPages']) || $this->container['nbPages'] === null) { + $invalidProperties[] = "'nbPages' can't be null"; + } + if (!isset($this->container['page']) || $this->container['page'] === null) { + $invalidProperties[] = "'page' can't be null"; + } + if (!isset($this->container['params']) || $this->container['params'] === null) { + $invalidProperties[] = "'params' can't be null"; + } + if (!isset($this->container['processingTimeMS']) || $this->container['processingTimeMS'] === null) { + $invalidProperties[] = "'processingTimeMS' can't be null"; + } + if (!isset($this->container['query']) || $this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + if (!isset($this->container['hits']) || $this->container['hits'] === null) { + $invalidProperties[] = "'hits' can't be null"; + } + if (!isset($this->container['cursor']) || $this->container['cursor'] === null) { + $invalidProperties[] = "'cursor' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets abTestID + * + * @return int|null + */ + public function getAbTestID() + { + return $this->container['abTestID'] ?? null; + } + + /** + * Sets abTestID + * + * @param int|null $abTestID if a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets abTestVariantID + * + * @return int|null + */ + public function getAbTestVariantID() + { + return $this->container['abTestVariantID'] ?? null; + } + + /** + * Sets abTestVariantID + * + * @param int|null $abTestVariantID if a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used + * + * @return self + */ + public function setAbTestVariantID($abTestVariantID) + { + $this->container['abTestVariantID'] = $abTestVariantID; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng'] ?? null; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng the computed geo location + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + if (!is_null($aroundLatLng) && (!preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $aroundLatLng))) { + throw new \InvalidArgumentException("invalid value for $aroundLatLng when calling BrowseResponse., must conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."); + } + + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets automaticRadius + * + * @return string|null + */ + public function getAutomaticRadius() + { + return $this->container['automaticRadius'] ?? null; + } + + /** + * Sets automaticRadius + * + * @param string|null $automaticRadius The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. + * + * @return self + */ + public function setAutomaticRadius($automaticRadius) + { + $this->container['automaticRadius'] = $automaticRadius; + + return $this; + } + + /** + * Gets exhaustiveFacetsCount + * + * @return bool|null + */ + public function getExhaustiveFacetsCount() + { + return $this->container['exhaustiveFacetsCount'] ?? null; + } + + /** + * Sets exhaustiveFacetsCount + * + * @param bool|null $exhaustiveFacetsCount whether the facet count is exhaustive or approximate + * + * @return self + */ + public function setExhaustiveFacetsCount($exhaustiveFacetsCount) + { + $this->container['exhaustiveFacetsCount'] = $exhaustiveFacetsCount; + + return $this; + } + + /** + * Gets exhaustiveNbHits + * + * @return bool + */ + public function getExhaustiveNbHits() + { + return $this->container['exhaustiveNbHits'] ?? null; + } + + /** + * Sets exhaustiveNbHits + * + * @param bool $exhaustiveNbHits indicate if the nbHits count was exhaustive or approximate + * + * @return self + */ + public function setExhaustiveNbHits($exhaustiveNbHits) + { + $this->container['exhaustiveNbHits'] = $exhaustiveNbHits; + + return $this; + } + + /** + * Gets exhaustiveTypo + * + * @return bool + */ + public function getExhaustiveTypo() + { + return $this->container['exhaustiveTypo'] ?? null; + } + + /** + * Sets exhaustiveTypo + * + * @param bool $exhaustiveTypo indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * + * @return self + */ + public function setExhaustiveTypo($exhaustiveTypo) + { + $this->container['exhaustiveTypo'] = $exhaustiveTypo; + + return $this; + } + + /** + * Gets facets + * + * @return array>|null + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets + * + * @param array>|null $facets a mapping of each facet name to the corresponding facet counts + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets facetsStats + * + * @return array|null + */ + public function getFacetsStats() + { + return $this->container['facetsStats'] ?? null; + } + + /** + * Sets facetsStats + * + * @param array|null $facetsStats statistics for numerical facets + * + * @return self + */ + public function setFacetsStats($facetsStats) + { + $this->container['facetsStats'] = $facetsStats; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets index + * + * @return string|null + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index + * + * @param string|null $index index name used for the query + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets indexUsed + * + * @return string|null + */ + public function getIndexUsed() + { + return $this->container['indexUsed'] ?? null; + } + + /** + * Sets indexUsed + * + * @param string|null $indexUsed Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. + * + * @return self + */ + public function setIndexUsed($indexUsed) + { + $this->container['indexUsed'] = $indexUsed; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string|null $message used to return warnings about the query + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits'] ?? null; + } + + /** + * Sets nbHits + * + * @param int $nbHits number of hits that the search query matched + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets nbPages + * + * @return int + */ + public function getNbPages() + { + return $this->container['nbPages'] ?? null; + } + + /** + * Sets nbPages + * + * @param int $nbPages number of pages available for the current query + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + + /** + * Gets nbSortedHits + * + * @return int|null + */ + public function getNbSortedHits() + { + return $this->container['nbSortedHits'] ?? null; + } + + /** + * Sets nbSortedHits + * + * @param int|null $nbSortedHits the number of hits selected and sorted by the relevant sort algorithm + * + * @return self + */ + public function setNbSortedHits($nbSortedHits) + { + $this->container['nbSortedHits'] = $nbSortedHits; + + return $this; + } + + /** + * Gets page + * + * @return int + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets params + * + * @return string + */ + public function getParams() + { + return $this->container['params'] ?? null; + } + + /** + * Sets params + * + * @param string $params a url-encoded string of all search parameters + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets parsedQuery + * + * @return string|null + */ + public function getParsedQuery() + { + return $this->container['parsedQuery'] ?? null; + } + + /** + * Sets parsedQuery + * + * @param string|null $parsedQuery the query string that will be searched, after normalization + * + * @return self + */ + public function setParsedQuery($parsedQuery) + { + $this->container['parsedQuery'] = $parsedQuery; + + return $this; + } + + /** + * Gets processingTimeMS + * + * @return int + */ + public function getProcessingTimeMS() + { + return $this->container['processingTimeMS'] ?? 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 query + * + * @return string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets queryAfterRemoval + * + * @return string|null + */ + public function getQueryAfterRemoval() + { + return $this->container['queryAfterRemoval'] ?? null; + } + + /** + * Sets queryAfterRemoval + * + * @param string|null $queryAfterRemoval a markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set + * + * @return self + */ + public function setQueryAfterRemoval($queryAfterRemoval) + { + $this->container['queryAfterRemoval'] = $queryAfterRemoval; + + return $this; + } + + /** + * Gets serverUsed + * + * @return string|null + */ + public function getServerUsed() + { + return $this->container['serverUsed'] ?? null; + } + + /** + * Sets serverUsed + * + * @param string|null $serverUsed actual host name of the server that processed the request + * + * @return self + */ + public function setServerUsed($serverUsed) + { + $this->container['serverUsed'] = $serverUsed; + + return $this; + } + + /** + * Gets userData + * + * @return object|null + */ + public function getUserData() + { + return $this->container['userData'] ?? null; + } + + /** + * Sets userData + * + * @param object|null $userData lets you store custom data in your indices + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + + /** + * Gets hits + * + * @return \Algolia\AlgoliaSearch\Model\Search\Hit[] + */ + public function getHits() + { + return $this->container['hits'] ?? null; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Search\Hit[] $hits hits + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + + /** + * Gets cursor + * + * @return string + */ + public function getCursor() + { + return $this->container['cursor'] ?? null; + } + + /** + * Sets cursor + * + * @param string $cursor Cursor indicating the location to resume browsing from. Must match the value returned by the previous call. + * + * @return self + */ + public function setCursor($cursor) + { + $this->container['cursor'] = $cursor; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BuiltInOperation.php b/clients/algoliasearch-client-php/lib/Model/Search/BuiltInOperation.php new file mode 100644 index 0000000000..2ab2fe72c9 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BuiltInOperation.php @@ -0,0 +1,247 @@ + '\Algolia\AlgoliaSearch\Model\Search\BuiltInOperationType', + 'value' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'operation' => null, + 'value' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'value' => 'setValue', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'value' => 'getValue', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['operation'])) { + $this->container['operation'] = $data['operation']; + } + if (isset($data['value'])) { + $this->container['value'] = $data['value']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['operation']) || $this->container['operation'] === null) { + $invalidProperties[] = "'operation' can't be null"; + } + if (!isset($this->container['value']) || $this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets operation + * + * @return \Algolia\AlgoliaSearch\Model\Search\BuiltInOperationType + */ + public function getOperation() + { + return $this->container['operation'] ?? null; + } + + /** + * Sets operation + * + * @param \Algolia\AlgoliaSearch\Model\Search\BuiltInOperationType $operation operation + * + * @return self + */ + public function setOperation($operation) + { + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value + * + * @param string $value the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/BuiltInOperationType.php b/clients/algoliasearch-client-php/lib/Model/Search/BuiltInOperationType.php new file mode 100644 index 0000000000..fdceaaf4af --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/BuiltInOperationType.php @@ -0,0 +1,50 @@ + 'string', + 'anchoring' => '\Algolia\AlgoliaSearch\Model\Search\Anchoring', + 'alternatives' => 'bool', + 'context' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'pattern' => null, + 'anchoring' => null, + 'alternatives' => null, + 'context' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'pattern' => 'setPattern', + 'anchoring' => 'setAnchoring', + 'alternatives' => 'setAlternatives', + 'context' => 'setContext', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'pattern' => 'getPattern', + 'anchoring' => 'getAnchoring', + 'alternatives' => 'getAlternatives', + 'context' => 'getContext', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['pattern'])) { + $this->container['pattern'] = $data['pattern']; + } + if (isset($data['anchoring'])) { + $this->container['anchoring'] = $data['anchoring']; + } + if (isset($data['alternatives'])) { + $this->container['alternatives'] = $data['alternatives']; + } + if (isset($data['context'])) { + $this->container['context'] = $data['context']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets pattern + * + * @return string|null + */ + public function getPattern() + { + return $this->container['pattern'] ?? null; + } + + /** + * Sets pattern + * + * @param string|null $pattern query pattern syntax + * + * @return self + */ + public function setPattern($pattern) + { + $this->container['pattern'] = $pattern; + + return $this; + } + + /** + * Gets anchoring + * + * @return \Algolia\AlgoliaSearch\Model\Search\Anchoring|null + */ + public function getAnchoring() + { + return $this->container['anchoring'] ?? null; + } + + /** + * Sets anchoring + * + * @param \Algolia\AlgoliaSearch\Model\Search\Anchoring|null $anchoring anchoring + * + * @return self + */ + public function setAnchoring($anchoring) + { + $this->container['anchoring'] = $anchoring; + + return $this; + } + + /** + * Gets alternatives + * + * @return bool|null + */ + public function getAlternatives() + { + return $this->container['alternatives'] ?? null; + } + + /** + * Sets alternatives + * + * @param bool|null $alternatives whether the pattern matches on plurals, synonyms, and typos + * + * @return self + */ + public function setAlternatives($alternatives) + { + $this->container['alternatives'] = $alternatives; + + return $this; + } + + /** + * Gets context + * + * @return string|null + */ + public function getContext() + { + return $this->container['context'] ?? null; + } + + /** + * Sets context + * + * @param string|null $context rule context format: [A-Za-z0-9_-]+) + * + * @return self + */ + public function setContext($context) + { + $this->container['context'] = $context; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/Consequence.php b/clients/algoliasearch-client-php/lib/Model/Search/Consequence.php new file mode 100644 index 0000000000..e8f42dd340 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/Consequence.php @@ -0,0 +1,333 @@ + '\Algolia\AlgoliaSearch\Model\Search\ConsequenceParams', + 'promote' => '\Algolia\AlgoliaSearch\Model\Search\Promote[]', + 'filterPromotes' => 'bool', + 'hide' => '\Algolia\AlgoliaSearch\Model\Search\ConsequenceHide[]', + 'userData' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'params' => null, + 'promote' => null, + 'filterPromotes' => null, + 'hide' => null, + 'userData' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'params' => 'setParams', + 'promote' => 'setPromote', + 'filterPromotes' => 'setFilterPromotes', + 'hide' => 'setHide', + 'userData' => 'setUserData', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'params' => 'getParams', + 'promote' => 'getPromote', + 'filterPromotes' => 'getFilterPromotes', + 'hide' => 'getHide', + 'userData' => 'getUserData', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['params'])) { + $this->container['params'] = $data['params']; + } + if (isset($data['promote'])) { + $this->container['promote'] = $data['promote']; + } + if (isset($data['filterPromotes'])) { + $this->container['filterPromotes'] = $data['filterPromotes']; + } + if (isset($data['hide'])) { + $this->container['hide'] = $data['hide']; + } + if (isset($data['userData'])) { + $this->container['userData'] = $data['userData']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets params + * + * @return \Algolia\AlgoliaSearch\Model\Search\ConsequenceParams|null + */ + public function getParams() + { + return $this->container['params'] ?? null; + } + + /** + * Sets params + * + * @param \Algolia\AlgoliaSearch\Model\Search\ConsequenceParams|null $params params + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets promote + * + * @return \Algolia\AlgoliaSearch\Model\Search\Promote[]|null + */ + public function getPromote() + { + return $this->container['promote'] ?? null; + } + + /** + * Sets promote + * + * @param \Algolia\AlgoliaSearch\Model\Search\Promote[]|null $promote objects to promote as hits + * + * @return self + */ + public function setPromote($promote) + { + $this->container['promote'] = $promote; + + return $this; + } + + /** + * Gets filterPromotes + * + * @return bool|null + */ + public function getFilterPromotes() + { + return $this->container['filterPromotes'] ?? null; + } + + /** + * Sets filterPromotes + * + * @param bool|null $filterPromotes Only use in combination with the promote consequence. When true, promoted results will be restricted to match the filters of the current search. When false, the promoted results will show up regardless of the filters. + * + * @return self + */ + public function setFilterPromotes($filterPromotes) + { + $this->container['filterPromotes'] = $filterPromotes; + + return $this; + } + + /** + * Gets hide + * + * @return \Algolia\AlgoliaSearch\Model\Search\ConsequenceHide[]|null + */ + public function getHide() + { + return $this->container['hide'] ?? null; + } + + /** + * Sets hide + * + * @param \Algolia\AlgoliaSearch\Model\Search\ConsequenceHide[]|null $hide Objects to hide from hits. Each object must contain an objectID field. By default, you can hide up to 50 items per rule. + * + * @return self + */ + public function setHide($hide) + { + $this->container['hide'] = $hide; + + return $this; + } + + /** + * Gets userData + * + * @return object|null + */ + public function getUserData() + { + return $this->container['userData'] ?? null; + } + + /** + * Sets userData + * + * @param object|null $userData Custom JSON object that will be appended to the userData array in the response. This object isn't interpreted by the API. It's limited to 1kB of minified JSON. + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/ConsequenceHide.php b/clients/algoliasearch-client-php/lib/Model/Search/ConsequenceHide.php new file mode 100644 index 0000000000..f36491fa35 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/ConsequenceHide.php @@ -0,0 +1,213 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'objectID' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['objectID']) || $this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/ConsequenceParams.php b/clients/algoliasearch-client-php/lib/Model/Search/ConsequenceParams.php new file mode 100644 index 0000000000..d100b88941 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/ConsequenceParams.php @@ -0,0 +1,2885 @@ + 'string', + 'automaticFacetFilters' => '\Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]', + 'automaticOptionalFacetFilters' => '\Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]', + 'similarQuery' => 'string', + 'filters' => 'string', + 'facetFilters' => 'string[]', + 'optionalFilters' => 'string[]', + 'numericFilters' => 'string[]', + 'tagFilters' => 'string[]', + 'sumOrFiltersScores' => 'bool', + 'facets' => 'string[]', + 'maxValuesPerFacet' => 'int', + 'facetingAfterDistinct' => 'bool', + 'sortFacetValuesBy' => 'string', + 'page' => 'int', + 'offset' => 'int', + 'length' => 'int', + 'aroundLatLng' => 'string', + 'aroundLatLngViaIP' => 'bool', + 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', + 'aroundPrecision' => 'int', + 'minimumAroundRadius' => 'int', + 'insideBoundingBox' => 'float[]', + 'insidePolygon' => 'float[]', + 'naturalLanguages' => 'string[]', + 'ruleContexts' => 'string[]', + 'personalizationImpact' => 'int', + 'userToken' => 'string', + 'getRankingInfo' => 'bool', + 'clickAnalytics' => 'bool', + 'analytics' => 'bool', + 'analyticsTags' => 'string[]', + 'percentileComputation' => 'bool', + 'enableABTest' => 'bool', + 'enableReRanking' => 'bool', + 'searchableAttributes' => 'string[]', + 'attributesForFaceting' => 'string[]', + 'unretrievableAttributes' => 'string[]', + 'attributesToRetrieve' => 'string[]', + 'restrictSearchableAttributes' => 'string[]', + 'ranking' => 'string[]', + 'customRanking' => 'string[]', + 'relevancyStrictness' => 'int', + 'attributesToHighlight' => 'string[]', + 'attributesToSnippet' => 'string[]', + 'highlightPreTag' => 'string', + 'highlightPostTag' => 'string', + 'snippetEllipsisText' => 'string', + 'restrictHighlightAndSnippetArrays' => 'bool', + 'hitsPerPage' => 'int', + 'minWordSizefor1Typo' => 'int', + 'minWordSizefor2Typos' => 'int', + 'typoTolerance' => 'string', + 'allowTyposOnNumericTokens' => 'bool', + 'disableTypoToleranceOnAttributes' => 'string[]', + 'separatorsToIndex' => 'string', + 'ignorePlurals' => 'string', + 'removeStopWords' => 'string', + 'keepDiacriticsOnCharacters' => 'string', + 'queryLanguages' => 'string[]', + 'decompoundQuery' => 'bool', + 'enableRules' => 'bool', + 'enablePersonalization' => 'bool', + 'queryType' => 'string', + 'removeWordsIfNoResults' => 'string', + 'advancedSyntax' => 'bool', + 'optionalWords' => 'string[]', + 'disableExactOnAttributes' => 'string[]', + 'exactOnSingleWordQuery' => 'string', + 'alternativesAsExact' => 'string[]', + 'advancedSyntaxFeatures' => 'string[]', + 'distinct' => 'int', + 'synonyms' => 'bool', + 'replaceSynonymsInHighlight' => 'bool', + 'minProximity' => 'int', + 'responseFields' => 'string[]', + 'maxFacetHits' => 'int', + 'attributeCriteriaComputedByMinProximity' => 'bool', + 'renderingContent' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'query' => null, + 'automaticFacetFilters' => null, + 'automaticOptionalFacetFilters' => null, + 'similarQuery' => null, + 'filters' => null, + 'facetFilters' => null, + 'optionalFilters' => null, + 'numericFilters' => null, + 'tagFilters' => null, + 'sumOrFiltersScores' => null, + 'facets' => null, + 'maxValuesPerFacet' => null, + 'facetingAfterDistinct' => null, + 'sortFacetValuesBy' => null, + 'page' => null, + 'offset' => null, + 'length' => null, + 'aroundLatLng' => null, + 'aroundLatLngViaIP' => null, + 'aroundRadius' => null, + 'aroundPrecision' => null, + 'minimumAroundRadius' => null, + 'insideBoundingBox' => null, + 'insidePolygon' => null, + 'naturalLanguages' => null, + 'ruleContexts' => null, + 'personalizationImpact' => null, + 'userToken' => null, + 'getRankingInfo' => null, + 'clickAnalytics' => null, + 'analytics' => null, + 'analyticsTags' => null, + 'percentileComputation' => null, + 'enableABTest' => null, + 'enableReRanking' => null, + 'searchableAttributes' => null, + 'attributesForFaceting' => null, + 'unretrievableAttributes' => null, + 'attributesToRetrieve' => null, + 'restrictSearchableAttributes' => null, + 'ranking' => null, + 'customRanking' => null, + 'relevancyStrictness' => null, + 'attributesToHighlight' => null, + 'attributesToSnippet' => null, + 'highlightPreTag' => null, + 'highlightPostTag' => null, + 'snippetEllipsisText' => null, + 'restrictHighlightAndSnippetArrays' => null, + 'hitsPerPage' => null, + 'minWordSizefor1Typo' => null, + 'minWordSizefor2Typos' => null, + 'typoTolerance' => null, + 'allowTyposOnNumericTokens' => null, + 'disableTypoToleranceOnAttributes' => null, + 'separatorsToIndex' => null, + 'ignorePlurals' => null, + 'removeStopWords' => null, + 'keepDiacriticsOnCharacters' => null, + 'queryLanguages' => null, + 'decompoundQuery' => null, + 'enableRules' => null, + 'enablePersonalization' => null, + 'queryType' => null, + 'removeWordsIfNoResults' => null, + 'advancedSyntax' => null, + 'optionalWords' => null, + 'disableExactOnAttributes' => null, + 'exactOnSingleWordQuery' => null, + 'alternativesAsExact' => null, + 'advancedSyntaxFeatures' => null, + 'distinct' => null, + 'synonyms' => null, + 'replaceSynonymsInHighlight' => null, + 'minProximity' => null, + 'responseFields' => null, + 'maxFacetHits' => null, + 'attributeCriteriaComputedByMinProximity' => null, + 'renderingContent' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'automaticFacetFilters' => 'setAutomaticFacetFilters', + 'automaticOptionalFacetFilters' => 'setAutomaticOptionalFacetFilters', + 'similarQuery' => 'setSimilarQuery', + 'filters' => 'setFilters', + 'facetFilters' => 'setFacetFilters', + 'optionalFilters' => 'setOptionalFilters', + 'numericFilters' => 'setNumericFilters', + 'tagFilters' => 'setTagFilters', + 'sumOrFiltersScores' => 'setSumOrFiltersScores', + 'facets' => 'setFacets', + 'maxValuesPerFacet' => 'setMaxValuesPerFacet', + 'facetingAfterDistinct' => 'setFacetingAfterDistinct', + 'sortFacetValuesBy' => 'setSortFacetValuesBy', + 'page' => 'setPage', + 'offset' => 'setOffset', + 'length' => 'setLength', + 'aroundLatLng' => 'setAroundLatLng', + 'aroundLatLngViaIP' => 'setAroundLatLngViaIP', + 'aroundRadius' => 'setAroundRadius', + 'aroundPrecision' => 'setAroundPrecision', + 'minimumAroundRadius' => 'setMinimumAroundRadius', + 'insideBoundingBox' => 'setInsideBoundingBox', + 'insidePolygon' => 'setInsidePolygon', + 'naturalLanguages' => 'setNaturalLanguages', + 'ruleContexts' => 'setRuleContexts', + 'personalizationImpact' => 'setPersonalizationImpact', + 'userToken' => 'setUserToken', + 'getRankingInfo' => 'setGetRankingInfo', + 'clickAnalytics' => 'setClickAnalytics', + 'analytics' => 'setAnalytics', + 'analyticsTags' => 'setAnalyticsTags', + 'percentileComputation' => 'setPercentileComputation', + 'enableABTest' => 'setEnableABTest', + 'enableReRanking' => 'setEnableReRanking', + 'searchableAttributes' => 'setSearchableAttributes', + 'attributesForFaceting' => 'setAttributesForFaceting', + 'unretrievableAttributes' => 'setUnretrievableAttributes', + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'restrictSearchableAttributes' => 'setRestrictSearchableAttributes', + 'ranking' => 'setRanking', + 'customRanking' => 'setCustomRanking', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'attributesToHighlight' => 'setAttributesToHighlight', + 'attributesToSnippet' => 'setAttributesToSnippet', + 'highlightPreTag' => 'setHighlightPreTag', + 'highlightPostTag' => 'setHighlightPostTag', + 'snippetEllipsisText' => 'setSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'setRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'setHitsPerPage', + 'minWordSizefor1Typo' => 'setMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'setMinWordSizefor2Typos', + 'typoTolerance' => 'setTypoTolerance', + 'allowTyposOnNumericTokens' => 'setAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'setDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'setSeparatorsToIndex', + 'ignorePlurals' => 'setIgnorePlurals', + 'removeStopWords' => 'setRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'setKeepDiacriticsOnCharacters', + 'queryLanguages' => 'setQueryLanguages', + 'decompoundQuery' => 'setDecompoundQuery', + 'enableRules' => 'setEnableRules', + 'enablePersonalization' => 'setEnablePersonalization', + 'queryType' => 'setQueryType', + 'removeWordsIfNoResults' => 'setRemoveWordsIfNoResults', + 'advancedSyntax' => 'setAdvancedSyntax', + 'optionalWords' => 'setOptionalWords', + 'disableExactOnAttributes' => 'setDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'setExactOnSingleWordQuery', + 'alternativesAsExact' => 'setAlternativesAsExact', + 'advancedSyntaxFeatures' => 'setAdvancedSyntaxFeatures', + 'distinct' => 'setDistinct', + 'synonyms' => 'setSynonyms', + 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', + 'minProximity' => 'setMinProximity', + 'responseFields' => 'setResponseFields', + 'maxFacetHits' => 'setMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'setRenderingContent', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'automaticFacetFilters' => 'getAutomaticFacetFilters', + 'automaticOptionalFacetFilters' => 'getAutomaticOptionalFacetFilters', + 'similarQuery' => 'getSimilarQuery', + 'filters' => 'getFilters', + 'facetFilters' => 'getFacetFilters', + 'optionalFilters' => 'getOptionalFilters', + 'numericFilters' => 'getNumericFilters', + 'tagFilters' => 'getTagFilters', + 'sumOrFiltersScores' => 'getSumOrFiltersScores', + 'facets' => 'getFacets', + 'maxValuesPerFacet' => 'getMaxValuesPerFacet', + 'facetingAfterDistinct' => 'getFacetingAfterDistinct', + 'sortFacetValuesBy' => 'getSortFacetValuesBy', + 'page' => 'getPage', + 'offset' => 'getOffset', + 'length' => 'getLength', + 'aroundLatLng' => 'getAroundLatLng', + 'aroundLatLngViaIP' => 'getAroundLatLngViaIP', + 'aroundRadius' => 'getAroundRadius', + 'aroundPrecision' => 'getAroundPrecision', + 'minimumAroundRadius' => 'getMinimumAroundRadius', + 'insideBoundingBox' => 'getInsideBoundingBox', + 'insidePolygon' => 'getInsidePolygon', + 'naturalLanguages' => 'getNaturalLanguages', + 'ruleContexts' => 'getRuleContexts', + 'personalizationImpact' => 'getPersonalizationImpact', + 'userToken' => 'getUserToken', + 'getRankingInfo' => 'getGetRankingInfo', + 'clickAnalytics' => 'getClickAnalytics', + 'analytics' => 'getAnalytics', + 'analyticsTags' => 'getAnalyticsTags', + 'percentileComputation' => 'getPercentileComputation', + 'enableABTest' => 'getEnableABTest', + 'enableReRanking' => 'getEnableReRanking', + 'searchableAttributes' => 'getSearchableAttributes', + 'attributesForFaceting' => 'getAttributesForFaceting', + 'unretrievableAttributes' => 'getUnretrievableAttributes', + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'restrictSearchableAttributes' => 'getRestrictSearchableAttributes', + 'ranking' => 'getRanking', + 'customRanking' => 'getCustomRanking', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'attributesToHighlight' => 'getAttributesToHighlight', + 'attributesToSnippet' => 'getAttributesToSnippet', + 'highlightPreTag' => 'getHighlightPreTag', + 'highlightPostTag' => 'getHighlightPostTag', + 'snippetEllipsisText' => 'getSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'getRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'getHitsPerPage', + 'minWordSizefor1Typo' => 'getMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'getMinWordSizefor2Typos', + 'typoTolerance' => 'getTypoTolerance', + 'allowTyposOnNumericTokens' => 'getAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'getDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'getSeparatorsToIndex', + 'ignorePlurals' => 'getIgnorePlurals', + 'removeStopWords' => 'getRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'getKeepDiacriticsOnCharacters', + 'queryLanguages' => 'getQueryLanguages', + 'decompoundQuery' => 'getDecompoundQuery', + 'enableRules' => 'getEnableRules', + 'enablePersonalization' => 'getEnablePersonalization', + 'queryType' => 'getQueryType', + 'removeWordsIfNoResults' => 'getRemoveWordsIfNoResults', + 'advancedSyntax' => 'getAdvancedSyntax', + 'optionalWords' => 'getOptionalWords', + 'disableExactOnAttributes' => 'getDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'getExactOnSingleWordQuery', + 'alternativesAsExact' => 'getAlternativesAsExact', + 'advancedSyntaxFeatures' => 'getAdvancedSyntaxFeatures', + 'distinct' => 'getDistinct', + 'synonyms' => 'getSynonyms', + 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', + 'minProximity' => 'getMinProximity', + 'responseFields' => 'getResponseFields', + 'maxFacetHits' => 'getMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'getRenderingContent', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + const TYPO_TOLERANCE_TRUE = 'true'; + const TYPO_TOLERANCE_FALSE = 'false'; + const TYPO_TOLERANCE_MIN = 'min'; + const TYPO_TOLERANCE_STRICT = 'strict'; + const QUERY_TYPE_PREFIX_LAST = 'prefixLast'; + const QUERY_TYPE_PREFIX_ALL = 'prefixAll'; + const QUERY_TYPE_PREFIX_NONE = 'prefixNone'; + const REMOVE_WORDS_IF_NO_RESULTS_NONE = 'none'; + const REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS = 'lastWords'; + const REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS = 'firstWords'; + const REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL = 'allOptional'; + const EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE = 'attribute'; + const EXACT_ON_SINGLE_WORD_QUERY_NONE = 'none'; + const EXACT_ON_SINGLE_WORD_QUERY_WORD = 'word'; + const ALTERNATIVES_AS_EXACT_IGNORE_PLURALS = 'ignorePlurals'; + const ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM = 'singleWordSynonym'; + const ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM = 'multiWordsSynonym'; + const ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE = 'exactPhrase'; + const ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS = 'excludeWords'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypoToleranceAllowableValues() + { + return [ + self::TYPO_TOLERANCE_TRUE, + self::TYPO_TOLERANCE_FALSE, + self::TYPO_TOLERANCE_MIN, + self::TYPO_TOLERANCE_STRICT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getQueryTypeAllowableValues() + { + return [ + self::QUERY_TYPE_PREFIX_LAST, + self::QUERY_TYPE_PREFIX_ALL, + self::QUERY_TYPE_PREFIX_NONE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemoveWordsIfNoResultsAllowableValues() + { + return [ + self::REMOVE_WORDS_IF_NO_RESULTS_NONE, + self::REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExactOnSingleWordQueryAllowableValues() + { + return [ + self::EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE, + self::EXACT_ON_SINGLE_WORD_QUERY_NONE, + self::EXACT_ON_SINGLE_WORD_QUERY_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAlternativesAsExactAllowableValues() + { + return [ + self::ALTERNATIVES_AS_EXACT_IGNORE_PLURALS, + self::ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM, + self::ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdvancedSyntaxFeaturesAllowableValues() + { + return [ + self::ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE, + self::ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['automaticFacetFilters'])) { + $this->container['automaticFacetFilters'] = $data['automaticFacetFilters']; + } + if (isset($data['automaticOptionalFacetFilters'])) { + $this->container['automaticOptionalFacetFilters'] = $data['automaticOptionalFacetFilters']; + } + if (isset($data['similarQuery'])) { + $this->container['similarQuery'] = $data['similarQuery']; + } + if (isset($data['filters'])) { + $this->container['filters'] = $data['filters']; + } + 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['tagFilters'])) { + $this->container['tagFilters'] = $data['tagFilters']; + } + if (isset($data['sumOrFiltersScores'])) { + $this->container['sumOrFiltersScores'] = $data['sumOrFiltersScores']; + } + if (isset($data['facets'])) { + $this->container['facets'] = $data['facets']; + } + if (isset($data['maxValuesPerFacet'])) { + $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; + } + if (isset($data['facetingAfterDistinct'])) { + $this->container['facetingAfterDistinct'] = $data['facetingAfterDistinct']; + } + if (isset($data['sortFacetValuesBy'])) { + $this->container['sortFacetValuesBy'] = $data['sortFacetValuesBy']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['offset'])) { + $this->container['offset'] = $data['offset']; + } + if (isset($data['length'])) { + $this->container['length'] = $data['length']; + } + 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['naturalLanguages'])) { + $this->container['naturalLanguages'] = $data['naturalLanguages']; + } + if (isset($data['ruleContexts'])) { + $this->container['ruleContexts'] = $data['ruleContexts']; + } + if (isset($data['personalizationImpact'])) { + $this->container['personalizationImpact'] = $data['personalizationImpact']; + } + if (isset($data['userToken'])) { + $this->container['userToken'] = $data['userToken']; + } + if (isset($data['getRankingInfo'])) { + $this->container['getRankingInfo'] = $data['getRankingInfo']; + } + 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['percentileComputation'])) { + $this->container['percentileComputation'] = $data['percentileComputation']; + } + if (isset($data['enableABTest'])) { + $this->container['enableABTest'] = $data['enableABTest']; + } + if (isset($data['enableReRanking'])) { + $this->container['enableReRanking'] = $data['enableReRanking']; + } + if (isset($data['searchableAttributes'])) { + $this->container['searchableAttributes'] = $data['searchableAttributes']; + } + if (isset($data['attributesForFaceting'])) { + $this->container['attributesForFaceting'] = $data['attributesForFaceting']; + } + if (isset($data['unretrievableAttributes'])) { + $this->container['unretrievableAttributes'] = $data['unretrievableAttributes']; + } + if (isset($data['attributesToRetrieve'])) { + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; + } + if (isset($data['restrictSearchableAttributes'])) { + $this->container['restrictSearchableAttributes'] = $data['restrictSearchableAttributes']; + } + if (isset($data['ranking'])) { + $this->container['ranking'] = $data['ranking']; + } + if (isset($data['customRanking'])) { + $this->container['customRanking'] = $data['customRanking']; + } + if (isset($data['relevancyStrictness'])) { + $this->container['relevancyStrictness'] = $data['relevancyStrictness']; + } + if (isset($data['attributesToHighlight'])) { + $this->container['attributesToHighlight'] = $data['attributesToHighlight']; + } + if (isset($data['attributesToSnippet'])) { + $this->container['attributesToSnippet'] = $data['attributesToSnippet']; + } + if (isset($data['highlightPreTag'])) { + $this->container['highlightPreTag'] = $data['highlightPreTag']; + } + if (isset($data['highlightPostTag'])) { + $this->container['highlightPostTag'] = $data['highlightPostTag']; + } + if (isset($data['snippetEllipsisText'])) { + $this->container['snippetEllipsisText'] = $data['snippetEllipsisText']; + } + if (isset($data['restrictHighlightAndSnippetArrays'])) { + $this->container['restrictHighlightAndSnippetArrays'] = $data['restrictHighlightAndSnippetArrays']; + } + if (isset($data['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + if (isset($data['minWordSizefor1Typo'])) { + $this->container['minWordSizefor1Typo'] = $data['minWordSizefor1Typo']; + } + if (isset($data['minWordSizefor2Typos'])) { + $this->container['minWordSizefor2Typos'] = $data['minWordSizefor2Typos']; + } + if (isset($data['typoTolerance'])) { + $this->container['typoTolerance'] = $data['typoTolerance']; + } + if (isset($data['allowTyposOnNumericTokens'])) { + $this->container['allowTyposOnNumericTokens'] = $data['allowTyposOnNumericTokens']; + } + if (isset($data['disableTypoToleranceOnAttributes'])) { + $this->container['disableTypoToleranceOnAttributes'] = $data['disableTypoToleranceOnAttributes']; + } + if (isset($data['separatorsToIndex'])) { + $this->container['separatorsToIndex'] = $data['separatorsToIndex']; + } + if (isset($data['ignorePlurals'])) { + $this->container['ignorePlurals'] = $data['ignorePlurals']; + } + if (isset($data['removeStopWords'])) { + $this->container['removeStopWords'] = $data['removeStopWords']; + } + if (isset($data['keepDiacriticsOnCharacters'])) { + $this->container['keepDiacriticsOnCharacters'] = $data['keepDiacriticsOnCharacters']; + } + if (isset($data['queryLanguages'])) { + $this->container['queryLanguages'] = $data['queryLanguages']; + } + if (isset($data['decompoundQuery'])) { + $this->container['decompoundQuery'] = $data['decompoundQuery']; + } + if (isset($data['enableRules'])) { + $this->container['enableRules'] = $data['enableRules']; + } + if (isset($data['enablePersonalization'])) { + $this->container['enablePersonalization'] = $data['enablePersonalization']; + } + if (isset($data['queryType'])) { + $this->container['queryType'] = $data['queryType']; + } + if (isset($data['removeWordsIfNoResults'])) { + $this->container['removeWordsIfNoResults'] = $data['removeWordsIfNoResults']; + } + if (isset($data['advancedSyntax'])) { + $this->container['advancedSyntax'] = $data['advancedSyntax']; + } + if (isset($data['optionalWords'])) { + $this->container['optionalWords'] = $data['optionalWords']; + } + if (isset($data['disableExactOnAttributes'])) { + $this->container['disableExactOnAttributes'] = $data['disableExactOnAttributes']; + } + if (isset($data['exactOnSingleWordQuery'])) { + $this->container['exactOnSingleWordQuery'] = $data['exactOnSingleWordQuery']; + } + if (isset($data['alternativesAsExact'])) { + $this->container['alternativesAsExact'] = $data['alternativesAsExact']; + } + if (isset($data['advancedSyntaxFeatures'])) { + $this->container['advancedSyntaxFeatures'] = $data['advancedSyntaxFeatures']; + } + if (isset($data['distinct'])) { + $this->container['distinct'] = $data['distinct']; + } + if (isset($data['synonyms'])) { + $this->container['synonyms'] = $data['synonyms']; + } + if (isset($data['replaceSynonymsInHighlight'])) { + $this->container['replaceSynonymsInHighlight'] = $data['replaceSynonymsInHighlight']; + } + if (isset($data['minProximity'])) { + $this->container['minProximity'] = $data['minProximity']; + } + if (isset($data['responseFields'])) { + $this->container['responseFields'] = $data['responseFields']; + } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } + if (isset($data['attributeCriteriaComputedByMinProximity'])) { + $this->container['attributeCriteriaComputedByMinProximity'] = $data['attributeCriteriaComputedByMinProximity']; + } + if (isset($data['renderingContent'])) { + $this->container['renderingContent'] = $data['renderingContent']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (isset($this->container['length']) && ($this->container['length'] > 1000)) { + $invalidProperties[] = "invalid value for 'length', must be smaller than or equal to 1000."; + } + + if (isset($this->container['length']) && ($this->container['length'] < 1)) { + $invalidProperties[] = "invalid value for 'length', must be bigger than or equal to 1."; + } + + if (isset($this->container['minimumAroundRadius']) && ($this->container['minimumAroundRadius'] < 1)) { + $invalidProperties[] = "invalid value for 'minimumAroundRadius', must be bigger than or equal to 1."; + } + + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (isset($this->container['typoTolerance']) && !in_array($this->container['typoTolerance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'typoTolerance', must be one of '%s'", + $this->container['typoTolerance'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getQueryTypeAllowableValues(); + if (isset($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'queryType', must be one of '%s'", + $this->container['queryType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (isset($this->container['removeWordsIfNoResults']) && !in_array($this->container['removeWordsIfNoResults'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $this->container['removeWordsIfNoResults'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (isset($this->container['exactOnSingleWordQuery']) && !in_array($this->container['exactOnSingleWordQuery'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $this->container['exactOnSingleWordQuery'], + implode("', '", $allowedValues) + ); + } + + if (isset($this->container['distinct']) && ($this->container['distinct'] > 4)) { + $invalidProperties[] = "invalid value for 'distinct', must be smaller than or equal to 4."; + } + + if (isset($this->container['distinct']) && ($this->container['distinct'] < 0)) { + $invalidProperties[] = "invalid value for 'distinct', must be bigger than or equal to 0."; + } + + if (isset($this->container['minProximity']) && ($this->container['minProximity'] > 7)) { + $invalidProperties[] = "invalid value for 'minProximity', must be smaller than or equal to 7."; + } + + if (isset($this->container['minProximity']) && ($this->container['minProximity'] < 1)) { + $invalidProperties[] = "invalid value for 'minProximity', must be bigger than or equal to 1."; + } + + if (isset($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets query + * + * @return string|null + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string|null $query query string + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets automaticFacetFilters + * + * @return \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null + */ + public function getAutomaticFacetFilters() + { + return $this->container['automaticFacetFilters'] ?? null; + } + + /** + * Sets automaticFacetFilters + * + * @param \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null $automaticFacetFilters names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern + * + * @return self + */ + public function setAutomaticFacetFilters($automaticFacetFilters) + { + $this->container['automaticFacetFilters'] = $automaticFacetFilters; + + return $this; + } + + /** + * Gets automaticOptionalFacetFilters + * + * @return \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null + */ + public function getAutomaticOptionalFacetFilters() + { + return $this->container['automaticOptionalFacetFilters'] ?? null; + } + + /** + * Sets automaticOptionalFacetFilters + * + * @param \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null $automaticOptionalFacetFilters same syntax as automaticFacetFilters, but the engine treats the filters as optional + * + * @return self + */ + public function setAutomaticOptionalFacetFilters($automaticOptionalFacetFilters) + { + $this->container['automaticOptionalFacetFilters'] = $automaticOptionalFacetFilters; + + return $this; + } + + /** + * Gets similarQuery + * + * @return string|null + */ + public function getSimilarQuery() + { + return $this->container['similarQuery'] ?? null; + } + + /** + * Sets similarQuery + * + * @param string|null $similarQuery overrides the query parameter and performs a more generic search that can be used to find \"similar\" results + * + * @return self + */ + public function setSimilarQuery($similarQuery) + { + $this->container['similarQuery'] = $similarQuery; + + return $this; + } + + /** + * Gets filters + * + * @return string|null + */ + public function getFilters() + { + return $this->container['filters'] ?? null; + } + + /** + * Sets filters + * + * @param string|null $filters filter the query with numeric, facet and/or tag filters + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets facetFilters + * + * @return string[]|null + */ + public function getFacetFilters() + { + return $this->container['facetFilters'] ?? null; + } + + /** + * Sets facetFilters + * + * @param string[]|null $facetFilters filter hits by facet value + * + * @return self + */ + public function setFacetFilters($facetFilters) + { + $this->container['facetFilters'] = $facetFilters; + + return $this; + } + + /** + * Gets optionalFilters + * + * @return string[]|null + */ + public function getOptionalFilters() + { + return $this->container['optionalFilters'] ?? null; + } + + /** + * Sets optionalFilters + * + * @param string[]|null $optionalFilters create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter + * + * @return self + */ + public function setOptionalFilters($optionalFilters) + { + $this->container['optionalFilters'] = $optionalFilters; + + return $this; + } + + /** + * Gets numericFilters + * + * @return string[]|null + */ + public function getNumericFilters() + { + return $this->container['numericFilters'] ?? null; + } + + /** + * Sets numericFilters + * + * @param string[]|null $numericFilters filter on numeric attributes + * + * @return self + */ + public function setNumericFilters($numericFilters) + { + $this->container['numericFilters'] = $numericFilters; + + return $this; + } + + /** + * Gets tagFilters + * + * @return string[]|null + */ + public function getTagFilters() + { + return $this->container['tagFilters'] ?? null; + } + + /** + * Sets tagFilters + * + * @param string[]|null $tagFilters filter hits by tags + * + * @return self + */ + public function setTagFilters($tagFilters) + { + $this->container['tagFilters'] = $tagFilters; + + return $this; + } + + /** + * Gets sumOrFiltersScores + * + * @return bool|null + */ + public function getSumOrFiltersScores() + { + return $this->container['sumOrFiltersScores'] ?? null; + } + + /** + * Sets sumOrFiltersScores + * + * @param bool|null $sumOrFiltersScores determines how to calculate the total score for filtering + * + * @return self + */ + public function setSumOrFiltersScores($sumOrFiltersScores) + { + $this->container['sumOrFiltersScores'] = $sumOrFiltersScores; + + return $this; + } + + /** + * Gets facets + * + * @return string[]|null + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets + * + * @param string[]|null $facets retrieve facets and their facet values + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets maxValuesPerFacet + * + * @return int|null + */ + public function getMaxValuesPerFacet() + { + return $this->container['maxValuesPerFacet'] ?? null; + } + + /** + * Sets maxValuesPerFacet + * + * @param int|null $maxValuesPerFacet maximum number of facet values to return for each facet during a regular search + * + * @return self + */ + public function setMaxValuesPerFacet($maxValuesPerFacet) + { + $this->container['maxValuesPerFacet'] = $maxValuesPerFacet; + + return $this; + } + + /** + * Gets facetingAfterDistinct + * + * @return bool|null + */ + public function getFacetingAfterDistinct() + { + return $this->container['facetingAfterDistinct'] ?? null; + } + + /** + * Sets facetingAfterDistinct + * + * @param bool|null $facetingAfterDistinct force faceting to be applied after de-duplication (via the Distinct setting) + * + * @return self + */ + public function setFacetingAfterDistinct($facetingAfterDistinct) + { + $this->container['facetingAfterDistinct'] = $facetingAfterDistinct; + + return $this; + } + + /** + * Gets sortFacetValuesBy + * + * @return string|null + */ + public function getSortFacetValuesBy() + { + return $this->container['sortFacetValuesBy'] ?? null; + } + + /** + * Sets sortFacetValuesBy + * + * @param string|null $sortFacetValuesBy controls how facet values are fetched + * + * @return self + */ + public function setSortFacetValuesBy($sortFacetValuesBy) + { + $this->container['sortFacetValuesBy'] = $sortFacetValuesBy; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int|null $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets offset + * + * @return int|null + */ + public function getOffset() + { + return $this->container['offset'] ?? null; + } + + /** + * Sets offset + * + * @param int|null $offset specify the offset of the first hit to return + * + * @return self + */ + public function setOffset($offset) + { + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets length + * + * @return int|null + */ + public function getLength() + { + return $this->container['length'] ?? null; + } + + /** + * Sets length + * + * @param int|null $length set the number of hits to retrieve (used only with offset) + * + * @return self + */ + public function setLength($length) + { + if (!is_null($length) && ($length > 1000)) { + throw new \InvalidArgumentException('invalid value for $length when calling ConsequenceParams., must be smaller than or equal to 1000.'); + } + if (!is_null($length) && ($length < 1)) { + throw new \InvalidArgumentException('invalid value for $length when calling ConsequenceParams., must be bigger than or equal to 1.'); + } + + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng'] ?? null; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng search for entries around a central geolocation, enabling a geo search within a circular area + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets aroundLatLngViaIP + * + * @return bool|null + */ + public function getAroundLatLngViaIP() + { + return $this->container['aroundLatLngViaIP'] ?? null; + } + + /** + * Sets aroundLatLngViaIP + * + * @param bool|null $aroundLatLngViaIP search for entries around a given location automatically computed from the requester's IP address + * + * @return self + */ + public function setAroundLatLngViaIP($aroundLatLngViaIP) + { + $this->container['aroundLatLngViaIP'] = $aroundLatLngViaIP; + + return $this; + } + + /** + * Gets aroundRadius + * + * @return \Algolia\AlgoliaSearch\Model\Search\AroundRadius|null + */ + public function getAroundRadius() + { + return $this->container['aroundRadius'] ?? null; + } + + /** + * Sets aroundRadius + * + * @param \Algolia\AlgoliaSearch\Model\Search\AroundRadius|null $aroundRadius aroundRadius + * + * @return self + */ + public function setAroundRadius($aroundRadius) + { + $this->container['aroundRadius'] = $aroundRadius; + + return $this; + } + + /** + * Gets aroundPrecision + * + * @return int|null + */ + public function getAroundPrecision() + { + return $this->container['aroundPrecision'] ?? null; + } + + /** + * Sets aroundPrecision + * + * @param int|null $aroundPrecision precision of geo search (in meters), to add grouping by geo location to the ranking formula + * + * @return self + */ + public function setAroundPrecision($aroundPrecision) + { + $this->container['aroundPrecision'] = $aroundPrecision; + + return $this; + } + + /** + * Gets minimumAroundRadius + * + * @return int|null + */ + public function getMinimumAroundRadius() + { + return $this->container['minimumAroundRadius'] ?? null; + } + + /** + * Sets minimumAroundRadius + * + * @param int|null $minimumAroundRadius minimum radius (in meters) used for a geo search when aroundRadius is not set + * + * @return self + */ + public function setMinimumAroundRadius($minimumAroundRadius) + { + if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { + throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling ConsequenceParams., must be bigger than or equal to 1.'); + } + + $this->container['minimumAroundRadius'] = $minimumAroundRadius; + + return $this; + } + + /** + * Gets insideBoundingBox + * + * @return float[]|null + */ + public function getInsideBoundingBox() + { + return $this->container['insideBoundingBox'] ?? null; + } + + /** + * Sets insideBoundingBox + * + * @param float[]|null $insideBoundingBox search inside a rectangular area (in geo coordinates) + * + * @return self + */ + public function setInsideBoundingBox($insideBoundingBox) + { + $this->container['insideBoundingBox'] = $insideBoundingBox; + + return $this; + } + + /** + * Gets insidePolygon + * + * @return float[]|null + */ + public function getInsidePolygon() + { + return $this->container['insidePolygon'] ?? null; + } + + /** + * Sets insidePolygon + * + * @param float[]|null $insidePolygon search inside a polygon (in geo coordinates) + * + * @return self + */ + public function setInsidePolygon($insidePolygon) + { + $this->container['insidePolygon'] = $insidePolygon; + + return $this; + } + + /** + * Gets naturalLanguages + * + * @return string[]|null + */ + public function getNaturalLanguages() + { + return $this->container['naturalLanguages'] ?? null; + } + + /** + * Sets naturalLanguages + * + * @param string[]|null $naturalLanguages This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. + * + * @return self + */ + public function setNaturalLanguages($naturalLanguages) + { + $this->container['naturalLanguages'] = $naturalLanguages; + + return $this; + } + + /** + * Gets ruleContexts + * + * @return string[]|null + */ + public function getRuleContexts() + { + return $this->container['ruleContexts'] ?? null; + } + + /** + * Sets ruleContexts + * + * @param string[]|null $ruleContexts enables contextual rules + * + * @return self + */ + public function setRuleContexts($ruleContexts) + { + $this->container['ruleContexts'] = $ruleContexts; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int|null + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact'] ?? null; + } + + /** + * Sets personalizationImpact + * + * @param int|null $personalizationImpact define the impact of the Personalization feature + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + return $this; + } + + /** + * Gets userToken + * + * @return string|null + */ + public function getUserToken() + { + return $this->container['userToken'] ?? null; + } + + /** + * Sets userToken + * + * @param string|null $userToken associates a certain user token with the current search + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets getRankingInfo + * + * @return bool|null + */ + public function getGetRankingInfo() + { + return $this->container['getRankingInfo'] ?? null; + } + + /** + * Sets getRankingInfo + * + * @param bool|null $getRankingInfo retrieve detailed ranking information + * + * @return self + */ + public function setGetRankingInfo($getRankingInfo) + { + $this->container['getRankingInfo'] = $getRankingInfo; + + return $this; + } + + /** + * Gets clickAnalytics + * + * @return bool|null + */ + public function getClickAnalytics() + { + return $this->container['clickAnalytics'] ?? null; + } + + /** + * Sets clickAnalytics + * + * @param bool|null $clickAnalytics enable the Click Analytics feature + * + * @return self + */ + public function setClickAnalytics($clickAnalytics) + { + $this->container['clickAnalytics'] = $clickAnalytics; + + return $this; + } + + /** + * Gets analytics + * + * @return bool|null + */ + public function getAnalytics() + { + return $this->container['analytics'] ?? null; + } + + /** + * Sets analytics + * + * @param bool|null $analytics whether the current query will be taken into account in the Analytics + * + * @return self + */ + public function setAnalytics($analytics) + { + $this->container['analytics'] = $analytics; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[]|null + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags'] ?? null; + } + + /** + * Sets analyticsTags + * + * @param string[]|null $analyticsTags list of tags to apply to the query for analytics purposes + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets percentileComputation + * + * @return bool|null + */ + public function getPercentileComputation() + { + return $this->container['percentileComputation'] ?? null; + } + + /** + * Sets percentileComputation + * + * @param bool|null $percentileComputation whether to include or exclude a query from the processing-time percentile computation + * + * @return self + */ + public function setPercentileComputation($percentileComputation) + { + $this->container['percentileComputation'] = $percentileComputation; + + return $this; + } + + /** + * Gets enableABTest + * + * @return bool|null + */ + public function getEnableABTest() + { + return $this->container['enableABTest'] ?? null; + } + + /** + * Sets enableABTest + * + * @param bool|null $enableABTest whether this search should participate in running AB tests + * + * @return self + */ + public function setEnableABTest($enableABTest) + { + $this->container['enableABTest'] = $enableABTest; + + return $this; + } + + /** + * Gets enableReRanking + * + * @return bool|null + */ + public function getEnableReRanking() + { + return $this->container['enableReRanking'] ?? null; + } + + /** + * Sets enableReRanking + * + * @param bool|null $enableReRanking whether this search should use AI Re-Ranking + * + * @return self + */ + public function setEnableReRanking($enableReRanking) + { + $this->container['enableReRanking'] = $enableReRanking; + + return $this; + } + + /** + * Gets searchableAttributes + * + * @return string[]|null + */ + public function getSearchableAttributes() + { + return $this->container['searchableAttributes'] ?? null; + } + + /** + * Sets searchableAttributes + * + * @param string[]|null $searchableAttributes the complete list of attributes used for searching + * + * @return self + */ + public function setSearchableAttributes($searchableAttributes) + { + $this->container['searchableAttributes'] = $searchableAttributes; + + return $this; + } + + /** + * Gets attributesForFaceting + * + * @return string[]|null + */ + public function getAttributesForFaceting() + { + return $this->container['attributesForFaceting'] ?? null; + } + + /** + * Sets attributesForFaceting + * + * @param string[]|null $attributesForFaceting the complete list of attributes that will be used for faceting + * + * @return self + */ + public function setAttributesForFaceting($attributesForFaceting) + { + $this->container['attributesForFaceting'] = $attributesForFaceting; + + return $this; + } + + /** + * Gets unretrievableAttributes + * + * @return string[]|null + */ + public function getUnretrievableAttributes() + { + return $this->container['unretrievableAttributes'] ?? null; + } + + /** + * Sets unretrievableAttributes + * + * @param string[]|null $unretrievableAttributes list of attributes that can't be retrieved at query time + * + * @return self + */ + public function setUnretrievableAttributes($unretrievableAttributes) + { + $this->container['unretrievableAttributes'] = $unretrievableAttributes; + + return $this; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve'] ?? null; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve this parameter controls which attributes to retrieve and which not to retrieve + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets restrictSearchableAttributes + * + * @return string[]|null + */ + public function getRestrictSearchableAttributes() + { + return $this->container['restrictSearchableAttributes'] ?? null; + } + + /** + * Sets restrictSearchableAttributes + * + * @param string[]|null $restrictSearchableAttributes restricts a given query to look in only a subset of your searchable attributes + * + * @return self + */ + public function setRestrictSearchableAttributes($restrictSearchableAttributes) + { + $this->container['restrictSearchableAttributes'] = $restrictSearchableAttributes; + + return $this; + } + + /** + * Gets ranking + * + * @return string[]|null + */ + public function getRanking() + { + return $this->container['ranking'] ?? null; + } + + /** + * Sets ranking + * + * @param string[]|null $ranking controls how Algolia should sort your results + * + * @return self + */ + public function setRanking($ranking) + { + $this->container['ranking'] = $ranking; + + return $this; + } + + /** + * Gets customRanking + * + * @return string[]|null + */ + public function getCustomRanking() + { + return $this->container['customRanking'] ?? null; + } + + /** + * Sets customRanking + * + * @param string[]|null $customRanking specifies the custom ranking criterion + * + * @return self + */ + public function setCustomRanking($customRanking) + { + $this->container['customRanking'] = $customRanking; + + return $this; + } + + /** + * Gets relevancyStrictness + * + * @return int|null + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness'] ?? null; + } + + /** + * Sets relevancyStrictness + * + * @param int|null $relevancyStrictness controls the relevancy threshold below which less relevant results aren't included in the results + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets attributesToHighlight + * + * @return string[]|null + */ + public function getAttributesToHighlight() + { + return $this->container['attributesToHighlight'] ?? null; + } + + /** + * Sets attributesToHighlight + * + * @param string[]|null $attributesToHighlight list of attributes to highlight + * + * @return self + */ + public function setAttributesToHighlight($attributesToHighlight) + { + $this->container['attributesToHighlight'] = $attributesToHighlight; + + return $this; + } + + /** + * Gets attributesToSnippet + * + * @return string[]|null + */ + public function getAttributesToSnippet() + { + return $this->container['attributesToSnippet'] ?? null; + } + + /** + * Sets attributesToSnippet + * + * @param string[]|null $attributesToSnippet list of attributes to snippet, with an optional maximum number of words to snippet + * + * @return self + */ + public function setAttributesToSnippet($attributesToSnippet) + { + $this->container['attributesToSnippet'] = $attributesToSnippet; + + return $this; + } + + /** + * Gets highlightPreTag + * + * @return string|null + */ + public function getHighlightPreTag() + { + return $this->container['highlightPreTag'] ?? null; + } + + /** + * Sets highlightPreTag + * + * @param string|null $highlightPreTag the HTML string to insert before the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPreTag($highlightPreTag) + { + $this->container['highlightPreTag'] = $highlightPreTag; + + return $this; + } + + /** + * Gets highlightPostTag + * + * @return string|null + */ + public function getHighlightPostTag() + { + return $this->container['highlightPostTag'] ?? null; + } + + /** + * Sets highlightPostTag + * + * @param string|null $highlightPostTag the HTML string to insert after the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPostTag($highlightPostTag) + { + $this->container['highlightPostTag'] = $highlightPostTag; + + return $this; + } + + /** + * Gets snippetEllipsisText + * + * @return string|null + */ + public function getSnippetEllipsisText() + { + return $this->container['snippetEllipsisText'] ?? null; + } + + /** + * Sets snippetEllipsisText + * + * @param string|null $snippetEllipsisText string used as an ellipsis indicator when a snippet is truncated + * + * @return self + */ + public function setSnippetEllipsisText($snippetEllipsisText) + { + $this->container['snippetEllipsisText'] = $snippetEllipsisText; + + return $this; + } + + /** + * Gets restrictHighlightAndSnippetArrays + * + * @return bool|null + */ + public function getRestrictHighlightAndSnippetArrays() + { + return $this->container['restrictHighlightAndSnippetArrays'] ?? null; + } + + /** + * Sets restrictHighlightAndSnippetArrays + * + * @param bool|null $restrictHighlightAndSnippetArrays restrict highlighting and snippeting to items that matched the query + * + * @return self + */ + public function setRestrictHighlightAndSnippetArrays($restrictHighlightAndSnippetArrays) + { + $this->container['restrictHighlightAndSnippetArrays'] = $restrictHighlightAndSnippetArrays; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets minWordSizefor1Typo + * + * @return int|null + */ + public function getMinWordSizefor1Typo() + { + return $this->container['minWordSizefor1Typo'] ?? null; + } + + /** + * Sets minWordSizefor1Typo + * + * @param int|null $minWordSizefor1Typo minimum number of characters a word in the query string must contain to accept matches with 1 typo + * + * @return self + */ + public function setMinWordSizefor1Typo($minWordSizefor1Typo) + { + $this->container['minWordSizefor1Typo'] = $minWordSizefor1Typo; + + return $this; + } + + /** + * Gets minWordSizefor2Typos + * + * @return int|null + */ + public function getMinWordSizefor2Typos() + { + return $this->container['minWordSizefor2Typos'] ?? null; + } + + /** + * Sets minWordSizefor2Typos + * + * @param int|null $minWordSizefor2Typos minimum number of characters a word in the query string must contain to accept matches with 2 typos + * + * @return self + */ + public function setMinWordSizefor2Typos($minWordSizefor2Typos) + { + $this->container['minWordSizefor2Typos'] = $minWordSizefor2Typos; + + return $this; + } + + /** + * Gets typoTolerance + * + * @return string|null + */ + public function getTypoTolerance() + { + return $this->container['typoTolerance'] ?? null; + } + + /** + * Sets typoTolerance + * + * @param string|null $typoTolerance controls whether typo tolerance is enabled and how it is applied + * + * @return self + */ + public function setTypoTolerance($typoTolerance) + { + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($typoTolerance) && !in_array($typoTolerance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'typoTolerance', must be one of '%s'", + $typoTolerance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['typoTolerance'] = $typoTolerance; + + return $this; + } + + /** + * Gets allowTyposOnNumericTokens + * + * @return bool|null + */ + public function getAllowTyposOnNumericTokens() + { + return $this->container['allowTyposOnNumericTokens'] ?? null; + } + + /** + * Sets allowTyposOnNumericTokens + * + * @param bool|null $allowTyposOnNumericTokens whether to allow typos on numbers (\"numeric tokens\") in the query string + * + * @return self + */ + public function setAllowTyposOnNumericTokens($allowTyposOnNumericTokens) + { + $this->container['allowTyposOnNumericTokens'] = $allowTyposOnNumericTokens; + + return $this; + } + + /** + * Gets disableTypoToleranceOnAttributes + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnAttributes() + { + return $this->container['disableTypoToleranceOnAttributes'] ?? null; + } + + /** + * Sets disableTypoToleranceOnAttributes + * + * @param string[]|null $disableTypoToleranceOnAttributes list of attributes on which you want to disable typo tolerance + * + * @return self + */ + public function setDisableTypoToleranceOnAttributes($disableTypoToleranceOnAttributes) + { + $this->container['disableTypoToleranceOnAttributes'] = $disableTypoToleranceOnAttributes; + + return $this; + } + + /** + * Gets separatorsToIndex + * + * @return string|null + */ + public function getSeparatorsToIndex() + { + return $this->container['separatorsToIndex'] ?? null; + } + + /** + * Sets separatorsToIndex + * + * @param string|null $separatorsToIndex control which separators are indexed + * + * @return self + */ + public function setSeparatorsToIndex($separatorsToIndex) + { + $this->container['separatorsToIndex'] = $separatorsToIndex; + + return $this; + } + + /** + * Gets ignorePlurals + * + * @return string|null + */ + public function getIgnorePlurals() + { + return $this->container['ignorePlurals'] ?? null; + } + + /** + * Sets ignorePlurals + * + * @param string|null $ignorePlurals treats singular, plurals, and other forms of declensions as matching terms + * + * @return self + */ + public function setIgnorePlurals($ignorePlurals) + { + $this->container['ignorePlurals'] = $ignorePlurals; + + return $this; + } + + /** + * Gets removeStopWords + * + * @return string|null + */ + public function getRemoveStopWords() + { + return $this->container['removeStopWords'] ?? null; + } + + /** + * Sets removeStopWords + * + * @param string|null $removeStopWords removes stop (common) words from the query before executing it + * + * @return self + */ + public function setRemoveStopWords($removeStopWords) + { + $this->container['removeStopWords'] = $removeStopWords; + + return $this; + } + + /** + * Gets keepDiacriticsOnCharacters + * + * @return string|null + */ + public function getKeepDiacriticsOnCharacters() + { + return $this->container['keepDiacriticsOnCharacters'] ?? null; + } + + /** + * Sets keepDiacriticsOnCharacters + * + * @param string|null $keepDiacriticsOnCharacters list of characters that the engine shouldn't automatically normalize + * + * @return self + */ + public function setKeepDiacriticsOnCharacters($keepDiacriticsOnCharacters) + { + $this->container['keepDiacriticsOnCharacters'] = $keepDiacriticsOnCharacters; + + return $this; + } + + /** + * Gets queryLanguages + * + * @return string[]|null + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages'] ?? null; + } + + /** + * Sets queryLanguages + * + * @param string[]|null $queryLanguages sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets decompoundQuery + * + * @return bool|null + */ + public function getDecompoundQuery() + { + return $this->container['decompoundQuery'] ?? null; + } + + /** + * Sets decompoundQuery + * + * @param bool|null $decompoundQuery splits compound words into their composing atoms in the query + * + * @return self + */ + public function setDecompoundQuery($decompoundQuery) + { + $this->container['decompoundQuery'] = $decompoundQuery; + + return $this; + } + + /** + * Gets enableRules + * + * @return bool|null + */ + public function getEnableRules() + { + return $this->container['enableRules'] ?? null; + } + + /** + * Sets enableRules + * + * @param bool|null $enableRules whether Rules should be globally enabled + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets enablePersonalization + * + * @return bool|null + */ + public function getEnablePersonalization() + { + return $this->container['enablePersonalization'] ?? null; + } + + /** + * Sets enablePersonalization + * + * @param bool|null $enablePersonalization enable the Personalization feature + * + * @return self + */ + public function setEnablePersonalization($enablePersonalization) + { + $this->container['enablePersonalization'] = $enablePersonalization; + + return $this; + } + + /** + * Gets queryType + * + * @return string|null + */ + public function getQueryType() + { + return $this->container['queryType'] ?? null; + } + + /** + * Sets queryType + * + * @param string|null $queryType controls if and how query words are interpreted as prefixes + * + * @return self + */ + public function setQueryType($queryType) + { + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($queryType) && !in_array($queryType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'queryType', must be one of '%s'", + $queryType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['queryType'] = $queryType; + + return $this; + } + + /** + * Gets removeWordsIfNoResults + * + * @return string|null + */ + public function getRemoveWordsIfNoResults() + { + return $this->container['removeWordsIfNoResults'] ?? null; + } + + /** + * Sets removeWordsIfNoResults + * + * @param string|null $removeWordsIfNoResults selects a strategy to remove words from the query when it doesn't match any hits + * + * @return self + */ + public function setRemoveWordsIfNoResults($removeWordsIfNoResults) + { + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($removeWordsIfNoResults) && !in_array($removeWordsIfNoResults, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $removeWordsIfNoResults, + implode("', '", $allowedValues) + ) + ); + } + $this->container['removeWordsIfNoResults'] = $removeWordsIfNoResults; + + return $this; + } + + /** + * Gets advancedSyntax + * + * @return bool|null + */ + public function getAdvancedSyntax() + { + return $this->container['advancedSyntax'] ?? null; + } + + /** + * Sets advancedSyntax + * + * @param bool|null $advancedSyntax enables the advanced query syntax + * + * @return self + */ + public function setAdvancedSyntax($advancedSyntax) + { + $this->container['advancedSyntax'] = $advancedSyntax; + + return $this; + } + + /** + * Gets optionalWords + * + * @return string[]|null + */ + public function getOptionalWords() + { + return $this->container['optionalWords'] ?? null; + } + + /** + * Sets optionalWords + * + * @param string[]|null $optionalWords a list of words that should be considered as optional when found in the query + * + * @return self + */ + public function setOptionalWords($optionalWords) + { + $this->container['optionalWords'] = $optionalWords; + + return $this; + } + + /** + * Gets disableExactOnAttributes + * + * @return string[]|null + */ + public function getDisableExactOnAttributes() + { + return $this->container['disableExactOnAttributes'] ?? null; + } + + /** + * Sets disableExactOnAttributes + * + * @param string[]|null $disableExactOnAttributes list of attributes on which you want to disable the exact ranking criterion + * + * @return self + */ + public function setDisableExactOnAttributes($disableExactOnAttributes) + { + $this->container['disableExactOnAttributes'] = $disableExactOnAttributes; + + return $this; + } + + /** + * Gets exactOnSingleWordQuery + * + * @return string|null + */ + public function getExactOnSingleWordQuery() + { + return $this->container['exactOnSingleWordQuery'] ?? null; + } + + /** + * Sets exactOnSingleWordQuery + * + * @param string|null $exactOnSingleWordQuery controls how the exact ranking criterion is computed when the query contains only one word + * + * @return self + */ + public function setExactOnSingleWordQuery($exactOnSingleWordQuery) + { + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($exactOnSingleWordQuery) && !in_array($exactOnSingleWordQuery, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $exactOnSingleWordQuery, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exactOnSingleWordQuery'] = $exactOnSingleWordQuery; + + return $this; + } + + /** + * Gets alternativesAsExact + * + * @return string[]|null + */ + public function getAlternativesAsExact() + { + return $this->container['alternativesAsExact'] ?? null; + } + + /** + * Sets alternativesAsExact + * + * @param string[]|null $alternativesAsExact list of alternatives that should be considered an exact match by the exact ranking criterion + * + * @return self + */ + public function setAlternativesAsExact($alternativesAsExact) + { + $allowedValues = $this->getAlternativesAsExactAllowableValues(); + if (!is_null($alternativesAsExact) && array_diff($alternativesAsExact, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'alternativesAsExact', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['alternativesAsExact'] = $alternativesAsExact; + + return $this; + } + + /** + * Gets advancedSyntaxFeatures + * + * @return string[]|null + */ + public function getAdvancedSyntaxFeatures() + { + return $this->container['advancedSyntaxFeatures'] ?? null; + } + + /** + * Sets advancedSyntaxFeatures + * + * @param string[]|null $advancedSyntaxFeatures allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled + * + * @return self + */ + public function setAdvancedSyntaxFeatures($advancedSyntaxFeatures) + { + $allowedValues = $this->getAdvancedSyntaxFeaturesAllowableValues(); + if (!is_null($advancedSyntaxFeatures) && array_diff($advancedSyntaxFeatures, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'advancedSyntaxFeatures', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['advancedSyntaxFeatures'] = $advancedSyntaxFeatures; + + return $this; + } + + /** + * Gets distinct + * + * @return int|null + */ + public function getDistinct() + { + return $this->container['distinct'] ?? null; + } + + /** + * Sets distinct + * + * @param int|null $distinct enables de-duplication or grouping of results + * + * @return self + */ + public function setDistinct($distinct) + { + if (!is_null($distinct) && ($distinct > 4)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling ConsequenceParams., must be smaller than or equal to 4.'); + } + if (!is_null($distinct) && ($distinct < 0)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling ConsequenceParams., must be bigger than or equal to 0.'); + } + + $this->container['distinct'] = $distinct; + + return $this; + } + + /** + * Gets synonyms + * + * @return bool|null + */ + public function getSynonyms() + { + return $this->container['synonyms'] ?? null; + } + + /** + * Sets synonyms + * + * @param bool|null $synonyms whether to take into account an index's synonyms for a particular search + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets replaceSynonymsInHighlight + * + * @return bool|null + */ + public function getReplaceSynonymsInHighlight() + { + return $this->container['replaceSynonymsInHighlight'] ?? null; + } + + /** + * Sets replaceSynonymsInHighlight + * + * @param bool|null $replaceSynonymsInHighlight whether to highlight and snippet the original word that matches the synonym or the synonym itself + * + * @return self + */ + public function setReplaceSynonymsInHighlight($replaceSynonymsInHighlight) + { + $this->container['replaceSynonymsInHighlight'] = $replaceSynonymsInHighlight; + + return $this; + } + + /** + * Gets minProximity + * + * @return int|null + */ + public function getMinProximity() + { + return $this->container['minProximity'] ?? null; + } + + /** + * Sets minProximity + * + * @param int|null $minProximity precision of the proximity ranking criterion + * + * @return self + */ + public function setMinProximity($minProximity) + { + if (!is_null($minProximity) && ($minProximity > 7)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling ConsequenceParams., must be smaller than or equal to 7.'); + } + if (!is_null($minProximity) && ($minProximity < 1)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling ConsequenceParams., must be bigger than or equal to 1.'); + } + + $this->container['minProximity'] = $minProximity; + + return $this; + } + + /** + * Gets responseFields + * + * @return string[]|null + */ + public function getResponseFields() + { + return $this->container['responseFields'] ?? null; + } + + /** + * Sets responseFields + * + * @param string[]|null $responseFields Choose which fields to return in the API response. This parameters applies to search and browse queries. + * + * @return self + */ + public function setResponseFields($responseFields) + { + $this->container['responseFields'] = $responseFields; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling ConsequenceParams., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets attributeCriteriaComputedByMinProximity + * + * @return bool|null + */ + public function getAttributeCriteriaComputedByMinProximity() + { + return $this->container['attributeCriteriaComputedByMinProximity'] ?? null; + } + + /** + * Sets attributeCriteriaComputedByMinProximity + * + * @param bool|null $attributeCriteriaComputedByMinProximity when attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage + * + * @return self + */ + public function setAttributeCriteriaComputedByMinProximity($attributeCriteriaComputedByMinProximity) + { + $this->container['attributeCriteriaComputedByMinProximity'] = $attributeCriteriaComputedByMinProximity; + + return $this; + } + + /** + * Gets renderingContent + * + * @return object|null + */ + public function getRenderingContent() + { + return $this->container['renderingContent'] ?? null; + } + + /** + * Sets renderingContent + * + * @param object|null $renderingContent Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/CreatedAtObject.php b/clients/algoliasearch-client-php/lib/Model/Search/CreatedAtObject.php new file mode 100644 index 0000000000..e5482de9d3 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/CreatedAtObject.php @@ -0,0 +1,211 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'createdAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['createdAt'])) { + $this->container['createdAt'] = $data['createdAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['createdAt']) || $this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets createdAt + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['createdAt'] ?? null; + } + + /** + * Sets createdAt + * + * @param string $createdAt date of creation (ISO-8601 format) + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/CreatedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/CreatedAtResponse.php new file mode 100644 index 0000000000..4268c0f7b0 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/CreatedAtResponse.php @@ -0,0 +1,213 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'createdAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['createdAt'])) { + $this->container['createdAt'] = $data['createdAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['createdAt']) || $this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets createdAt + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['createdAt'] ?? null; + } + + /** + * Sets createdAt + * + * @param string $createdAt date of creation (ISO-8601 format) + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/DeleteApiKeyResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/DeleteApiKeyResponse.php new file mode 100644 index 0000000000..15439bd449 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/DeleteApiKeyResponse.php @@ -0,0 +1,211 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'deletedAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deletedAt' => 'setDeletedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deletedAt' => 'getDeletedAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['deletedAt'])) { + $this->container['deletedAt'] = $data['deletedAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['deletedAt']) || $this->container['deletedAt'] === null) { + $invalidProperties[] = "'deletedAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets deletedAt + * + * @return string + */ + public function getDeletedAt() + { + return $this->container['deletedAt'] ?? null; + } + + /** + * Sets deletedAt + * + * @param string $deletedAt date of deletion (ISO-8601 format) + * + * @return self + */ + public function setDeletedAt($deletedAt) + { + $this->container['deletedAt'] = $deletedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/DeleteSourceResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/DeleteSourceResponse.php new file mode 100644 index 0000000000..fd7077dd41 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/DeleteSourceResponse.php @@ -0,0 +1,211 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'deletedAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deletedAt' => 'setDeletedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deletedAt' => 'getDeletedAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['deletedAt'])) { + $this->container['deletedAt'] = $data['deletedAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['deletedAt']) || $this->container['deletedAt'] === null) { + $invalidProperties[] = "'deletedAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets deletedAt + * + * @return string + */ + public function getDeletedAt() + { + return $this->container['deletedAt'] ?? null; + } + + /** + * Sets deletedAt + * + * @param string $deletedAt date of deletion (ISO-8601 format) + * + * @return self + */ + public function setDeletedAt($deletedAt) + { + $this->container['deletedAt'] = $deletedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/DeletedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/DeletedAtResponse.php new file mode 100644 index 0000000000..ae894c6f58 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/DeletedAtResponse.php @@ -0,0 +1,247 @@ + 'int', + 'deletedAt' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'taskID' => null, + 'deletedAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'taskID' => 'setTaskID', + 'deletedAt' => 'setDeletedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'taskID' => 'getTaskID', + 'deletedAt' => 'getDeletedAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['taskID'])) { + $this->container['taskID'] = $data['taskID']; + } + if (isset($data['deletedAt'])) { + $this->container['deletedAt'] = $data['deletedAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['taskID']) || $this->container['taskID'] === null) { + $invalidProperties[] = "'taskID' can't be null"; + } + if (!isset($this->container['deletedAt']) || $this->container['deletedAt'] === null) { + $invalidProperties[] = "'deletedAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets taskID + * + * @return int + */ + public function getTaskID() + { + return $this->container['taskID'] ?? null; + } + + /** + * Sets taskID + * + * @param int $taskID taskID of the task to wait for + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + + /** + * Gets deletedAt + * + * @return string + */ + public function getDeletedAt() + { + return $this->container['deletedAt'] ?? null; + } + + /** + * Sets deletedAt + * + * @param string $deletedAt date of deletion (ISO-8601 format) + * + * @return self + */ + public function setDeletedAt($deletedAt) + { + $this->container['deletedAt'] = $deletedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/DictionaryAction.php b/clients/algoliasearch-client-php/lib/Model/Search/DictionaryAction.php new file mode 100644 index 0000000000..2b37a031e7 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/DictionaryAction.php @@ -0,0 +1,35 @@ + 'string', + 'language' => 'string', + 'word' => 'string', + 'words' => 'string[]', + 'decomposition' => 'string[]', + 'state' => '\Algolia\AlgoliaSearch\Model\Search\DictionaryEntryState', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'objectID' => null, + 'language' => null, + 'word' => null, + 'words' => null, + 'decomposition' => null, + 'state' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'language' => 'setLanguage', + 'word' => 'setWord', + 'words' => 'setWords', + 'decomposition' => 'setDecomposition', + 'state' => 'setState', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'language' => 'getLanguage', + 'word' => 'getWord', + 'words' => 'getWords', + 'decomposition' => 'getDecomposition', + 'state' => 'getState', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + if (isset($data['language'])) { + $this->container['language'] = $data['language']; + } + if (isset($data['word'])) { + $this->container['word'] = $data['word']; + } + if (isset($data['words'])) { + $this->container['words'] = $data['words']; + } + if (isset($data['decomposition'])) { + $this->container['decomposition'] = $data['decomposition']; + } + if (isset($data['state'])) { + $this->container['state'] = $data['state']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['objectID']) || $this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if (!isset($this->container['language']) || $this->container['language'] === null) { + $invalidProperties[] = "'language' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language'] ?? null; + } + + /** + * Sets language + * + * @param string $language Language ISO code supported by the dictionary (e.g., \"en\" for English). + * + * @return self + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets word + * + * @return string|null + */ + public function getWord() + { + return $this->container['word'] ?? null; + } + + /** + * Sets word + * + * @param string|null $word the word of the dictionary entry + * + * @return self + */ + public function setWord($word) + { + $this->container['word'] = $word; + + return $this; + } + + /** + * Gets words + * + * @return string[]|null + */ + public function getWords() + { + return $this->container['words'] ?? null; + } + + /** + * Sets words + * + * @param string[]|null $words the words of the dictionary entry + * + * @return self + */ + public function setWords($words) + { + $this->container['words'] = $words; + + return $this; + } + + /** + * Gets decomposition + * + * @return string[]|null + */ + public function getDecomposition() + { + return $this->container['decomposition'] ?? null; + } + + /** + * Sets decomposition + * + * @param string[]|null $decomposition a decomposition of the word of the dictionary entry + * + * @return self + */ + public function setDecomposition($decomposition) + { + $this->container['decomposition'] = $decomposition; + + return $this; + } + + /** + * Gets state + * + * @return \Algolia\AlgoliaSearch\Model\Search\DictionaryEntryState|null + */ + public function getState() + { + return $this->container['state'] ?? null; + } + + /** + * Sets state + * + * @param \Algolia\AlgoliaSearch\Model\Search\DictionaryEntryState|null $state state + * + * @return self + */ + public function setState($state) + { + $this->container['state'] = $state; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/DictionaryEntryState.php b/clients/algoliasearch-client-php/lib/Model/Search/DictionaryEntryState.php new file mode 100644 index 0000000000..52b2bab072 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/DictionaryEntryState.php @@ -0,0 +1,35 @@ + 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'nbCustomEntires' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'nbCustomEntires' => 'setNbCustomEntires', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'nbCustomEntires' => 'getNbCustomEntires', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['nbCustomEntires'])) { + $this->container['nbCustomEntires'] = $data['nbCustomEntires']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets nbCustomEntires + * + * @return int|null + */ + public function getNbCustomEntires() + { + return $this->container['nbCustomEntires'] ?? null; + } + + /** + * Sets nbCustomEntires + * + * @param int|null $nbCustomEntires When nbCustomEntries is set to 0, the user didn't customize the dictionary. The dictionary is still supported with standard, Algolia-provided entries. + * + * @return self + */ + public function setNbCustomEntires($nbCustomEntires) + { + $this->container['nbCustomEntires'] = $nbCustomEntires; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/DictionarySettingsParams.php b/clients/algoliasearch-client-php/lib/Model/Search/DictionarySettingsParams.php new file mode 100644 index 0000000000..aa38f84e3b --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/DictionarySettingsParams.php @@ -0,0 +1,213 @@ + '\Algolia\AlgoliaSearch\Model\Search\StandardEntries', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'disableStandardEntries' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'disableStandardEntries' => 'setDisableStandardEntries', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'disableStandardEntries' => 'getDisableStandardEntries', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['disableStandardEntries'])) { + $this->container['disableStandardEntries'] = $data['disableStandardEntries']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['disableStandardEntries']) || $this->container['disableStandardEntries'] === null) { + $invalidProperties[] = "'disableStandardEntries' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets disableStandardEntries + * + * @return \Algolia\AlgoliaSearch\Model\Search\StandardEntries + */ + public function getDisableStandardEntries() + { + return $this->container['disableStandardEntries'] ?? null; + } + + /** + * Sets disableStandardEntries + * + * @param \Algolia\AlgoliaSearch\Model\Search\StandardEntries $disableStandardEntries disableStandardEntries + * + * @return self + */ + public function setDisableStandardEntries($disableStandardEntries) + { + $this->container['disableStandardEntries'] = $disableStandardEntries; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/DictionaryType.php b/clients/algoliasearch-client-php/lib/Model/Search/DictionaryType.php new file mode 100644 index 0000000000..107e420795 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/DictionaryType.php @@ -0,0 +1,36 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'message' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['message'])) { + $this->container['message'] = $data['message']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string|null $message message + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/GetDictionarySettingsResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/GetDictionarySettingsResponse.php new file mode 100644 index 0000000000..2d76fb0590 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/GetDictionarySettingsResponse.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Search\StandardEntries', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'disableStandardEntries' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'disableStandardEntries' => 'setDisableStandardEntries', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'disableStandardEntries' => 'getDisableStandardEntries', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['disableStandardEntries'])) { + $this->container['disableStandardEntries'] = $data['disableStandardEntries']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['disableStandardEntries']) || $this->container['disableStandardEntries'] === null) { + $invalidProperties[] = "'disableStandardEntries' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets disableStandardEntries + * + * @return \Algolia\AlgoliaSearch\Model\Search\StandardEntries + */ + public function getDisableStandardEntries() + { + return $this->container['disableStandardEntries'] ?? null; + } + + /** + * Sets disableStandardEntries + * + * @param \Algolia\AlgoliaSearch\Model\Search\StandardEntries $disableStandardEntries disableStandardEntries + * + * @return self + */ + public function setDisableStandardEntries($disableStandardEntries) + { + $this->container['disableStandardEntries'] = $disableStandardEntries; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponse.php new file mode 100644 index 0000000000..47edf35e3a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponse.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Search\GetLogsResponseLogs[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'logs' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'logs' => 'setLogs', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'logs' => 'getLogs', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['logs'])) { + $this->container['logs'] = $data['logs']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['logs']) || $this->container['logs'] === null) { + $invalidProperties[] = "'logs' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets logs + * + * @return \Algolia\AlgoliaSearch\Model\Search\GetLogsResponseLogs[] + */ + public function getLogs() + { + return $this->container['logs'] ?? null; + } + + /** + * Sets logs + * + * @param \Algolia\AlgoliaSearch\Model\Search\GetLogsResponseLogs[] $logs logs + * + * @return self + */ + public function setLogs($logs) + { + $this->container['logs'] = $logs; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponseInnerQueries.php b/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponseInnerQueries.php new file mode 100644 index 0000000000..ce3109bf2d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponseInnerQueries.php @@ -0,0 +1,269 @@ + 'string', + 'userToken' => 'string', + 'queryId' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'indexName' => null, + 'userToken' => null, + 'queryId' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + 'userToken' => 'setUserToken', + 'queryId' => 'setQueryId', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'indexName' => 'getIndexName', + 'userToken' => 'getUserToken', + 'queryId' => 'getQueryId', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + if (isset($data['userToken'])) { + $this->container['userToken'] = $data['userToken']; + } + if (isset($data['queryId'])) { + $this->container['queryId'] = $data['queryId']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets indexName + * + * @return string|null + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string|null $indexName index targeted by the query + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets userToken + * + * @return string|null + */ + public function getUserToken() + { + return $this->container['userToken'] ?? null; + } + + /** + * Sets userToken + * + * @param string|null $userToken user identifier + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets queryId + * + * @return string|null + */ + public function getQueryId() + { + return $this->container['queryId'] ?? null; + } + + /** + * Sets queryId + * + * @param string|null $queryId queryID for the given query + * + * @return self + */ + public function setQueryId($queryId) + { + $this->container['queryId'] = $queryId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponseLogs.php b/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponseLogs.php new file mode 100644 index 0000000000..166671a0bf --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/GetLogsResponseLogs.php @@ -0,0 +1,675 @@ + 'string', + 'method' => 'string', + 'answerCode' => 'string', + 'queryBody' => 'string', + 'answer' => 'string', + 'url' => 'string', + 'ip' => 'string', + 'queryHeaders' => 'string', + 'sha1' => 'string', + 'nbApiCalls' => 'string', + 'processingTimeMs' => 'string', + 'index' => 'string', + 'queryParams' => 'string', + 'queryNbHits' => 'string', + 'innerQueries' => '\Algolia\AlgoliaSearch\Model\Search\GetLogsResponseInnerQueries[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'timestamp' => null, + 'method' => null, + 'answerCode' => null, + 'queryBody' => null, + 'answer' => null, + 'url' => null, + 'ip' => null, + 'queryHeaders' => null, + 'sha1' => null, + 'nbApiCalls' => null, + 'processingTimeMs' => null, + 'index' => null, + 'queryParams' => null, + 'queryNbHits' => null, + 'innerQueries' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'timestamp' => 'setTimestamp', + 'method' => 'setMethod', + 'answerCode' => 'setAnswerCode', + 'queryBody' => 'setQueryBody', + 'answer' => 'setAnswer', + 'url' => 'setUrl', + 'ip' => 'setIp', + 'queryHeaders' => 'setQueryHeaders', + 'sha1' => 'setSha1', + 'nbApiCalls' => 'setNbApiCalls', + 'processingTimeMs' => 'setProcessingTimeMs', + 'index' => 'setIndex', + 'queryParams' => 'setQueryParams', + 'queryNbHits' => 'setQueryNbHits', + 'innerQueries' => 'setInnerQueries', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'timestamp' => 'getTimestamp', + 'method' => 'getMethod', + 'answerCode' => 'getAnswerCode', + 'queryBody' => 'getQueryBody', + 'answer' => 'getAnswer', + 'url' => 'getUrl', + 'ip' => 'getIp', + 'queryHeaders' => 'getQueryHeaders', + 'sha1' => 'getSha1', + 'nbApiCalls' => 'getNbApiCalls', + 'processingTimeMs' => 'getProcessingTimeMs', + 'index' => 'getIndex', + 'queryParams' => 'getQueryParams', + 'queryNbHits' => 'getQueryNbHits', + 'innerQueries' => 'getInnerQueries', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['timestamp'])) { + $this->container['timestamp'] = $data['timestamp']; + } + if (isset($data['method'])) { + $this->container['method'] = $data['method']; + } + if (isset($data['answerCode'])) { + $this->container['answerCode'] = $data['answerCode']; + } + if (isset($data['queryBody'])) { + $this->container['queryBody'] = $data['queryBody']; + } + if (isset($data['answer'])) { + $this->container['answer'] = $data['answer']; + } + if (isset($data['url'])) { + $this->container['url'] = $data['url']; + } + if (isset($data['ip'])) { + $this->container['ip'] = $data['ip']; + } + if (isset($data['queryHeaders'])) { + $this->container['queryHeaders'] = $data['queryHeaders']; + } + if (isset($data['sha1'])) { + $this->container['sha1'] = $data['sha1']; + } + if (isset($data['nbApiCalls'])) { + $this->container['nbApiCalls'] = $data['nbApiCalls']; + } + if (isset($data['processingTimeMs'])) { + $this->container['processingTimeMs'] = $data['processingTimeMs']; + } + if (isset($data['index'])) { + $this->container['index'] = $data['index']; + } + if (isset($data['queryParams'])) { + $this->container['queryParams'] = $data['queryParams']; + } + if (isset($data['queryNbHits'])) { + $this->container['queryNbHits'] = $data['queryNbHits']; + } + if (isset($data['innerQueries'])) { + $this->container['innerQueries'] = $data['innerQueries']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['timestamp']) || $this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if (!isset($this->container['method']) || $this->container['method'] === null) { + $invalidProperties[] = "'method' can't be null"; + } + if (!isset($this->container['answerCode']) || $this->container['answerCode'] === null) { + $invalidProperties[] = "'answerCode' can't be null"; + } + if (!isset($this->container['queryBody']) || $this->container['queryBody'] === null) { + $invalidProperties[] = "'queryBody' can't be null"; + } + if (!isset($this->container['answer']) || $this->container['answer'] === null) { + $invalidProperties[] = "'answer' can't be null"; + } + if (!isset($this->container['url']) || $this->container['url'] === null) { + $invalidProperties[] = "'url' can't be null"; + } + if (!isset($this->container['ip']) || $this->container['ip'] === null) { + $invalidProperties[] = "'ip' can't be null"; + } + if (!isset($this->container['queryHeaders']) || $this->container['queryHeaders'] === null) { + $invalidProperties[] = "'queryHeaders' can't be null"; + } + if (!isset($this->container['sha1']) || $this->container['sha1'] === null) { + $invalidProperties[] = "'sha1' can't be null"; + } + if (!isset($this->container['nbApiCalls']) || $this->container['nbApiCalls'] === null) { + $invalidProperties[] = "'nbApiCalls' can't be null"; + } + if (!isset($this->container['processingTimeMs']) || $this->container['processingTimeMs'] === null) { + $invalidProperties[] = "'processingTimeMs' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets timestamp + * + * @return string + */ + public function getTimestamp() + { + return $this->container['timestamp'] ?? null; + } + + /** + * Sets timestamp + * + * @param string $timestamp timestamp in ISO-8601 format + * + * @return self + */ + public function setTimestamp($timestamp) + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets method + * + * @return string + */ + public function getMethod() + { + return $this->container['method'] ?? null; + } + + /** + * Sets method + * + * @param string $method HTTP method of the perfomed request + * + * @return self + */ + public function setMethod($method) + { + $this->container['method'] = $method; + + return $this; + } + + /** + * Gets answerCode + * + * @return string + */ + public function getAnswerCode() + { + return $this->container['answerCode'] ?? null; + } + + /** + * Sets answerCode + * + * @param string $answerCode HTTP response code + * + * @return self + */ + public function setAnswerCode($answerCode) + { + $this->container['answerCode'] = $answerCode; + + return $this; + } + + /** + * Gets queryBody + * + * @return string + */ + public function getQueryBody() + { + return $this->container['queryBody'] ?? null; + } + + /** + * Sets queryBody + * + * @param string $queryBody Request body. Truncated after 1000 characters. + * + * @return self + */ + public function setQueryBody($queryBody) + { + $this->container['queryBody'] = $queryBody; + + return $this; + } + + /** + * Gets answer + * + * @return string + */ + public function getAnswer() + { + return $this->container['answer'] ?? null; + } + + /** + * Sets answer + * + * @param string $answer Answer body. Truncated after 1000 characters. + * + * @return self + */ + public function setAnswer($answer) + { + $this->container['answer'] = $answer; + + return $this; + } + + /** + * Gets url + * + * @return string + */ + public function getUrl() + { + return $this->container['url'] ?? null; + } + + /** + * Sets url + * + * @param string $url request URL + * + * @return self + */ + public function setUrl($url) + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets ip + * + * @return string + */ + public function getIp() + { + return $this->container['ip'] ?? null; + } + + /** + * Sets ip + * + * @param string $ip IP of the client which perfomed the request + * + * @return self + */ + public function setIp($ip) + { + $this->container['ip'] = $ip; + + return $this; + } + + /** + * Gets queryHeaders + * + * @return string + */ + public function getQueryHeaders() + { + return $this->container['queryHeaders'] ?? null; + } + + /** + * Sets queryHeaders + * + * @param string $queryHeaders request Headers (API Key is obfuscated) + * + * @return self + */ + public function setQueryHeaders($queryHeaders) + { + $this->container['queryHeaders'] = $queryHeaders; + + return $this; + } + + /** + * Gets sha1 + * + * @return string + */ + public function getSha1() + { + return $this->container['sha1'] ?? null; + } + + /** + * Sets sha1 + * + * @param string $sha1 SHA1 signature of the log entry + * + * @return self + */ + public function setSha1($sha1) + { + $this->container['sha1'] = $sha1; + + return $this; + } + + /** + * Gets nbApiCalls + * + * @return string + */ + public function getNbApiCalls() + { + return $this->container['nbApiCalls'] ?? null; + } + + /** + * Sets nbApiCalls + * + * @param string $nbApiCalls number of API calls + * + * @return self + */ + public function setNbApiCalls($nbApiCalls) + { + $this->container['nbApiCalls'] = $nbApiCalls; + + return $this; + } + + /** + * Gets processingTimeMs + * + * @return string + */ + public function getProcessingTimeMs() + { + return $this->container['processingTimeMs'] ?? null; + } + + /** + * Sets processingTimeMs + * + * @param string $processingTimeMs Processing time for the query. It doesn't include network time. + * + * @return self + */ + public function setProcessingTimeMs($processingTimeMs) + { + $this->container['processingTimeMs'] = $processingTimeMs; + + return $this; + } + + /** + * Gets index + * + * @return string|null + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index + * + * @param string|null $index index targeted by the query + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets queryParams + * + * @return string|null + */ + public function getQueryParams() + { + return $this->container['queryParams'] ?? null; + } + + /** + * Sets queryParams + * + * @param string|null $queryParams query parameters sent with the request + * + * @return self + */ + public function setQueryParams($queryParams) + { + $this->container['queryParams'] = $queryParams; + + return $this; + } + + /** + * Gets queryNbHits + * + * @return string|null + */ + public function getQueryNbHits() + { + return $this->container['queryNbHits'] ?? null; + } + + /** + * Sets queryNbHits + * + * @param string|null $queryNbHits number of hits returned for the query + * + * @return self + */ + public function setQueryNbHits($queryNbHits) + { + $this->container['queryNbHits'] = $queryNbHits; + + return $this; + } + + /** + * Gets innerQueries + * + * @return \Algolia\AlgoliaSearch\Model\Search\GetLogsResponseInnerQueries[]|null + */ + public function getInnerQueries() + { + return $this->container['innerQueries'] ?? null; + } + + /** + * Sets innerQueries + * + * @param \Algolia\AlgoliaSearch\Model\Search\GetLogsResponseInnerQueries[]|null $innerQueries array of all performed queries for the given request + * + * @return self + */ + public function setInnerQueries($innerQueries) + { + $this->container['innerQueries'] = $innerQueries; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/GetObjectsParams.php b/clients/algoliasearch-client-php/lib/Model/Search/GetObjectsParams.php new file mode 100644 index 0000000000..1153d450ab --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/GetObjectsParams.php @@ -0,0 +1,209 @@ + '\Algolia\AlgoliaSearch\Model\Search\MultipleGetObjectsParams[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'requests' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['requests'])) { + $this->container['requests'] = $data['requests']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets requests + * + * @return \Algolia\AlgoliaSearch\Model\Search\MultipleGetObjectsParams[]|null + */ + public function getRequests() + { + return $this->container['requests'] ?? null; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\Search\MultipleGetObjectsParams[]|null $requests requests + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/GetObjectsResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/GetObjectsResponse.php new file mode 100644 index 0000000000..08a9e28e34 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/GetObjectsResponse.php @@ -0,0 +1,207 @@ + 'object[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'results' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['results'])) { + $this->container['results'] = $data['results']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets results + * + * @return object[]|null + */ + public function getResults() + { + return $this->container['results'] ?? null; + } + + /** + * Sets results + * + * @param object[]|null $results list of results fetched + * + * @return self + */ + public function setResults($results) + { + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/GetTaskResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/GetTaskResponse.php new file mode 100644 index 0000000000..14aa4ade87 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/GetTaskResponse.php @@ -0,0 +1,245 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'status' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + const STATUS_PUBLISHED = 'published'; + const STATUS_NOT_PUBLISHED = 'notPublished'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_PUBLISHED, + self::STATUS_NOT_PUBLISHED, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['status'])) { + $this->container['status'] = $data['status']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['status']) || $this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (isset($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status'] ?? null; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/GetTopUserIdsResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/GetTopUserIdsResponse.php new file mode 100644 index 0000000000..59dc1acc8f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/GetTopUserIdsResponse.php @@ -0,0 +1,213 @@ + 'array[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'topUsers' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'topUsers' => 'setTopUsers', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'topUsers' => 'getTopUsers', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['topUsers'])) { + $this->container['topUsers'] = $data['topUsers']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['topUsers']) || $this->container['topUsers'] === null) { + $invalidProperties[] = "'topUsers' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets topUsers + * + * @return array[] + */ + public function getTopUsers() + { + return $this->container['topUsers'] ?? null; + } + + /** + * Sets topUsers + * + * @param array[] $topUsers Mapping of cluster names to top users + * + * @return self + */ + public function setTopUsers($topUsers) + { + $this->container['topUsers'] = $topUsers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/HighlightResult.php b/clients/algoliasearch-client-php/lib/Model/Search/HighlightResult.php new file mode 100644 index 0000000000..e32be63468 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/HighlightResult.php @@ -0,0 +1,339 @@ + 'string', + 'matchLevel' => 'string', + '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 property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'matchLevel' => 'setMatchLevel', + 'matchedWords' => 'setMatchedWords', + 'fullyHighlighted' => 'setFullyHighlighted', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'matchLevel' => 'getMatchLevel', + 'matchedWords' => 'getMatchedWords', + 'fullyHighlighted' => 'getFullyHighlighted', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + const MATCH_LEVEL_NONE = 'none'; + const MATCH_LEVEL_PARTIAL = 'partial'; + const MATCH_LEVEL_FULL = 'full'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMatchLevelAllowableValues() + { + return [ + self::MATCH_LEVEL_NONE, + self::MATCH_LEVEL_PARTIAL, + self::MATCH_LEVEL_FULL, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + 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']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMatchLevelAllowableValues(); + if (isset($this->container['matchLevel']) && !in_array($this->container['matchLevel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'matchLevel', must be one of '%s'", + $this->container['matchLevel'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value + * + * @param string|null $value markup text with occurrences highlighted + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matchLevel + * + * @return string|null + */ + public function getMatchLevel() + { + return $this->container['matchLevel'] ?? null; + } + + /** + * Sets matchLevel + * + * @param string|null $matchLevel indicates how well the attribute matched the search query + * + * @return self + */ + public function setMatchLevel($matchLevel) + { + $allowedValues = $this->getMatchLevelAllowableValues(); + if (!is_null($matchLevel) && !in_array($matchLevel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'matchLevel', must be one of '%s'", + $matchLevel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['matchLevel'] = $matchLevel; + + return $this; + } + + /** + * Gets matchedWords + * + * @return string[]|null + */ + public function getMatchedWords() + { + return $this->container['matchedWords'] ?? null; + } + + /** + * Sets matchedWords + * + * @param string[]|null $matchedWords list of words from the query that matched the object + * + * @return self + */ + public function setMatchedWords($matchedWords) + { + $this->container['matchedWords'] = $matchedWords; + + return $this; + } + + /** + * Gets fullyHighlighted + * + * @return bool|null + */ + public function getFullyHighlighted() + { + return $this->container['fullyHighlighted'] ?? null; + } + + /** + * Sets fullyHighlighted + * + * @param bool|null $fullyHighlighted whether the entire attribute value is highlighted + * + * @return self + */ + public function setFullyHighlighted($fullyHighlighted) + { + $this->container['fullyHighlighted'] = $fullyHighlighted; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/Hit.php b/clients/algoliasearch-client-php/lib/Model/Search/Hit.php new file mode 100644 index 0000000000..8244475ad5 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/Hit.php @@ -0,0 +1,337 @@ + 'string', + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\Search\HighlightResult', + 'snippetResult' => '\Algolia\AlgoliaSearch\Model\Search\SnippetResult', + 'rankingInfo' => '\Algolia\AlgoliaSearch\Model\Search\RankingInfo', + '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 property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'highlightResult' => 'setHighlightResult', + 'snippetResult' => 'setSnippetResult', + 'rankingInfo' => 'setRankingInfo', + 'distinctSeqID' => 'setDistinctSeqID', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'highlightResult' => 'getHighlightResult', + 'snippetResult' => 'getSnippetResult', + 'rankingInfo' => 'getRankingInfo', + 'distinctSeqID' => 'getDistinctSeqID', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['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']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['objectID']) || $this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets highlightResult + * + * @return \Algolia\AlgoliaSearch\Model\Search\HighlightResult|null + */ + public function getHighlightResult() + { + return $this->container['highlightResult'] ?? null; + } + + /** + * Sets highlightResult + * + * @param \Algolia\AlgoliaSearch\Model\Search\HighlightResult|null $highlightResult highlightResult + * + * @return self + */ + public function setHighlightResult($highlightResult) + { + $this->container['highlightResult'] = $highlightResult; + + return $this; + } + + /** + * Gets snippetResult + * + * @return \Algolia\AlgoliaSearch\Model\Search\SnippetResult|null + */ + public function getSnippetResult() + { + return $this->container['snippetResult'] ?? null; + } + + /** + * Sets snippetResult + * + * @param \Algolia\AlgoliaSearch\Model\Search\SnippetResult|null $snippetResult snippetResult + * + * @return self + */ + public function setSnippetResult($snippetResult) + { + $this->container['snippetResult'] = $snippetResult; + + return $this; + } + + /** + * Gets rankingInfo + * + * @return \Algolia\AlgoliaSearch\Model\Search\RankingInfo|null + */ + public function getRankingInfo() + { + return $this->container['rankingInfo'] ?? null; + } + + /** + * Sets rankingInfo + * + * @param \Algolia\AlgoliaSearch\Model\Search\RankingInfo|null $rankingInfo rankingInfo + * + * @return self + */ + public function setRankingInfo($rankingInfo) + { + $this->container['rankingInfo'] = $rankingInfo; + + return $this; + } + + /** + * Gets distinctSeqID + * + * @return int|null + */ + public function getDistinctSeqID() + { + return $this->container['distinctSeqID'] ?? null; + } + + /** + * Sets distinctSeqID + * + * @param int|null $distinctSeqID distinctSeqID + * + * @return self + */ + public function setDistinctSeqID($distinctSeqID) + { + $this->container['distinctSeqID'] = $distinctSeqID; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/IndexSettings.php b/clients/algoliasearch-client-php/lib/Model/Search/IndexSettings.php new file mode 100644 index 0000000000..1ffce79754 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/IndexSettings.php @@ -0,0 +1,2151 @@ + 'string[]', + 'paginationLimitedTo' => 'int', + 'disableTypoToleranceOnWords' => 'string[]', + 'attributesToTransliterate' => 'string[]', + 'camelCaseAttributes' => 'string[]', + 'decompoundedAttributes' => 'object', + 'indexLanguages' => 'string[]', + 'filterPromotes' => 'bool', + 'disablePrefixOnAttributes' => 'string[]', + 'allowCompressionOfIntegerArray' => 'bool', + 'numericAttributesForFiltering' => 'string[]', + 'userData' => 'object', + 'searchableAttributes' => 'string[]', + 'attributesForFaceting' => 'string[]', + 'unretrievableAttributes' => 'string[]', + 'attributesToRetrieve' => 'string[]', + 'restrictSearchableAttributes' => 'string[]', + 'ranking' => 'string[]', + 'customRanking' => 'string[]', + 'relevancyStrictness' => 'int', + 'attributesToHighlight' => 'string[]', + 'attributesToSnippet' => 'string[]', + 'highlightPreTag' => 'string', + 'highlightPostTag' => 'string', + 'snippetEllipsisText' => 'string', + 'restrictHighlightAndSnippetArrays' => 'bool', + 'hitsPerPage' => 'int', + 'minWordSizefor1Typo' => 'int', + 'minWordSizefor2Typos' => 'int', + 'typoTolerance' => 'string', + 'allowTyposOnNumericTokens' => 'bool', + 'disableTypoToleranceOnAttributes' => 'string[]', + 'separatorsToIndex' => 'string', + 'ignorePlurals' => 'string', + 'removeStopWords' => 'string', + 'keepDiacriticsOnCharacters' => 'string', + 'queryLanguages' => 'string[]', + 'decompoundQuery' => 'bool', + 'enableRules' => 'bool', + 'enablePersonalization' => 'bool', + 'queryType' => 'string', + 'removeWordsIfNoResults' => 'string', + 'advancedSyntax' => 'bool', + 'optionalWords' => 'string[]', + 'disableExactOnAttributes' => 'string[]', + 'exactOnSingleWordQuery' => 'string', + 'alternativesAsExact' => 'string[]', + 'advancedSyntaxFeatures' => 'string[]', + 'distinct' => 'int', + 'synonyms' => 'bool', + 'replaceSynonymsInHighlight' => 'bool', + 'minProximity' => 'int', + 'responseFields' => 'string[]', + 'maxFacetHits' => 'int', + 'attributeCriteriaComputedByMinProximity' => 'bool', + 'renderingContent' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'replicas' => null, + 'paginationLimitedTo' => null, + 'disableTypoToleranceOnWords' => null, + 'attributesToTransliterate' => null, + 'camelCaseAttributes' => null, + 'decompoundedAttributes' => null, + 'indexLanguages' => null, + 'filterPromotes' => null, + 'disablePrefixOnAttributes' => null, + 'allowCompressionOfIntegerArray' => null, + 'numericAttributesForFiltering' => null, + 'userData' => null, + 'searchableAttributes' => null, + 'attributesForFaceting' => null, + 'unretrievableAttributes' => null, + 'attributesToRetrieve' => null, + 'restrictSearchableAttributes' => null, + 'ranking' => null, + 'customRanking' => null, + 'relevancyStrictness' => null, + 'attributesToHighlight' => null, + 'attributesToSnippet' => null, + 'highlightPreTag' => null, + 'highlightPostTag' => null, + 'snippetEllipsisText' => null, + 'restrictHighlightAndSnippetArrays' => null, + 'hitsPerPage' => null, + 'minWordSizefor1Typo' => null, + 'minWordSizefor2Typos' => null, + 'typoTolerance' => null, + 'allowTyposOnNumericTokens' => null, + 'disableTypoToleranceOnAttributes' => null, + 'separatorsToIndex' => null, + 'ignorePlurals' => null, + 'removeStopWords' => null, + 'keepDiacriticsOnCharacters' => null, + 'queryLanguages' => null, + 'decompoundQuery' => null, + 'enableRules' => null, + 'enablePersonalization' => null, + 'queryType' => null, + 'removeWordsIfNoResults' => null, + 'advancedSyntax' => null, + 'optionalWords' => null, + 'disableExactOnAttributes' => null, + 'exactOnSingleWordQuery' => null, + 'alternativesAsExact' => null, + 'advancedSyntaxFeatures' => null, + 'distinct' => null, + 'synonyms' => null, + 'replaceSynonymsInHighlight' => null, + 'minProximity' => null, + 'responseFields' => null, + 'maxFacetHits' => null, + 'attributeCriteriaComputedByMinProximity' => null, + 'renderingContent' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'replicas' => 'setReplicas', + 'paginationLimitedTo' => 'setPaginationLimitedTo', + 'disableTypoToleranceOnWords' => 'setDisableTypoToleranceOnWords', + 'attributesToTransliterate' => 'setAttributesToTransliterate', + 'camelCaseAttributes' => 'setCamelCaseAttributes', + 'decompoundedAttributes' => 'setDecompoundedAttributes', + 'indexLanguages' => 'setIndexLanguages', + 'filterPromotes' => 'setFilterPromotes', + 'disablePrefixOnAttributes' => 'setDisablePrefixOnAttributes', + 'allowCompressionOfIntegerArray' => 'setAllowCompressionOfIntegerArray', + 'numericAttributesForFiltering' => 'setNumericAttributesForFiltering', + 'userData' => 'setUserData', + 'searchableAttributes' => 'setSearchableAttributes', + 'attributesForFaceting' => 'setAttributesForFaceting', + 'unretrievableAttributes' => 'setUnretrievableAttributes', + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'restrictSearchableAttributes' => 'setRestrictSearchableAttributes', + 'ranking' => 'setRanking', + 'customRanking' => 'setCustomRanking', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'attributesToHighlight' => 'setAttributesToHighlight', + 'attributesToSnippet' => 'setAttributesToSnippet', + 'highlightPreTag' => 'setHighlightPreTag', + 'highlightPostTag' => 'setHighlightPostTag', + 'snippetEllipsisText' => 'setSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'setRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'setHitsPerPage', + 'minWordSizefor1Typo' => 'setMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'setMinWordSizefor2Typos', + 'typoTolerance' => 'setTypoTolerance', + 'allowTyposOnNumericTokens' => 'setAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'setDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'setSeparatorsToIndex', + 'ignorePlurals' => 'setIgnorePlurals', + 'removeStopWords' => 'setRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'setKeepDiacriticsOnCharacters', + 'queryLanguages' => 'setQueryLanguages', + 'decompoundQuery' => 'setDecompoundQuery', + 'enableRules' => 'setEnableRules', + 'enablePersonalization' => 'setEnablePersonalization', + 'queryType' => 'setQueryType', + 'removeWordsIfNoResults' => 'setRemoveWordsIfNoResults', + 'advancedSyntax' => 'setAdvancedSyntax', + 'optionalWords' => 'setOptionalWords', + 'disableExactOnAttributes' => 'setDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'setExactOnSingleWordQuery', + 'alternativesAsExact' => 'setAlternativesAsExact', + 'advancedSyntaxFeatures' => 'setAdvancedSyntaxFeatures', + 'distinct' => 'setDistinct', + 'synonyms' => 'setSynonyms', + 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', + 'minProximity' => 'setMinProximity', + 'responseFields' => 'setResponseFields', + 'maxFacetHits' => 'setMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'setRenderingContent', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'replicas' => 'getReplicas', + 'paginationLimitedTo' => 'getPaginationLimitedTo', + 'disableTypoToleranceOnWords' => 'getDisableTypoToleranceOnWords', + 'attributesToTransliterate' => 'getAttributesToTransliterate', + 'camelCaseAttributes' => 'getCamelCaseAttributes', + 'decompoundedAttributes' => 'getDecompoundedAttributes', + 'indexLanguages' => 'getIndexLanguages', + 'filterPromotes' => 'getFilterPromotes', + 'disablePrefixOnAttributes' => 'getDisablePrefixOnAttributes', + 'allowCompressionOfIntegerArray' => 'getAllowCompressionOfIntegerArray', + 'numericAttributesForFiltering' => 'getNumericAttributesForFiltering', + 'userData' => 'getUserData', + 'searchableAttributes' => 'getSearchableAttributes', + 'attributesForFaceting' => 'getAttributesForFaceting', + 'unretrievableAttributes' => 'getUnretrievableAttributes', + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'restrictSearchableAttributes' => 'getRestrictSearchableAttributes', + 'ranking' => 'getRanking', + 'customRanking' => 'getCustomRanking', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'attributesToHighlight' => 'getAttributesToHighlight', + 'attributesToSnippet' => 'getAttributesToSnippet', + 'highlightPreTag' => 'getHighlightPreTag', + 'highlightPostTag' => 'getHighlightPostTag', + 'snippetEllipsisText' => 'getSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'getRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'getHitsPerPage', + 'minWordSizefor1Typo' => 'getMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'getMinWordSizefor2Typos', + 'typoTolerance' => 'getTypoTolerance', + 'allowTyposOnNumericTokens' => 'getAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'getDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'getSeparatorsToIndex', + 'ignorePlurals' => 'getIgnorePlurals', + 'removeStopWords' => 'getRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'getKeepDiacriticsOnCharacters', + 'queryLanguages' => 'getQueryLanguages', + 'decompoundQuery' => 'getDecompoundQuery', + 'enableRules' => 'getEnableRules', + 'enablePersonalization' => 'getEnablePersonalization', + 'queryType' => 'getQueryType', + 'removeWordsIfNoResults' => 'getRemoveWordsIfNoResults', + 'advancedSyntax' => 'getAdvancedSyntax', + 'optionalWords' => 'getOptionalWords', + 'disableExactOnAttributes' => 'getDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'getExactOnSingleWordQuery', + 'alternativesAsExact' => 'getAlternativesAsExact', + 'advancedSyntaxFeatures' => 'getAdvancedSyntaxFeatures', + 'distinct' => 'getDistinct', + 'synonyms' => 'getSynonyms', + 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', + 'minProximity' => 'getMinProximity', + 'responseFields' => 'getResponseFields', + 'maxFacetHits' => 'getMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'getRenderingContent', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + const TYPO_TOLERANCE_TRUE = 'true'; + const TYPO_TOLERANCE_FALSE = 'false'; + const TYPO_TOLERANCE_MIN = 'min'; + const TYPO_TOLERANCE_STRICT = 'strict'; + const QUERY_TYPE_PREFIX_LAST = 'prefixLast'; + const QUERY_TYPE_PREFIX_ALL = 'prefixAll'; + const QUERY_TYPE_PREFIX_NONE = 'prefixNone'; + const REMOVE_WORDS_IF_NO_RESULTS_NONE = 'none'; + const REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS = 'lastWords'; + const REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS = 'firstWords'; + const REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL = 'allOptional'; + const EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE = 'attribute'; + const EXACT_ON_SINGLE_WORD_QUERY_NONE = 'none'; + const EXACT_ON_SINGLE_WORD_QUERY_WORD = 'word'; + const ALTERNATIVES_AS_EXACT_IGNORE_PLURALS = 'ignorePlurals'; + const ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM = 'singleWordSynonym'; + const ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM = 'multiWordsSynonym'; + const ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE = 'exactPhrase'; + const ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS = 'excludeWords'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypoToleranceAllowableValues() + { + return [ + self::TYPO_TOLERANCE_TRUE, + self::TYPO_TOLERANCE_FALSE, + self::TYPO_TOLERANCE_MIN, + self::TYPO_TOLERANCE_STRICT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getQueryTypeAllowableValues() + { + return [ + self::QUERY_TYPE_PREFIX_LAST, + self::QUERY_TYPE_PREFIX_ALL, + self::QUERY_TYPE_PREFIX_NONE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemoveWordsIfNoResultsAllowableValues() + { + return [ + self::REMOVE_WORDS_IF_NO_RESULTS_NONE, + self::REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExactOnSingleWordQueryAllowableValues() + { + return [ + self::EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE, + self::EXACT_ON_SINGLE_WORD_QUERY_NONE, + self::EXACT_ON_SINGLE_WORD_QUERY_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAlternativesAsExactAllowableValues() + { + return [ + self::ALTERNATIVES_AS_EXACT_IGNORE_PLURALS, + self::ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM, + self::ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdvancedSyntaxFeaturesAllowableValues() + { + return [ + self::ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE, + self::ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['replicas'])) { + $this->container['replicas'] = $data['replicas']; + } + if (isset($data['paginationLimitedTo'])) { + $this->container['paginationLimitedTo'] = $data['paginationLimitedTo']; + } + if (isset($data['disableTypoToleranceOnWords'])) { + $this->container['disableTypoToleranceOnWords'] = $data['disableTypoToleranceOnWords']; + } + if (isset($data['attributesToTransliterate'])) { + $this->container['attributesToTransliterate'] = $data['attributesToTransliterate']; + } + if (isset($data['camelCaseAttributes'])) { + $this->container['camelCaseAttributes'] = $data['camelCaseAttributes']; + } + if (isset($data['decompoundedAttributes'])) { + $this->container['decompoundedAttributes'] = $data['decompoundedAttributes']; + } + if (isset($data['indexLanguages'])) { + $this->container['indexLanguages'] = $data['indexLanguages']; + } + if (isset($data['filterPromotes'])) { + $this->container['filterPromotes'] = $data['filterPromotes']; + } + if (isset($data['disablePrefixOnAttributes'])) { + $this->container['disablePrefixOnAttributes'] = $data['disablePrefixOnAttributes']; + } + if (isset($data['allowCompressionOfIntegerArray'])) { + $this->container['allowCompressionOfIntegerArray'] = $data['allowCompressionOfIntegerArray']; + } + if (isset($data['numericAttributesForFiltering'])) { + $this->container['numericAttributesForFiltering'] = $data['numericAttributesForFiltering']; + } + if (isset($data['userData'])) { + $this->container['userData'] = $data['userData']; + } + if (isset($data['searchableAttributes'])) { + $this->container['searchableAttributes'] = $data['searchableAttributes']; + } + if (isset($data['attributesForFaceting'])) { + $this->container['attributesForFaceting'] = $data['attributesForFaceting']; + } + if (isset($data['unretrievableAttributes'])) { + $this->container['unretrievableAttributes'] = $data['unretrievableAttributes']; + } + if (isset($data['attributesToRetrieve'])) { + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; + } + if (isset($data['restrictSearchableAttributes'])) { + $this->container['restrictSearchableAttributes'] = $data['restrictSearchableAttributes']; + } + if (isset($data['ranking'])) { + $this->container['ranking'] = $data['ranking']; + } + if (isset($data['customRanking'])) { + $this->container['customRanking'] = $data['customRanking']; + } + if (isset($data['relevancyStrictness'])) { + $this->container['relevancyStrictness'] = $data['relevancyStrictness']; + } + if (isset($data['attributesToHighlight'])) { + $this->container['attributesToHighlight'] = $data['attributesToHighlight']; + } + if (isset($data['attributesToSnippet'])) { + $this->container['attributesToSnippet'] = $data['attributesToSnippet']; + } + if (isset($data['highlightPreTag'])) { + $this->container['highlightPreTag'] = $data['highlightPreTag']; + } + if (isset($data['highlightPostTag'])) { + $this->container['highlightPostTag'] = $data['highlightPostTag']; + } + if (isset($data['snippetEllipsisText'])) { + $this->container['snippetEllipsisText'] = $data['snippetEllipsisText']; + } + if (isset($data['restrictHighlightAndSnippetArrays'])) { + $this->container['restrictHighlightAndSnippetArrays'] = $data['restrictHighlightAndSnippetArrays']; + } + if (isset($data['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + if (isset($data['minWordSizefor1Typo'])) { + $this->container['minWordSizefor1Typo'] = $data['minWordSizefor1Typo']; + } + if (isset($data['minWordSizefor2Typos'])) { + $this->container['minWordSizefor2Typos'] = $data['minWordSizefor2Typos']; + } + if (isset($data['typoTolerance'])) { + $this->container['typoTolerance'] = $data['typoTolerance']; + } + if (isset($data['allowTyposOnNumericTokens'])) { + $this->container['allowTyposOnNumericTokens'] = $data['allowTyposOnNumericTokens']; + } + if (isset($data['disableTypoToleranceOnAttributes'])) { + $this->container['disableTypoToleranceOnAttributes'] = $data['disableTypoToleranceOnAttributes']; + } + if (isset($data['separatorsToIndex'])) { + $this->container['separatorsToIndex'] = $data['separatorsToIndex']; + } + if (isset($data['ignorePlurals'])) { + $this->container['ignorePlurals'] = $data['ignorePlurals']; + } + if (isset($data['removeStopWords'])) { + $this->container['removeStopWords'] = $data['removeStopWords']; + } + if (isset($data['keepDiacriticsOnCharacters'])) { + $this->container['keepDiacriticsOnCharacters'] = $data['keepDiacriticsOnCharacters']; + } + if (isset($data['queryLanguages'])) { + $this->container['queryLanguages'] = $data['queryLanguages']; + } + if (isset($data['decompoundQuery'])) { + $this->container['decompoundQuery'] = $data['decompoundQuery']; + } + if (isset($data['enableRules'])) { + $this->container['enableRules'] = $data['enableRules']; + } + if (isset($data['enablePersonalization'])) { + $this->container['enablePersonalization'] = $data['enablePersonalization']; + } + if (isset($data['queryType'])) { + $this->container['queryType'] = $data['queryType']; + } + if (isset($data['removeWordsIfNoResults'])) { + $this->container['removeWordsIfNoResults'] = $data['removeWordsIfNoResults']; + } + if (isset($data['advancedSyntax'])) { + $this->container['advancedSyntax'] = $data['advancedSyntax']; + } + if (isset($data['optionalWords'])) { + $this->container['optionalWords'] = $data['optionalWords']; + } + if (isset($data['disableExactOnAttributes'])) { + $this->container['disableExactOnAttributes'] = $data['disableExactOnAttributes']; + } + if (isset($data['exactOnSingleWordQuery'])) { + $this->container['exactOnSingleWordQuery'] = $data['exactOnSingleWordQuery']; + } + if (isset($data['alternativesAsExact'])) { + $this->container['alternativesAsExact'] = $data['alternativesAsExact']; + } + if (isset($data['advancedSyntaxFeatures'])) { + $this->container['advancedSyntaxFeatures'] = $data['advancedSyntaxFeatures']; + } + if (isset($data['distinct'])) { + $this->container['distinct'] = $data['distinct']; + } + if (isset($data['synonyms'])) { + $this->container['synonyms'] = $data['synonyms']; + } + if (isset($data['replaceSynonymsInHighlight'])) { + $this->container['replaceSynonymsInHighlight'] = $data['replaceSynonymsInHighlight']; + } + if (isset($data['minProximity'])) { + $this->container['minProximity'] = $data['minProximity']; + } + if (isset($data['responseFields'])) { + $this->container['responseFields'] = $data['responseFields']; + } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } + if (isset($data['attributeCriteriaComputedByMinProximity'])) { + $this->container['attributeCriteriaComputedByMinProximity'] = $data['attributeCriteriaComputedByMinProximity']; + } + if (isset($data['renderingContent'])) { + $this->container['renderingContent'] = $data['renderingContent']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (isset($this->container['typoTolerance']) && !in_array($this->container['typoTolerance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'typoTolerance', must be one of '%s'", + $this->container['typoTolerance'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getQueryTypeAllowableValues(); + if (isset($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'queryType', must be one of '%s'", + $this->container['queryType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (isset($this->container['removeWordsIfNoResults']) && !in_array($this->container['removeWordsIfNoResults'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $this->container['removeWordsIfNoResults'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (isset($this->container['exactOnSingleWordQuery']) && !in_array($this->container['exactOnSingleWordQuery'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $this->container['exactOnSingleWordQuery'], + implode("', '", $allowedValues) + ); + } + + if (isset($this->container['distinct']) && ($this->container['distinct'] > 4)) { + $invalidProperties[] = "invalid value for 'distinct', must be smaller than or equal to 4."; + } + + if (isset($this->container['distinct']) && ($this->container['distinct'] < 0)) { + $invalidProperties[] = "invalid value for 'distinct', must be bigger than or equal to 0."; + } + + if (isset($this->container['minProximity']) && ($this->container['minProximity'] > 7)) { + $invalidProperties[] = "invalid value for 'minProximity', must be smaller than or equal to 7."; + } + + if (isset($this->container['minProximity']) && ($this->container['minProximity'] < 1)) { + $invalidProperties[] = "invalid value for 'minProximity', must be bigger than or equal to 1."; + } + + if (isset($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets replicas + * + * @return string[]|null + */ + public function getReplicas() + { + return $this->container['replicas'] ?? null; + } + + /** + * Sets replicas + * + * @param string[]|null $replicas creates replicas, exact copies of an index + * + * @return self + */ + public function setReplicas($replicas) + { + $this->container['replicas'] = $replicas; + + return $this; + } + + /** + * Gets paginationLimitedTo + * + * @return int|null + */ + public function getPaginationLimitedTo() + { + return $this->container['paginationLimitedTo'] ?? null; + } + + /** + * Sets paginationLimitedTo + * + * @param int|null $paginationLimitedTo set the maximum number of hits accessible via pagination + * + * @return self + */ + public function setPaginationLimitedTo($paginationLimitedTo) + { + $this->container['paginationLimitedTo'] = $paginationLimitedTo; + + return $this; + } + + /** + * Gets disableTypoToleranceOnWords + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnWords() + { + return $this->container['disableTypoToleranceOnWords'] ?? null; + } + + /** + * Sets disableTypoToleranceOnWords + * + * @param string[]|null $disableTypoToleranceOnWords a list of words for which you want to turn off typo tolerance + * + * @return self + */ + public function setDisableTypoToleranceOnWords($disableTypoToleranceOnWords) + { + $this->container['disableTypoToleranceOnWords'] = $disableTypoToleranceOnWords; + + return $this; + } + + /** + * Gets attributesToTransliterate + * + * @return string[]|null + */ + public function getAttributesToTransliterate() + { + return $this->container['attributesToTransliterate'] ?? null; + } + + /** + * Sets attributesToTransliterate + * + * @param string[]|null $attributesToTransliterate specify on which attributes to apply transliteration + * + * @return self + */ + public function setAttributesToTransliterate($attributesToTransliterate) + { + $this->container['attributesToTransliterate'] = $attributesToTransliterate; + + return $this; + } + + /** + * Gets camelCaseAttributes + * + * @return string[]|null + */ + public function getCamelCaseAttributes() + { + return $this->container['camelCaseAttributes'] ?? null; + } + + /** + * Sets camelCaseAttributes + * + * @param string[]|null $camelCaseAttributes list of attributes on which to do a decomposition of camel case words + * + * @return self + */ + public function setCamelCaseAttributes($camelCaseAttributes) + { + $this->container['camelCaseAttributes'] = $camelCaseAttributes; + + return $this; + } + + /** + * Gets decompoundedAttributes + * + * @return object|null + */ + public function getDecompoundedAttributes() + { + return $this->container['decompoundedAttributes'] ?? null; + } + + /** + * Sets decompoundedAttributes + * + * @param object|null $decompoundedAttributes specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding + * + * @return self + */ + public function setDecompoundedAttributes($decompoundedAttributes) + { + $this->container['decompoundedAttributes'] = $decompoundedAttributes; + + return $this; + } + + /** + * Gets indexLanguages + * + * @return string[]|null + */ + public function getIndexLanguages() + { + return $this->container['indexLanguages'] ?? null; + } + + /** + * Sets indexLanguages + * + * @param string[]|null $indexLanguages sets the languages at the index level for language-specific processing such as tokenization and normalization + * + * @return self + */ + public function setIndexLanguages($indexLanguages) + { + $this->container['indexLanguages'] = $indexLanguages; + + return $this; + } + + /** + * Gets filterPromotes + * + * @return bool|null + */ + public function getFilterPromotes() + { + return $this->container['filterPromotes'] ?? null; + } + + /** + * Sets filterPromotes + * + * @param bool|null $filterPromotes whether promoted results should match the filters of the current search, except for geographic filters + * + * @return self + */ + public function setFilterPromotes($filterPromotes) + { + $this->container['filterPromotes'] = $filterPromotes; + + return $this; + } + + /** + * Gets disablePrefixOnAttributes + * + * @return string[]|null + */ + public function getDisablePrefixOnAttributes() + { + return $this->container['disablePrefixOnAttributes'] ?? null; + } + + /** + * Sets disablePrefixOnAttributes + * + * @param string[]|null $disablePrefixOnAttributes list of attributes on which you want to disable prefix matching + * + * @return self + */ + public function setDisablePrefixOnAttributes($disablePrefixOnAttributes) + { + $this->container['disablePrefixOnAttributes'] = $disablePrefixOnAttributes; + + return $this; + } + + /** + * Gets allowCompressionOfIntegerArray + * + * @return bool|null + */ + public function getAllowCompressionOfIntegerArray() + { + return $this->container['allowCompressionOfIntegerArray'] ?? null; + } + + /** + * Sets allowCompressionOfIntegerArray + * + * @param bool|null $allowCompressionOfIntegerArray enables compression of large integer arrays + * + * @return self + */ + public function setAllowCompressionOfIntegerArray($allowCompressionOfIntegerArray) + { + $this->container['allowCompressionOfIntegerArray'] = $allowCompressionOfIntegerArray; + + return $this; + } + + /** + * Gets numericAttributesForFiltering + * + * @return string[]|null + */ + public function getNumericAttributesForFiltering() + { + return $this->container['numericAttributesForFiltering'] ?? null; + } + + /** + * Sets numericAttributesForFiltering + * + * @param string[]|null $numericAttributesForFiltering list of numeric attributes that can be used as numerical filters + * + * @return self + */ + public function setNumericAttributesForFiltering($numericAttributesForFiltering) + { + $this->container['numericAttributesForFiltering'] = $numericAttributesForFiltering; + + return $this; + } + + /** + * Gets userData + * + * @return object|null + */ + public function getUserData() + { + return $this->container['userData'] ?? null; + } + + /** + * Sets userData + * + * @param object|null $userData lets you store custom data in your indices + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + + /** + * Gets searchableAttributes + * + * @return string[]|null + */ + public function getSearchableAttributes() + { + return $this->container['searchableAttributes'] ?? null; + } + + /** + * Sets searchableAttributes + * + * @param string[]|null $searchableAttributes the complete list of attributes used for searching + * + * @return self + */ + public function setSearchableAttributes($searchableAttributes) + { + $this->container['searchableAttributes'] = $searchableAttributes; + + return $this; + } + + /** + * Gets attributesForFaceting + * + * @return string[]|null + */ + public function getAttributesForFaceting() + { + return $this->container['attributesForFaceting'] ?? null; + } + + /** + * Sets attributesForFaceting + * + * @param string[]|null $attributesForFaceting the complete list of attributes that will be used for faceting + * + * @return self + */ + public function setAttributesForFaceting($attributesForFaceting) + { + $this->container['attributesForFaceting'] = $attributesForFaceting; + + return $this; + } + + /** + * Gets unretrievableAttributes + * + * @return string[]|null + */ + public function getUnretrievableAttributes() + { + return $this->container['unretrievableAttributes'] ?? null; + } + + /** + * Sets unretrievableAttributes + * + * @param string[]|null $unretrievableAttributes list of attributes that can't be retrieved at query time + * + * @return self + */ + public function setUnretrievableAttributes($unretrievableAttributes) + { + $this->container['unretrievableAttributes'] = $unretrievableAttributes; + + return $this; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve'] ?? null; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve this parameter controls which attributes to retrieve and which not to retrieve + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets restrictSearchableAttributes + * + * @return string[]|null + */ + public function getRestrictSearchableAttributes() + { + return $this->container['restrictSearchableAttributes'] ?? null; + } + + /** + * Sets restrictSearchableAttributes + * + * @param string[]|null $restrictSearchableAttributes restricts a given query to look in only a subset of your searchable attributes + * + * @return self + */ + public function setRestrictSearchableAttributes($restrictSearchableAttributes) + { + $this->container['restrictSearchableAttributes'] = $restrictSearchableAttributes; + + return $this; + } + + /** + * Gets ranking + * + * @return string[]|null + */ + public function getRanking() + { + return $this->container['ranking'] ?? null; + } + + /** + * Sets ranking + * + * @param string[]|null $ranking controls how Algolia should sort your results + * + * @return self + */ + public function setRanking($ranking) + { + $this->container['ranking'] = $ranking; + + return $this; + } + + /** + * Gets customRanking + * + * @return string[]|null + */ + public function getCustomRanking() + { + return $this->container['customRanking'] ?? null; + } + + /** + * Sets customRanking + * + * @param string[]|null $customRanking specifies the custom ranking criterion + * + * @return self + */ + public function setCustomRanking($customRanking) + { + $this->container['customRanking'] = $customRanking; + + return $this; + } + + /** + * Gets relevancyStrictness + * + * @return int|null + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness'] ?? null; + } + + /** + * Sets relevancyStrictness + * + * @param int|null $relevancyStrictness controls the relevancy threshold below which less relevant results aren't included in the results + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets attributesToHighlight + * + * @return string[]|null + */ + public function getAttributesToHighlight() + { + return $this->container['attributesToHighlight'] ?? null; + } + + /** + * Sets attributesToHighlight + * + * @param string[]|null $attributesToHighlight list of attributes to highlight + * + * @return self + */ + public function setAttributesToHighlight($attributesToHighlight) + { + $this->container['attributesToHighlight'] = $attributesToHighlight; + + return $this; + } + + /** + * Gets attributesToSnippet + * + * @return string[]|null + */ + public function getAttributesToSnippet() + { + return $this->container['attributesToSnippet'] ?? null; + } + + /** + * Sets attributesToSnippet + * + * @param string[]|null $attributesToSnippet list of attributes to snippet, with an optional maximum number of words to snippet + * + * @return self + */ + public function setAttributesToSnippet($attributesToSnippet) + { + $this->container['attributesToSnippet'] = $attributesToSnippet; + + return $this; + } + + /** + * Gets highlightPreTag + * + * @return string|null + */ + public function getHighlightPreTag() + { + return $this->container['highlightPreTag'] ?? null; + } + + /** + * Sets highlightPreTag + * + * @param string|null $highlightPreTag the HTML string to insert before the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPreTag($highlightPreTag) + { + $this->container['highlightPreTag'] = $highlightPreTag; + + return $this; + } + + /** + * Gets highlightPostTag + * + * @return string|null + */ + public function getHighlightPostTag() + { + return $this->container['highlightPostTag'] ?? null; + } + + /** + * Sets highlightPostTag + * + * @param string|null $highlightPostTag the HTML string to insert after the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPostTag($highlightPostTag) + { + $this->container['highlightPostTag'] = $highlightPostTag; + + return $this; + } + + /** + * Gets snippetEllipsisText + * + * @return string|null + */ + public function getSnippetEllipsisText() + { + return $this->container['snippetEllipsisText'] ?? null; + } + + /** + * Sets snippetEllipsisText + * + * @param string|null $snippetEllipsisText string used as an ellipsis indicator when a snippet is truncated + * + * @return self + */ + public function setSnippetEllipsisText($snippetEllipsisText) + { + $this->container['snippetEllipsisText'] = $snippetEllipsisText; + + return $this; + } + + /** + * Gets restrictHighlightAndSnippetArrays + * + * @return bool|null + */ + public function getRestrictHighlightAndSnippetArrays() + { + return $this->container['restrictHighlightAndSnippetArrays'] ?? null; + } + + /** + * Sets restrictHighlightAndSnippetArrays + * + * @param bool|null $restrictHighlightAndSnippetArrays restrict highlighting and snippeting to items that matched the query + * + * @return self + */ + public function setRestrictHighlightAndSnippetArrays($restrictHighlightAndSnippetArrays) + { + $this->container['restrictHighlightAndSnippetArrays'] = $restrictHighlightAndSnippetArrays; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets minWordSizefor1Typo + * + * @return int|null + */ + public function getMinWordSizefor1Typo() + { + return $this->container['minWordSizefor1Typo'] ?? null; + } + + /** + * Sets minWordSizefor1Typo + * + * @param int|null $minWordSizefor1Typo minimum number of characters a word in the query string must contain to accept matches with 1 typo + * + * @return self + */ + public function setMinWordSizefor1Typo($minWordSizefor1Typo) + { + $this->container['minWordSizefor1Typo'] = $minWordSizefor1Typo; + + return $this; + } + + /** + * Gets minWordSizefor2Typos + * + * @return int|null + */ + public function getMinWordSizefor2Typos() + { + return $this->container['minWordSizefor2Typos'] ?? null; + } + + /** + * Sets minWordSizefor2Typos + * + * @param int|null $minWordSizefor2Typos minimum number of characters a word in the query string must contain to accept matches with 2 typos + * + * @return self + */ + public function setMinWordSizefor2Typos($minWordSizefor2Typos) + { + $this->container['minWordSizefor2Typos'] = $minWordSizefor2Typos; + + return $this; + } + + /** + * Gets typoTolerance + * + * @return string|null + */ + public function getTypoTolerance() + { + return $this->container['typoTolerance'] ?? null; + } + + /** + * Sets typoTolerance + * + * @param string|null $typoTolerance controls whether typo tolerance is enabled and how it is applied + * + * @return self + */ + public function setTypoTolerance($typoTolerance) + { + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($typoTolerance) && !in_array($typoTolerance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'typoTolerance', must be one of '%s'", + $typoTolerance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['typoTolerance'] = $typoTolerance; + + return $this; + } + + /** + * Gets allowTyposOnNumericTokens + * + * @return bool|null + */ + public function getAllowTyposOnNumericTokens() + { + return $this->container['allowTyposOnNumericTokens'] ?? null; + } + + /** + * Sets allowTyposOnNumericTokens + * + * @param bool|null $allowTyposOnNumericTokens whether to allow typos on numbers (\"numeric tokens\") in the query string + * + * @return self + */ + public function setAllowTyposOnNumericTokens($allowTyposOnNumericTokens) + { + $this->container['allowTyposOnNumericTokens'] = $allowTyposOnNumericTokens; + + return $this; + } + + /** + * Gets disableTypoToleranceOnAttributes + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnAttributes() + { + return $this->container['disableTypoToleranceOnAttributes'] ?? null; + } + + /** + * Sets disableTypoToleranceOnAttributes + * + * @param string[]|null $disableTypoToleranceOnAttributes list of attributes on which you want to disable typo tolerance + * + * @return self + */ + public function setDisableTypoToleranceOnAttributes($disableTypoToleranceOnAttributes) + { + $this->container['disableTypoToleranceOnAttributes'] = $disableTypoToleranceOnAttributes; + + return $this; + } + + /** + * Gets separatorsToIndex + * + * @return string|null + */ + public function getSeparatorsToIndex() + { + return $this->container['separatorsToIndex'] ?? null; + } + + /** + * Sets separatorsToIndex + * + * @param string|null $separatorsToIndex control which separators are indexed + * + * @return self + */ + public function setSeparatorsToIndex($separatorsToIndex) + { + $this->container['separatorsToIndex'] = $separatorsToIndex; + + return $this; + } + + /** + * Gets ignorePlurals + * + * @return string|null + */ + public function getIgnorePlurals() + { + return $this->container['ignorePlurals'] ?? null; + } + + /** + * Sets ignorePlurals + * + * @param string|null $ignorePlurals treats singular, plurals, and other forms of declensions as matching terms + * + * @return self + */ + public function setIgnorePlurals($ignorePlurals) + { + $this->container['ignorePlurals'] = $ignorePlurals; + + return $this; + } + + /** + * Gets removeStopWords + * + * @return string|null + */ + public function getRemoveStopWords() + { + return $this->container['removeStopWords'] ?? null; + } + + /** + * Sets removeStopWords + * + * @param string|null $removeStopWords removes stop (common) words from the query before executing it + * + * @return self + */ + public function setRemoveStopWords($removeStopWords) + { + $this->container['removeStopWords'] = $removeStopWords; + + return $this; + } + + /** + * Gets keepDiacriticsOnCharacters + * + * @return string|null + */ + public function getKeepDiacriticsOnCharacters() + { + return $this->container['keepDiacriticsOnCharacters'] ?? null; + } + + /** + * Sets keepDiacriticsOnCharacters + * + * @param string|null $keepDiacriticsOnCharacters list of characters that the engine shouldn't automatically normalize + * + * @return self + */ + public function setKeepDiacriticsOnCharacters($keepDiacriticsOnCharacters) + { + $this->container['keepDiacriticsOnCharacters'] = $keepDiacriticsOnCharacters; + + return $this; + } + + /** + * Gets queryLanguages + * + * @return string[]|null + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages'] ?? null; + } + + /** + * Sets queryLanguages + * + * @param string[]|null $queryLanguages sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets decompoundQuery + * + * @return bool|null + */ + public function getDecompoundQuery() + { + return $this->container['decompoundQuery'] ?? null; + } + + /** + * Sets decompoundQuery + * + * @param bool|null $decompoundQuery splits compound words into their composing atoms in the query + * + * @return self + */ + public function setDecompoundQuery($decompoundQuery) + { + $this->container['decompoundQuery'] = $decompoundQuery; + + return $this; + } + + /** + * Gets enableRules + * + * @return bool|null + */ + public function getEnableRules() + { + return $this->container['enableRules'] ?? null; + } + + /** + * Sets enableRules + * + * @param bool|null $enableRules whether Rules should be globally enabled + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets enablePersonalization + * + * @return bool|null + */ + public function getEnablePersonalization() + { + return $this->container['enablePersonalization'] ?? null; + } + + /** + * Sets enablePersonalization + * + * @param bool|null $enablePersonalization enable the Personalization feature + * + * @return self + */ + public function setEnablePersonalization($enablePersonalization) + { + $this->container['enablePersonalization'] = $enablePersonalization; + + return $this; + } + + /** + * Gets queryType + * + * @return string|null + */ + public function getQueryType() + { + return $this->container['queryType'] ?? null; + } + + /** + * Sets queryType + * + * @param string|null $queryType controls if and how query words are interpreted as prefixes + * + * @return self + */ + public function setQueryType($queryType) + { + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($queryType) && !in_array($queryType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'queryType', must be one of '%s'", + $queryType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['queryType'] = $queryType; + + return $this; + } + + /** + * Gets removeWordsIfNoResults + * + * @return string|null + */ + public function getRemoveWordsIfNoResults() + { + return $this->container['removeWordsIfNoResults'] ?? null; + } + + /** + * Sets removeWordsIfNoResults + * + * @param string|null $removeWordsIfNoResults selects a strategy to remove words from the query when it doesn't match any hits + * + * @return self + */ + public function setRemoveWordsIfNoResults($removeWordsIfNoResults) + { + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($removeWordsIfNoResults) && !in_array($removeWordsIfNoResults, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $removeWordsIfNoResults, + implode("', '", $allowedValues) + ) + ); + } + $this->container['removeWordsIfNoResults'] = $removeWordsIfNoResults; + + return $this; + } + + /** + * Gets advancedSyntax + * + * @return bool|null + */ + public function getAdvancedSyntax() + { + return $this->container['advancedSyntax'] ?? null; + } + + /** + * Sets advancedSyntax + * + * @param bool|null $advancedSyntax enables the advanced query syntax + * + * @return self + */ + public function setAdvancedSyntax($advancedSyntax) + { + $this->container['advancedSyntax'] = $advancedSyntax; + + return $this; + } + + /** + * Gets optionalWords + * + * @return string[]|null + */ + public function getOptionalWords() + { + return $this->container['optionalWords'] ?? null; + } + + /** + * Sets optionalWords + * + * @param string[]|null $optionalWords a list of words that should be considered as optional when found in the query + * + * @return self + */ + public function setOptionalWords($optionalWords) + { + $this->container['optionalWords'] = $optionalWords; + + return $this; + } + + /** + * Gets disableExactOnAttributes + * + * @return string[]|null + */ + public function getDisableExactOnAttributes() + { + return $this->container['disableExactOnAttributes'] ?? null; + } + + /** + * Sets disableExactOnAttributes + * + * @param string[]|null $disableExactOnAttributes list of attributes on which you want to disable the exact ranking criterion + * + * @return self + */ + public function setDisableExactOnAttributes($disableExactOnAttributes) + { + $this->container['disableExactOnAttributes'] = $disableExactOnAttributes; + + return $this; + } + + /** + * Gets exactOnSingleWordQuery + * + * @return string|null + */ + public function getExactOnSingleWordQuery() + { + return $this->container['exactOnSingleWordQuery'] ?? null; + } + + /** + * Sets exactOnSingleWordQuery + * + * @param string|null $exactOnSingleWordQuery controls how the exact ranking criterion is computed when the query contains only one word + * + * @return self + */ + public function setExactOnSingleWordQuery($exactOnSingleWordQuery) + { + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($exactOnSingleWordQuery) && !in_array($exactOnSingleWordQuery, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $exactOnSingleWordQuery, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exactOnSingleWordQuery'] = $exactOnSingleWordQuery; + + return $this; + } + + /** + * Gets alternativesAsExact + * + * @return string[]|null + */ + public function getAlternativesAsExact() + { + return $this->container['alternativesAsExact'] ?? null; + } + + /** + * Sets alternativesAsExact + * + * @param string[]|null $alternativesAsExact list of alternatives that should be considered an exact match by the exact ranking criterion + * + * @return self + */ + public function setAlternativesAsExact($alternativesAsExact) + { + $allowedValues = $this->getAlternativesAsExactAllowableValues(); + if (!is_null($alternativesAsExact) && array_diff($alternativesAsExact, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'alternativesAsExact', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['alternativesAsExact'] = $alternativesAsExact; + + return $this; + } + + /** + * Gets advancedSyntaxFeatures + * + * @return string[]|null + */ + public function getAdvancedSyntaxFeatures() + { + return $this->container['advancedSyntaxFeatures'] ?? null; + } + + /** + * Sets advancedSyntaxFeatures + * + * @param string[]|null $advancedSyntaxFeatures allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled + * + * @return self + */ + public function setAdvancedSyntaxFeatures($advancedSyntaxFeatures) + { + $allowedValues = $this->getAdvancedSyntaxFeaturesAllowableValues(); + if (!is_null($advancedSyntaxFeatures) && array_diff($advancedSyntaxFeatures, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'advancedSyntaxFeatures', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['advancedSyntaxFeatures'] = $advancedSyntaxFeatures; + + return $this; + } + + /** + * Gets distinct + * + * @return int|null + */ + public function getDistinct() + { + return $this->container['distinct'] ?? null; + } + + /** + * Sets distinct + * + * @param int|null $distinct enables de-duplication or grouping of results + * + * @return self + */ + public function setDistinct($distinct) + { + if (!is_null($distinct) && ($distinct > 4)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling IndexSettings., must be smaller than or equal to 4.'); + } + if (!is_null($distinct) && ($distinct < 0)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling IndexSettings., must be bigger than or equal to 0.'); + } + + $this->container['distinct'] = $distinct; + + return $this; + } + + /** + * Gets synonyms + * + * @return bool|null + */ + public function getSynonyms() + { + return $this->container['synonyms'] ?? null; + } + + /** + * Sets synonyms + * + * @param bool|null $synonyms whether to take into account an index's synonyms for a particular search + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets replaceSynonymsInHighlight + * + * @return bool|null + */ + public function getReplaceSynonymsInHighlight() + { + return $this->container['replaceSynonymsInHighlight'] ?? null; + } + + /** + * Sets replaceSynonymsInHighlight + * + * @param bool|null $replaceSynonymsInHighlight whether to highlight and snippet the original word that matches the synonym or the synonym itself + * + * @return self + */ + public function setReplaceSynonymsInHighlight($replaceSynonymsInHighlight) + { + $this->container['replaceSynonymsInHighlight'] = $replaceSynonymsInHighlight; + + return $this; + } + + /** + * Gets minProximity + * + * @return int|null + */ + public function getMinProximity() + { + return $this->container['minProximity'] ?? null; + } + + /** + * Sets minProximity + * + * @param int|null $minProximity precision of the proximity ranking criterion + * + * @return self + */ + public function setMinProximity($minProximity) + { + if (!is_null($minProximity) && ($minProximity > 7)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling IndexSettings., must be smaller than or equal to 7.'); + } + if (!is_null($minProximity) && ($minProximity < 1)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling IndexSettings., must be bigger than or equal to 1.'); + } + + $this->container['minProximity'] = $minProximity; + + return $this; + } + + /** + * Gets responseFields + * + * @return string[]|null + */ + public function getResponseFields() + { + return $this->container['responseFields'] ?? null; + } + + /** + * Sets responseFields + * + * @param string[]|null $responseFields Choose which fields to return in the API response. This parameters applies to search and browse queries. + * + * @return self + */ + public function setResponseFields($responseFields) + { + $this->container['responseFields'] = $responseFields; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling IndexSettings., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets attributeCriteriaComputedByMinProximity + * + * @return bool|null + */ + public function getAttributeCriteriaComputedByMinProximity() + { + return $this->container['attributeCriteriaComputedByMinProximity'] ?? null; + } + + /** + * Sets attributeCriteriaComputedByMinProximity + * + * @param bool|null $attributeCriteriaComputedByMinProximity when attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage + * + * @return self + */ + public function setAttributeCriteriaComputedByMinProximity($attributeCriteriaComputedByMinProximity) + { + $this->container['attributeCriteriaComputedByMinProximity'] = $attributeCriteriaComputedByMinProximity; + + return $this; + } + + /** + * Gets renderingContent + * + * @return object|null + */ + public function getRenderingContent() + { + return $this->container['renderingContent'] ?? null; + } + + /** + * Sets renderingContent + * + * @param object|null $renderingContent Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/IndexSettingsAsSearchParams.php b/clients/algoliasearch-client-php/lib/Model/Search/IndexSettingsAsSearchParams.php new file mode 100644 index 0000000000..8e2e8ff2a2 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/IndexSettingsAsSearchParams.php @@ -0,0 +1,1777 @@ + 'string[]', + 'attributesForFaceting' => 'string[]', + 'unretrievableAttributes' => 'string[]', + 'attributesToRetrieve' => 'string[]', + 'restrictSearchableAttributes' => 'string[]', + 'ranking' => 'string[]', + 'customRanking' => 'string[]', + 'relevancyStrictness' => 'int', + 'attributesToHighlight' => 'string[]', + 'attributesToSnippet' => 'string[]', + 'highlightPreTag' => 'string', + 'highlightPostTag' => 'string', + 'snippetEllipsisText' => 'string', + 'restrictHighlightAndSnippetArrays' => 'bool', + 'hitsPerPage' => 'int', + 'minWordSizefor1Typo' => 'int', + 'minWordSizefor2Typos' => 'int', + 'typoTolerance' => 'string', + 'allowTyposOnNumericTokens' => 'bool', + 'disableTypoToleranceOnAttributes' => 'string[]', + 'separatorsToIndex' => 'string', + 'ignorePlurals' => 'string', + 'removeStopWords' => 'string', + 'keepDiacriticsOnCharacters' => 'string', + 'queryLanguages' => 'string[]', + 'decompoundQuery' => 'bool', + 'enableRules' => 'bool', + 'enablePersonalization' => 'bool', + 'queryType' => 'string', + 'removeWordsIfNoResults' => 'string', + 'advancedSyntax' => 'bool', + 'optionalWords' => 'string[]', + 'disableExactOnAttributes' => 'string[]', + 'exactOnSingleWordQuery' => 'string', + 'alternativesAsExact' => 'string[]', + 'advancedSyntaxFeatures' => 'string[]', + 'distinct' => 'int', + 'synonyms' => 'bool', + 'replaceSynonymsInHighlight' => 'bool', + 'minProximity' => 'int', + 'responseFields' => 'string[]', + 'maxFacetHits' => 'int', + 'attributeCriteriaComputedByMinProximity' => 'bool', + 'renderingContent' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'searchableAttributes' => null, + 'attributesForFaceting' => null, + 'unretrievableAttributes' => null, + 'attributesToRetrieve' => null, + 'restrictSearchableAttributes' => null, + 'ranking' => null, + 'customRanking' => null, + 'relevancyStrictness' => null, + 'attributesToHighlight' => null, + 'attributesToSnippet' => null, + 'highlightPreTag' => null, + 'highlightPostTag' => null, + 'snippetEllipsisText' => null, + 'restrictHighlightAndSnippetArrays' => null, + 'hitsPerPage' => null, + 'minWordSizefor1Typo' => null, + 'minWordSizefor2Typos' => null, + 'typoTolerance' => null, + 'allowTyposOnNumericTokens' => null, + 'disableTypoToleranceOnAttributes' => null, + 'separatorsToIndex' => null, + 'ignorePlurals' => null, + 'removeStopWords' => null, + 'keepDiacriticsOnCharacters' => null, + 'queryLanguages' => null, + 'decompoundQuery' => null, + 'enableRules' => null, + 'enablePersonalization' => null, + 'queryType' => null, + 'removeWordsIfNoResults' => null, + 'advancedSyntax' => null, + 'optionalWords' => null, + 'disableExactOnAttributes' => null, + 'exactOnSingleWordQuery' => null, + 'alternativesAsExact' => null, + 'advancedSyntaxFeatures' => null, + 'distinct' => null, + 'synonyms' => null, + 'replaceSynonymsInHighlight' => null, + 'minProximity' => null, + 'responseFields' => null, + 'maxFacetHits' => null, + 'attributeCriteriaComputedByMinProximity' => null, + 'renderingContent' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'searchableAttributes' => 'setSearchableAttributes', + 'attributesForFaceting' => 'setAttributesForFaceting', + 'unretrievableAttributes' => 'setUnretrievableAttributes', + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'restrictSearchableAttributes' => 'setRestrictSearchableAttributes', + 'ranking' => 'setRanking', + 'customRanking' => 'setCustomRanking', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'attributesToHighlight' => 'setAttributesToHighlight', + 'attributesToSnippet' => 'setAttributesToSnippet', + 'highlightPreTag' => 'setHighlightPreTag', + 'highlightPostTag' => 'setHighlightPostTag', + 'snippetEllipsisText' => 'setSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'setRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'setHitsPerPage', + 'minWordSizefor1Typo' => 'setMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'setMinWordSizefor2Typos', + 'typoTolerance' => 'setTypoTolerance', + 'allowTyposOnNumericTokens' => 'setAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'setDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'setSeparatorsToIndex', + 'ignorePlurals' => 'setIgnorePlurals', + 'removeStopWords' => 'setRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'setKeepDiacriticsOnCharacters', + 'queryLanguages' => 'setQueryLanguages', + 'decompoundQuery' => 'setDecompoundQuery', + 'enableRules' => 'setEnableRules', + 'enablePersonalization' => 'setEnablePersonalization', + 'queryType' => 'setQueryType', + 'removeWordsIfNoResults' => 'setRemoveWordsIfNoResults', + 'advancedSyntax' => 'setAdvancedSyntax', + 'optionalWords' => 'setOptionalWords', + 'disableExactOnAttributes' => 'setDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'setExactOnSingleWordQuery', + 'alternativesAsExact' => 'setAlternativesAsExact', + 'advancedSyntaxFeatures' => 'setAdvancedSyntaxFeatures', + 'distinct' => 'setDistinct', + 'synonyms' => 'setSynonyms', + 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', + 'minProximity' => 'setMinProximity', + 'responseFields' => 'setResponseFields', + 'maxFacetHits' => 'setMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'setRenderingContent', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'searchableAttributes' => 'getSearchableAttributes', + 'attributesForFaceting' => 'getAttributesForFaceting', + 'unretrievableAttributes' => 'getUnretrievableAttributes', + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'restrictSearchableAttributes' => 'getRestrictSearchableAttributes', + 'ranking' => 'getRanking', + 'customRanking' => 'getCustomRanking', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'attributesToHighlight' => 'getAttributesToHighlight', + 'attributesToSnippet' => 'getAttributesToSnippet', + 'highlightPreTag' => 'getHighlightPreTag', + 'highlightPostTag' => 'getHighlightPostTag', + 'snippetEllipsisText' => 'getSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'getRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'getHitsPerPage', + 'minWordSizefor1Typo' => 'getMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'getMinWordSizefor2Typos', + 'typoTolerance' => 'getTypoTolerance', + 'allowTyposOnNumericTokens' => 'getAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'getDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'getSeparatorsToIndex', + 'ignorePlurals' => 'getIgnorePlurals', + 'removeStopWords' => 'getRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'getKeepDiacriticsOnCharacters', + 'queryLanguages' => 'getQueryLanguages', + 'decompoundQuery' => 'getDecompoundQuery', + 'enableRules' => 'getEnableRules', + 'enablePersonalization' => 'getEnablePersonalization', + 'queryType' => 'getQueryType', + 'removeWordsIfNoResults' => 'getRemoveWordsIfNoResults', + 'advancedSyntax' => 'getAdvancedSyntax', + 'optionalWords' => 'getOptionalWords', + 'disableExactOnAttributes' => 'getDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'getExactOnSingleWordQuery', + 'alternativesAsExact' => 'getAlternativesAsExact', + 'advancedSyntaxFeatures' => 'getAdvancedSyntaxFeatures', + 'distinct' => 'getDistinct', + 'synonyms' => 'getSynonyms', + 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', + 'minProximity' => 'getMinProximity', + 'responseFields' => 'getResponseFields', + 'maxFacetHits' => 'getMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'getRenderingContent', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + const TYPO_TOLERANCE_TRUE = 'true'; + const TYPO_TOLERANCE_FALSE = 'false'; + const TYPO_TOLERANCE_MIN = 'min'; + const TYPO_TOLERANCE_STRICT = 'strict'; + const QUERY_TYPE_PREFIX_LAST = 'prefixLast'; + const QUERY_TYPE_PREFIX_ALL = 'prefixAll'; + const QUERY_TYPE_PREFIX_NONE = 'prefixNone'; + const REMOVE_WORDS_IF_NO_RESULTS_NONE = 'none'; + const REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS = 'lastWords'; + const REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS = 'firstWords'; + const REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL = 'allOptional'; + const EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE = 'attribute'; + const EXACT_ON_SINGLE_WORD_QUERY_NONE = 'none'; + const EXACT_ON_SINGLE_WORD_QUERY_WORD = 'word'; + const ALTERNATIVES_AS_EXACT_IGNORE_PLURALS = 'ignorePlurals'; + const ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM = 'singleWordSynonym'; + const ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM = 'multiWordsSynonym'; + const ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE = 'exactPhrase'; + const ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS = 'excludeWords'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypoToleranceAllowableValues() + { + return [ + self::TYPO_TOLERANCE_TRUE, + self::TYPO_TOLERANCE_FALSE, + self::TYPO_TOLERANCE_MIN, + self::TYPO_TOLERANCE_STRICT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getQueryTypeAllowableValues() + { + return [ + self::QUERY_TYPE_PREFIX_LAST, + self::QUERY_TYPE_PREFIX_ALL, + self::QUERY_TYPE_PREFIX_NONE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemoveWordsIfNoResultsAllowableValues() + { + return [ + self::REMOVE_WORDS_IF_NO_RESULTS_NONE, + self::REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExactOnSingleWordQueryAllowableValues() + { + return [ + self::EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE, + self::EXACT_ON_SINGLE_WORD_QUERY_NONE, + self::EXACT_ON_SINGLE_WORD_QUERY_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAlternativesAsExactAllowableValues() + { + return [ + self::ALTERNATIVES_AS_EXACT_IGNORE_PLURALS, + self::ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM, + self::ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdvancedSyntaxFeaturesAllowableValues() + { + return [ + self::ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE, + self::ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['searchableAttributes'])) { + $this->container['searchableAttributes'] = $data['searchableAttributes']; + } + if (isset($data['attributesForFaceting'])) { + $this->container['attributesForFaceting'] = $data['attributesForFaceting']; + } + if (isset($data['unretrievableAttributes'])) { + $this->container['unretrievableAttributes'] = $data['unretrievableAttributes']; + } + if (isset($data['attributesToRetrieve'])) { + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; + } + if (isset($data['restrictSearchableAttributes'])) { + $this->container['restrictSearchableAttributes'] = $data['restrictSearchableAttributes']; + } + if (isset($data['ranking'])) { + $this->container['ranking'] = $data['ranking']; + } + if (isset($data['customRanking'])) { + $this->container['customRanking'] = $data['customRanking']; + } + if (isset($data['relevancyStrictness'])) { + $this->container['relevancyStrictness'] = $data['relevancyStrictness']; + } + if (isset($data['attributesToHighlight'])) { + $this->container['attributesToHighlight'] = $data['attributesToHighlight']; + } + if (isset($data['attributesToSnippet'])) { + $this->container['attributesToSnippet'] = $data['attributesToSnippet']; + } + if (isset($data['highlightPreTag'])) { + $this->container['highlightPreTag'] = $data['highlightPreTag']; + } + if (isset($data['highlightPostTag'])) { + $this->container['highlightPostTag'] = $data['highlightPostTag']; + } + if (isset($data['snippetEllipsisText'])) { + $this->container['snippetEllipsisText'] = $data['snippetEllipsisText']; + } + if (isset($data['restrictHighlightAndSnippetArrays'])) { + $this->container['restrictHighlightAndSnippetArrays'] = $data['restrictHighlightAndSnippetArrays']; + } + if (isset($data['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + if (isset($data['minWordSizefor1Typo'])) { + $this->container['minWordSizefor1Typo'] = $data['minWordSizefor1Typo']; + } + if (isset($data['minWordSizefor2Typos'])) { + $this->container['minWordSizefor2Typos'] = $data['minWordSizefor2Typos']; + } + if (isset($data['typoTolerance'])) { + $this->container['typoTolerance'] = $data['typoTolerance']; + } + if (isset($data['allowTyposOnNumericTokens'])) { + $this->container['allowTyposOnNumericTokens'] = $data['allowTyposOnNumericTokens']; + } + if (isset($data['disableTypoToleranceOnAttributes'])) { + $this->container['disableTypoToleranceOnAttributes'] = $data['disableTypoToleranceOnAttributes']; + } + if (isset($data['separatorsToIndex'])) { + $this->container['separatorsToIndex'] = $data['separatorsToIndex']; + } + if (isset($data['ignorePlurals'])) { + $this->container['ignorePlurals'] = $data['ignorePlurals']; + } + if (isset($data['removeStopWords'])) { + $this->container['removeStopWords'] = $data['removeStopWords']; + } + if (isset($data['keepDiacriticsOnCharacters'])) { + $this->container['keepDiacriticsOnCharacters'] = $data['keepDiacriticsOnCharacters']; + } + if (isset($data['queryLanguages'])) { + $this->container['queryLanguages'] = $data['queryLanguages']; + } + if (isset($data['decompoundQuery'])) { + $this->container['decompoundQuery'] = $data['decompoundQuery']; + } + if (isset($data['enableRules'])) { + $this->container['enableRules'] = $data['enableRules']; + } + if (isset($data['enablePersonalization'])) { + $this->container['enablePersonalization'] = $data['enablePersonalization']; + } + if (isset($data['queryType'])) { + $this->container['queryType'] = $data['queryType']; + } + if (isset($data['removeWordsIfNoResults'])) { + $this->container['removeWordsIfNoResults'] = $data['removeWordsIfNoResults']; + } + if (isset($data['advancedSyntax'])) { + $this->container['advancedSyntax'] = $data['advancedSyntax']; + } + if (isset($data['optionalWords'])) { + $this->container['optionalWords'] = $data['optionalWords']; + } + if (isset($data['disableExactOnAttributes'])) { + $this->container['disableExactOnAttributes'] = $data['disableExactOnAttributes']; + } + if (isset($data['exactOnSingleWordQuery'])) { + $this->container['exactOnSingleWordQuery'] = $data['exactOnSingleWordQuery']; + } + if (isset($data['alternativesAsExact'])) { + $this->container['alternativesAsExact'] = $data['alternativesAsExact']; + } + if (isset($data['advancedSyntaxFeatures'])) { + $this->container['advancedSyntaxFeatures'] = $data['advancedSyntaxFeatures']; + } + if (isset($data['distinct'])) { + $this->container['distinct'] = $data['distinct']; + } + if (isset($data['synonyms'])) { + $this->container['synonyms'] = $data['synonyms']; + } + if (isset($data['replaceSynonymsInHighlight'])) { + $this->container['replaceSynonymsInHighlight'] = $data['replaceSynonymsInHighlight']; + } + if (isset($data['minProximity'])) { + $this->container['minProximity'] = $data['minProximity']; + } + if (isset($data['responseFields'])) { + $this->container['responseFields'] = $data['responseFields']; + } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } + if (isset($data['attributeCriteriaComputedByMinProximity'])) { + $this->container['attributeCriteriaComputedByMinProximity'] = $data['attributeCriteriaComputedByMinProximity']; + } + if (isset($data['renderingContent'])) { + $this->container['renderingContent'] = $data['renderingContent']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (isset($this->container['typoTolerance']) && !in_array($this->container['typoTolerance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'typoTolerance', must be one of '%s'", + $this->container['typoTolerance'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getQueryTypeAllowableValues(); + if (isset($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'queryType', must be one of '%s'", + $this->container['queryType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (isset($this->container['removeWordsIfNoResults']) && !in_array($this->container['removeWordsIfNoResults'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $this->container['removeWordsIfNoResults'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (isset($this->container['exactOnSingleWordQuery']) && !in_array($this->container['exactOnSingleWordQuery'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $this->container['exactOnSingleWordQuery'], + implode("', '", $allowedValues) + ); + } + + if (isset($this->container['distinct']) && ($this->container['distinct'] > 4)) { + $invalidProperties[] = "invalid value for 'distinct', must be smaller than or equal to 4."; + } + + if (isset($this->container['distinct']) && ($this->container['distinct'] < 0)) { + $invalidProperties[] = "invalid value for 'distinct', must be bigger than or equal to 0."; + } + + if (isset($this->container['minProximity']) && ($this->container['minProximity'] > 7)) { + $invalidProperties[] = "invalid value for 'minProximity', must be smaller than or equal to 7."; + } + + if (isset($this->container['minProximity']) && ($this->container['minProximity'] < 1)) { + $invalidProperties[] = "invalid value for 'minProximity', must be bigger than or equal to 1."; + } + + if (isset($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets searchableAttributes + * + * @return string[]|null + */ + public function getSearchableAttributes() + { + return $this->container['searchableAttributes'] ?? null; + } + + /** + * Sets searchableAttributes + * + * @param string[]|null $searchableAttributes the complete list of attributes used for searching + * + * @return self + */ + public function setSearchableAttributes($searchableAttributes) + { + $this->container['searchableAttributes'] = $searchableAttributes; + + return $this; + } + + /** + * Gets attributesForFaceting + * + * @return string[]|null + */ + public function getAttributesForFaceting() + { + return $this->container['attributesForFaceting'] ?? null; + } + + /** + * Sets attributesForFaceting + * + * @param string[]|null $attributesForFaceting the complete list of attributes that will be used for faceting + * + * @return self + */ + public function setAttributesForFaceting($attributesForFaceting) + { + $this->container['attributesForFaceting'] = $attributesForFaceting; + + return $this; + } + + /** + * Gets unretrievableAttributes + * + * @return string[]|null + */ + public function getUnretrievableAttributes() + { + return $this->container['unretrievableAttributes'] ?? null; + } + + /** + * Sets unretrievableAttributes + * + * @param string[]|null $unretrievableAttributes list of attributes that can't be retrieved at query time + * + * @return self + */ + public function setUnretrievableAttributes($unretrievableAttributes) + { + $this->container['unretrievableAttributes'] = $unretrievableAttributes; + + return $this; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve'] ?? null; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve this parameter controls which attributes to retrieve and which not to retrieve + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets restrictSearchableAttributes + * + * @return string[]|null + */ + public function getRestrictSearchableAttributes() + { + return $this->container['restrictSearchableAttributes'] ?? null; + } + + /** + * Sets restrictSearchableAttributes + * + * @param string[]|null $restrictSearchableAttributes restricts a given query to look in only a subset of your searchable attributes + * + * @return self + */ + public function setRestrictSearchableAttributes($restrictSearchableAttributes) + { + $this->container['restrictSearchableAttributes'] = $restrictSearchableAttributes; + + return $this; + } + + /** + * Gets ranking + * + * @return string[]|null + */ + public function getRanking() + { + return $this->container['ranking'] ?? null; + } + + /** + * Sets ranking + * + * @param string[]|null $ranking controls how Algolia should sort your results + * + * @return self + */ + public function setRanking($ranking) + { + $this->container['ranking'] = $ranking; + + return $this; + } + + /** + * Gets customRanking + * + * @return string[]|null + */ + public function getCustomRanking() + { + return $this->container['customRanking'] ?? null; + } + + /** + * Sets customRanking + * + * @param string[]|null $customRanking specifies the custom ranking criterion + * + * @return self + */ + public function setCustomRanking($customRanking) + { + $this->container['customRanking'] = $customRanking; + + return $this; + } + + /** + * Gets relevancyStrictness + * + * @return int|null + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness'] ?? null; + } + + /** + * Sets relevancyStrictness + * + * @param int|null $relevancyStrictness controls the relevancy threshold below which less relevant results aren't included in the results + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets attributesToHighlight + * + * @return string[]|null + */ + public function getAttributesToHighlight() + { + return $this->container['attributesToHighlight'] ?? null; + } + + /** + * Sets attributesToHighlight + * + * @param string[]|null $attributesToHighlight list of attributes to highlight + * + * @return self + */ + public function setAttributesToHighlight($attributesToHighlight) + { + $this->container['attributesToHighlight'] = $attributesToHighlight; + + return $this; + } + + /** + * Gets attributesToSnippet + * + * @return string[]|null + */ + public function getAttributesToSnippet() + { + return $this->container['attributesToSnippet'] ?? null; + } + + /** + * Sets attributesToSnippet + * + * @param string[]|null $attributesToSnippet list of attributes to snippet, with an optional maximum number of words to snippet + * + * @return self + */ + public function setAttributesToSnippet($attributesToSnippet) + { + $this->container['attributesToSnippet'] = $attributesToSnippet; + + return $this; + } + + /** + * Gets highlightPreTag + * + * @return string|null + */ + public function getHighlightPreTag() + { + return $this->container['highlightPreTag'] ?? null; + } + + /** + * Sets highlightPreTag + * + * @param string|null $highlightPreTag the HTML string to insert before the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPreTag($highlightPreTag) + { + $this->container['highlightPreTag'] = $highlightPreTag; + + return $this; + } + + /** + * Gets highlightPostTag + * + * @return string|null + */ + public function getHighlightPostTag() + { + return $this->container['highlightPostTag'] ?? null; + } + + /** + * Sets highlightPostTag + * + * @param string|null $highlightPostTag the HTML string to insert after the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPostTag($highlightPostTag) + { + $this->container['highlightPostTag'] = $highlightPostTag; + + return $this; + } + + /** + * Gets snippetEllipsisText + * + * @return string|null + */ + public function getSnippetEllipsisText() + { + return $this->container['snippetEllipsisText'] ?? null; + } + + /** + * Sets snippetEllipsisText + * + * @param string|null $snippetEllipsisText string used as an ellipsis indicator when a snippet is truncated + * + * @return self + */ + public function setSnippetEllipsisText($snippetEllipsisText) + { + $this->container['snippetEllipsisText'] = $snippetEllipsisText; + + return $this; + } + + /** + * Gets restrictHighlightAndSnippetArrays + * + * @return bool|null + */ + public function getRestrictHighlightAndSnippetArrays() + { + return $this->container['restrictHighlightAndSnippetArrays'] ?? null; + } + + /** + * Sets restrictHighlightAndSnippetArrays + * + * @param bool|null $restrictHighlightAndSnippetArrays restrict highlighting and snippeting to items that matched the query + * + * @return self + */ + public function setRestrictHighlightAndSnippetArrays($restrictHighlightAndSnippetArrays) + { + $this->container['restrictHighlightAndSnippetArrays'] = $restrictHighlightAndSnippetArrays; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets minWordSizefor1Typo + * + * @return int|null + */ + public function getMinWordSizefor1Typo() + { + return $this->container['minWordSizefor1Typo'] ?? null; + } + + /** + * Sets minWordSizefor1Typo + * + * @param int|null $minWordSizefor1Typo minimum number of characters a word in the query string must contain to accept matches with 1 typo + * + * @return self + */ + public function setMinWordSizefor1Typo($minWordSizefor1Typo) + { + $this->container['minWordSizefor1Typo'] = $minWordSizefor1Typo; + + return $this; + } + + /** + * Gets minWordSizefor2Typos + * + * @return int|null + */ + public function getMinWordSizefor2Typos() + { + return $this->container['minWordSizefor2Typos'] ?? null; + } + + /** + * Sets minWordSizefor2Typos + * + * @param int|null $minWordSizefor2Typos minimum number of characters a word in the query string must contain to accept matches with 2 typos + * + * @return self + */ + public function setMinWordSizefor2Typos($minWordSizefor2Typos) + { + $this->container['minWordSizefor2Typos'] = $minWordSizefor2Typos; + + return $this; + } + + /** + * Gets typoTolerance + * + * @return string|null + */ + public function getTypoTolerance() + { + return $this->container['typoTolerance'] ?? null; + } + + /** + * Sets typoTolerance + * + * @param string|null $typoTolerance controls whether typo tolerance is enabled and how it is applied + * + * @return self + */ + public function setTypoTolerance($typoTolerance) + { + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($typoTolerance) && !in_array($typoTolerance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'typoTolerance', must be one of '%s'", + $typoTolerance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['typoTolerance'] = $typoTolerance; + + return $this; + } + + /** + * Gets allowTyposOnNumericTokens + * + * @return bool|null + */ + public function getAllowTyposOnNumericTokens() + { + return $this->container['allowTyposOnNumericTokens'] ?? null; + } + + /** + * Sets allowTyposOnNumericTokens + * + * @param bool|null $allowTyposOnNumericTokens whether to allow typos on numbers (\"numeric tokens\") in the query string + * + * @return self + */ + public function setAllowTyposOnNumericTokens($allowTyposOnNumericTokens) + { + $this->container['allowTyposOnNumericTokens'] = $allowTyposOnNumericTokens; + + return $this; + } + + /** + * Gets disableTypoToleranceOnAttributes + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnAttributes() + { + return $this->container['disableTypoToleranceOnAttributes'] ?? null; + } + + /** + * Sets disableTypoToleranceOnAttributes + * + * @param string[]|null $disableTypoToleranceOnAttributes list of attributes on which you want to disable typo tolerance + * + * @return self + */ + public function setDisableTypoToleranceOnAttributes($disableTypoToleranceOnAttributes) + { + $this->container['disableTypoToleranceOnAttributes'] = $disableTypoToleranceOnAttributes; + + return $this; + } + + /** + * Gets separatorsToIndex + * + * @return string|null + */ + public function getSeparatorsToIndex() + { + return $this->container['separatorsToIndex'] ?? null; + } + + /** + * Sets separatorsToIndex + * + * @param string|null $separatorsToIndex control which separators are indexed + * + * @return self + */ + public function setSeparatorsToIndex($separatorsToIndex) + { + $this->container['separatorsToIndex'] = $separatorsToIndex; + + return $this; + } + + /** + * Gets ignorePlurals + * + * @return string|null + */ + public function getIgnorePlurals() + { + return $this->container['ignorePlurals'] ?? null; + } + + /** + * Sets ignorePlurals + * + * @param string|null $ignorePlurals treats singular, plurals, and other forms of declensions as matching terms + * + * @return self + */ + public function setIgnorePlurals($ignorePlurals) + { + $this->container['ignorePlurals'] = $ignorePlurals; + + return $this; + } + + /** + * Gets removeStopWords + * + * @return string|null + */ + public function getRemoveStopWords() + { + return $this->container['removeStopWords'] ?? null; + } + + /** + * Sets removeStopWords + * + * @param string|null $removeStopWords removes stop (common) words from the query before executing it + * + * @return self + */ + public function setRemoveStopWords($removeStopWords) + { + $this->container['removeStopWords'] = $removeStopWords; + + return $this; + } + + /** + * Gets keepDiacriticsOnCharacters + * + * @return string|null + */ + public function getKeepDiacriticsOnCharacters() + { + return $this->container['keepDiacriticsOnCharacters'] ?? null; + } + + /** + * Sets keepDiacriticsOnCharacters + * + * @param string|null $keepDiacriticsOnCharacters list of characters that the engine shouldn't automatically normalize + * + * @return self + */ + public function setKeepDiacriticsOnCharacters($keepDiacriticsOnCharacters) + { + $this->container['keepDiacriticsOnCharacters'] = $keepDiacriticsOnCharacters; + + return $this; + } + + /** + * Gets queryLanguages + * + * @return string[]|null + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages'] ?? null; + } + + /** + * Sets queryLanguages + * + * @param string[]|null $queryLanguages sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets decompoundQuery + * + * @return bool|null + */ + public function getDecompoundQuery() + { + return $this->container['decompoundQuery'] ?? null; + } + + /** + * Sets decompoundQuery + * + * @param bool|null $decompoundQuery splits compound words into their composing atoms in the query + * + * @return self + */ + public function setDecompoundQuery($decompoundQuery) + { + $this->container['decompoundQuery'] = $decompoundQuery; + + return $this; + } + + /** + * Gets enableRules + * + * @return bool|null + */ + public function getEnableRules() + { + return $this->container['enableRules'] ?? null; + } + + /** + * Sets enableRules + * + * @param bool|null $enableRules whether Rules should be globally enabled + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets enablePersonalization + * + * @return bool|null + */ + public function getEnablePersonalization() + { + return $this->container['enablePersonalization'] ?? null; + } + + /** + * Sets enablePersonalization + * + * @param bool|null $enablePersonalization enable the Personalization feature + * + * @return self + */ + public function setEnablePersonalization($enablePersonalization) + { + $this->container['enablePersonalization'] = $enablePersonalization; + + return $this; + } + + /** + * Gets queryType + * + * @return string|null + */ + public function getQueryType() + { + return $this->container['queryType'] ?? null; + } + + /** + * Sets queryType + * + * @param string|null $queryType controls if and how query words are interpreted as prefixes + * + * @return self + */ + public function setQueryType($queryType) + { + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($queryType) && !in_array($queryType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'queryType', must be one of '%s'", + $queryType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['queryType'] = $queryType; + + return $this; + } + + /** + * Gets removeWordsIfNoResults + * + * @return string|null + */ + public function getRemoveWordsIfNoResults() + { + return $this->container['removeWordsIfNoResults'] ?? null; + } + + /** + * Sets removeWordsIfNoResults + * + * @param string|null $removeWordsIfNoResults selects a strategy to remove words from the query when it doesn't match any hits + * + * @return self + */ + public function setRemoveWordsIfNoResults($removeWordsIfNoResults) + { + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($removeWordsIfNoResults) && !in_array($removeWordsIfNoResults, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $removeWordsIfNoResults, + implode("', '", $allowedValues) + ) + ); + } + $this->container['removeWordsIfNoResults'] = $removeWordsIfNoResults; + + return $this; + } + + /** + * Gets advancedSyntax + * + * @return bool|null + */ + public function getAdvancedSyntax() + { + return $this->container['advancedSyntax'] ?? null; + } + + /** + * Sets advancedSyntax + * + * @param bool|null $advancedSyntax enables the advanced query syntax + * + * @return self + */ + public function setAdvancedSyntax($advancedSyntax) + { + $this->container['advancedSyntax'] = $advancedSyntax; + + return $this; + } + + /** + * Gets optionalWords + * + * @return string[]|null + */ + public function getOptionalWords() + { + return $this->container['optionalWords'] ?? null; + } + + /** + * Sets optionalWords + * + * @param string[]|null $optionalWords a list of words that should be considered as optional when found in the query + * + * @return self + */ + public function setOptionalWords($optionalWords) + { + $this->container['optionalWords'] = $optionalWords; + + return $this; + } + + /** + * Gets disableExactOnAttributes + * + * @return string[]|null + */ + public function getDisableExactOnAttributes() + { + return $this->container['disableExactOnAttributes'] ?? null; + } + + /** + * Sets disableExactOnAttributes + * + * @param string[]|null $disableExactOnAttributes list of attributes on which you want to disable the exact ranking criterion + * + * @return self + */ + public function setDisableExactOnAttributes($disableExactOnAttributes) + { + $this->container['disableExactOnAttributes'] = $disableExactOnAttributes; + + return $this; + } + + /** + * Gets exactOnSingleWordQuery + * + * @return string|null + */ + public function getExactOnSingleWordQuery() + { + return $this->container['exactOnSingleWordQuery'] ?? null; + } + + /** + * Sets exactOnSingleWordQuery + * + * @param string|null $exactOnSingleWordQuery controls how the exact ranking criterion is computed when the query contains only one word + * + * @return self + */ + public function setExactOnSingleWordQuery($exactOnSingleWordQuery) + { + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($exactOnSingleWordQuery) && !in_array($exactOnSingleWordQuery, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $exactOnSingleWordQuery, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exactOnSingleWordQuery'] = $exactOnSingleWordQuery; + + return $this; + } + + /** + * Gets alternativesAsExact + * + * @return string[]|null + */ + public function getAlternativesAsExact() + { + return $this->container['alternativesAsExact'] ?? null; + } + + /** + * Sets alternativesAsExact + * + * @param string[]|null $alternativesAsExact list of alternatives that should be considered an exact match by the exact ranking criterion + * + * @return self + */ + public function setAlternativesAsExact($alternativesAsExact) + { + $allowedValues = $this->getAlternativesAsExactAllowableValues(); + if (!is_null($alternativesAsExact) && array_diff($alternativesAsExact, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'alternativesAsExact', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['alternativesAsExact'] = $alternativesAsExact; + + return $this; + } + + /** + * Gets advancedSyntaxFeatures + * + * @return string[]|null + */ + public function getAdvancedSyntaxFeatures() + { + return $this->container['advancedSyntaxFeatures'] ?? null; + } + + /** + * Sets advancedSyntaxFeatures + * + * @param string[]|null $advancedSyntaxFeatures allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled + * + * @return self + */ + public function setAdvancedSyntaxFeatures($advancedSyntaxFeatures) + { + $allowedValues = $this->getAdvancedSyntaxFeaturesAllowableValues(); + if (!is_null($advancedSyntaxFeatures) && array_diff($advancedSyntaxFeatures, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'advancedSyntaxFeatures', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['advancedSyntaxFeatures'] = $advancedSyntaxFeatures; + + return $this; + } + + /** + * Gets distinct + * + * @return int|null + */ + public function getDistinct() + { + return $this->container['distinct'] ?? null; + } + + /** + * Sets distinct + * + * @param int|null $distinct enables de-duplication or grouping of results + * + * @return self + */ + public function setDistinct($distinct) + { + if (!is_null($distinct) && ($distinct > 4)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling IndexSettingsAsSearchParams., must be smaller than or equal to 4.'); + } + if (!is_null($distinct) && ($distinct < 0)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling IndexSettingsAsSearchParams., must be bigger than or equal to 0.'); + } + + $this->container['distinct'] = $distinct; + + return $this; + } + + /** + * Gets synonyms + * + * @return bool|null + */ + public function getSynonyms() + { + return $this->container['synonyms'] ?? null; + } + + /** + * Sets synonyms + * + * @param bool|null $synonyms whether to take into account an index's synonyms for a particular search + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets replaceSynonymsInHighlight + * + * @return bool|null + */ + public function getReplaceSynonymsInHighlight() + { + return $this->container['replaceSynonymsInHighlight'] ?? null; + } + + /** + * Sets replaceSynonymsInHighlight + * + * @param bool|null $replaceSynonymsInHighlight whether to highlight and snippet the original word that matches the synonym or the synonym itself + * + * @return self + */ + public function setReplaceSynonymsInHighlight($replaceSynonymsInHighlight) + { + $this->container['replaceSynonymsInHighlight'] = $replaceSynonymsInHighlight; + + return $this; + } + + /** + * Gets minProximity + * + * @return int|null + */ + public function getMinProximity() + { + return $this->container['minProximity'] ?? null; + } + + /** + * Sets minProximity + * + * @param int|null $minProximity precision of the proximity ranking criterion + * + * @return self + */ + public function setMinProximity($minProximity) + { + if (!is_null($minProximity) && ($minProximity > 7)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling IndexSettingsAsSearchParams., must be smaller than or equal to 7.'); + } + if (!is_null($minProximity) && ($minProximity < 1)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling IndexSettingsAsSearchParams., must be bigger than or equal to 1.'); + } + + $this->container['minProximity'] = $minProximity; + + return $this; + } + + /** + * Gets responseFields + * + * @return string[]|null + */ + public function getResponseFields() + { + return $this->container['responseFields'] ?? null; + } + + /** + * Sets responseFields + * + * @param string[]|null $responseFields Choose which fields to return in the API response. This parameters applies to search and browse queries. + * + * @return self + */ + public function setResponseFields($responseFields) + { + $this->container['responseFields'] = $responseFields; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling IndexSettingsAsSearchParams., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets attributeCriteriaComputedByMinProximity + * + * @return bool|null + */ + public function getAttributeCriteriaComputedByMinProximity() + { + return $this->container['attributeCriteriaComputedByMinProximity'] ?? null; + } + + /** + * Sets attributeCriteriaComputedByMinProximity + * + * @param bool|null $attributeCriteriaComputedByMinProximity when attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage + * + * @return self + */ + public function setAttributeCriteriaComputedByMinProximity($attributeCriteriaComputedByMinProximity) + { + $this->container['attributeCriteriaComputedByMinProximity'] = $attributeCriteriaComputedByMinProximity; + + return $this; + } + + /** + * Gets renderingContent + * + * @return object|null + */ + public function getRenderingContent() + { + return $this->container['renderingContent'] ?? null; + } + + /** + * Sets renderingContent + * + * @param object|null $renderingContent Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/Indice.php b/clients/algoliasearch-client-php/lib/Model/Search/Indice.php new file mode 100644 index 0000000000..ec3e84c6e1 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/Indice.php @@ -0,0 +1,542 @@ + 'string', + 'createdAt' => 'string', + 'updatedAt' => 'string', + 'entries' => 'int', + 'dataSize' => 'int', + 'fileSize' => 'int', + 'lastBuildTimeS' => 'int', + 'numberOfPendingTask' => 'int', + 'pendingTask' => 'bool', + 'primary' => 'string', + 'replicas' => 'string[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'name' => null, + 'createdAt' => null, + 'updatedAt' => null, + 'entries' => null, + 'dataSize' => null, + 'fileSize' => null, + 'lastBuildTimeS' => null, + 'numberOfPendingTask' => null, + 'pendingTask' => null, + 'primary' => null, + 'replicas' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'createdAt' => 'setCreatedAt', + 'updatedAt' => 'setUpdatedAt', + 'entries' => 'setEntries', + 'dataSize' => 'setDataSize', + 'fileSize' => 'setFileSize', + 'lastBuildTimeS' => 'setLastBuildTimeS', + 'numberOfPendingTask' => 'setNumberOfPendingTask', + 'pendingTask' => 'setPendingTask', + 'primary' => 'setPrimary', + 'replicas' => 'setReplicas', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'createdAt' => 'getCreatedAt', + 'updatedAt' => 'getUpdatedAt', + 'entries' => 'getEntries', + 'dataSize' => 'getDataSize', + 'fileSize' => 'getFileSize', + 'lastBuildTimeS' => 'getLastBuildTimeS', + 'numberOfPendingTask' => 'getNumberOfPendingTask', + 'pendingTask' => 'getPendingTask', + 'primary' => 'getPrimary', + 'replicas' => 'getReplicas', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['name'])) { + $this->container['name'] = $data['name']; + } + if (isset($data['createdAt'])) { + $this->container['createdAt'] = $data['createdAt']; + } + if (isset($data['updatedAt'])) { + $this->container['updatedAt'] = $data['updatedAt']; + } + if (isset($data['entries'])) { + $this->container['entries'] = $data['entries']; + } + if (isset($data['dataSize'])) { + $this->container['dataSize'] = $data['dataSize']; + } + if (isset($data['fileSize'])) { + $this->container['fileSize'] = $data['fileSize']; + } + if (isset($data['lastBuildTimeS'])) { + $this->container['lastBuildTimeS'] = $data['lastBuildTimeS']; + } + if (isset($data['numberOfPendingTask'])) { + $this->container['numberOfPendingTask'] = $data['numberOfPendingTask']; + } + if (isset($data['pendingTask'])) { + $this->container['pendingTask'] = $data['pendingTask']; + } + if (isset($data['primary'])) { + $this->container['primary'] = $data['primary']; + } + if (isset($data['replicas'])) { + $this->container['replicas'] = $data['replicas']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['name']) || $this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if (!isset($this->container['createdAt']) || $this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if (!isset($this->container['updatedAt']) || $this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' can't be null"; + } + if (!isset($this->container['entries']) || $this->container['entries'] === null) { + $invalidProperties[] = "'entries' can't be null"; + } + if (!isset($this->container['dataSize']) || $this->container['dataSize'] === null) { + $invalidProperties[] = "'dataSize' can't be null"; + } + if (!isset($this->container['fileSize']) || $this->container['fileSize'] === null) { + $invalidProperties[] = "'fileSize' can't be null"; + } + if (!isset($this->container['lastBuildTimeS']) || $this->container['lastBuildTimeS'] === null) { + $invalidProperties[] = "'lastBuildTimeS' can't be null"; + } + if (!isset($this->container['pendingTask']) || $this->container['pendingTask'] === null) { + $invalidProperties[] = "'pendingTask' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name'] ?? null; + } + + /** + * Sets name + * + * @param string $name index name + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets createdAt + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['createdAt'] ?? null; + } + + /** + * Sets createdAt + * + * @param string $createdAt Index creation date. An empty string means that the index has no records. + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets updatedAt + * + * @return string + */ + public function getUpdatedAt() + { + return $this->container['updatedAt'] ?? null; + } + + /** + * Sets updatedAt + * + * @param string $updatedAt date of last update (ISO-8601 format) + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + + /** + * Gets entries + * + * @return int + */ + public function getEntries() + { + return $this->container['entries'] ?? null; + } + + /** + * Sets entries + * + * @param int $entries number of records contained in the index + * + * @return self + */ + public function setEntries($entries) + { + $this->container['entries'] = $entries; + + return $this; + } + + /** + * Gets dataSize + * + * @return int + */ + public function getDataSize() + { + return $this->container['dataSize'] ?? null; + } + + /** + * Sets dataSize + * + * @param int $dataSize number of bytes of the index in minified format + * + * @return self + */ + public function setDataSize($dataSize) + { + $this->container['dataSize'] = $dataSize; + + return $this; + } + + /** + * Gets fileSize + * + * @return int + */ + public function getFileSize() + { + return $this->container['fileSize'] ?? null; + } + + /** + * Sets fileSize + * + * @param int $fileSize number of bytes of the index binary file + * + * @return self + */ + public function setFileSize($fileSize) + { + $this->container['fileSize'] = $fileSize; + + return $this; + } + + /** + * Gets lastBuildTimeS + * + * @return int + */ + public function getLastBuildTimeS() + { + return $this->container['lastBuildTimeS'] ?? null; + } + + /** + * Sets lastBuildTimeS + * + * @param int $lastBuildTimeS last build time + * + * @return self + */ + public function setLastBuildTimeS($lastBuildTimeS) + { + $this->container['lastBuildTimeS'] = $lastBuildTimeS; + + return $this; + } + + /** + * Gets numberOfPendingTask + * + * @return int|null + */ + public function getNumberOfPendingTask() + { + return $this->container['numberOfPendingTask'] ?? null; + } + + /** + * Sets numberOfPendingTask + * + * @param int|null $numberOfPendingTask Number of pending indexing operations. This value is deprecated and should not be used. + * + * @return self + */ + public function setNumberOfPendingTask($numberOfPendingTask) + { + $this->container['numberOfPendingTask'] = $numberOfPendingTask; + + return $this; + } + + /** + * Gets pendingTask + * + * @return bool + */ + public function getPendingTask() + { + return $this->container['pendingTask'] ?? null; + } + + /** + * Sets pendingTask + * + * @param bool $pendingTask A boolean which says whether the index has pending tasks. This value is deprecated and should not be used. + * + * @return self + */ + public function setPendingTask($pendingTask) + { + $this->container['pendingTask'] = $pendingTask; + + return $this; + } + + /** + * Gets primary + * + * @return string|null + */ + public function getPrimary() + { + return $this->container['primary'] ?? null; + } + + /** + * Sets primary + * + * @param string|null $primary Only present if the index is a replica. Contains the name of the related primary index. + * + * @return self + */ + public function setPrimary($primary) + { + $this->container['primary'] = $primary; + + return $this; + } + + /** + * Gets replicas + * + * @return string[]|null + */ + public function getReplicas() + { + return $this->container['replicas'] ?? null; + } + + /** + * Sets replicas + * + * @param string[]|null $replicas Only present if the index is a primary index with replicas. Contains the names of all linked replicas. + * + * @return self + */ + public function setReplicas($replicas) + { + $this->container['replicas'] = $replicas; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/Key.php b/clients/algoliasearch-client-php/lib/Model/Search/Key.php new file mode 100644 index 0000000000..dbab89215e --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/Key.php @@ -0,0 +1,462 @@ + '\Algolia\AlgoliaSearch\Model\Search\Acl[]', + 'description' => 'string', + 'indexes' => 'string[]', + 'maxHitsPerQuery' => 'int', + 'maxQueriesPerIPPerHour' => 'int', + 'queryParameters' => 'string', + 'referers' => 'string[]', + 'validity' => 'int', + 'createdAt' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'acl' => null, + 'description' => null, + 'indexes' => null, + 'maxHitsPerQuery' => null, + 'maxQueriesPerIPPerHour' => null, + 'queryParameters' => null, + 'referers' => null, + 'validity' => null, + 'createdAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'acl' => 'setAcl', + 'description' => 'setDescription', + 'indexes' => 'setIndexes', + 'maxHitsPerQuery' => 'setMaxHitsPerQuery', + 'maxQueriesPerIPPerHour' => 'setMaxQueriesPerIPPerHour', + 'queryParameters' => 'setQueryParameters', + 'referers' => 'setReferers', + 'validity' => 'setValidity', + 'createdAt' => 'setCreatedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'acl' => 'getAcl', + 'description' => 'getDescription', + 'indexes' => 'getIndexes', + 'maxHitsPerQuery' => 'getMaxHitsPerQuery', + 'maxQueriesPerIPPerHour' => 'getMaxQueriesPerIPPerHour', + 'queryParameters' => 'getQueryParameters', + 'referers' => 'getReferers', + 'validity' => 'getValidity', + 'createdAt' => 'getCreatedAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['acl'])) { + $this->container['acl'] = $data['acl']; + } + if (isset($data['description'])) { + $this->container['description'] = $data['description']; + } + if (isset($data['indexes'])) { + $this->container['indexes'] = $data['indexes']; + } + if (isset($data['maxHitsPerQuery'])) { + $this->container['maxHitsPerQuery'] = $data['maxHitsPerQuery']; + } + if (isset($data['maxQueriesPerIPPerHour'])) { + $this->container['maxQueriesPerIPPerHour'] = $data['maxQueriesPerIPPerHour']; + } + if (isset($data['queryParameters'])) { + $this->container['queryParameters'] = $data['queryParameters']; + } + if (isset($data['referers'])) { + $this->container['referers'] = $data['referers']; + } + if (isset($data['validity'])) { + $this->container['validity'] = $data['validity']; + } + if (isset($data['createdAt'])) { + $this->container['createdAt'] = $data['createdAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['acl']) || $this->container['acl'] === null) { + $invalidProperties[] = "'acl' can't be null"; + } + if (!isset($this->container['createdAt']) || $this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets acl + * + * @return \Algolia\AlgoliaSearch\Model\Search\Acl[] + */ + public function getAcl() + { + return $this->container['acl'] ?? null; + } + + /** + * Sets acl + * + * @param \Algolia\AlgoliaSearch\Model\Search\Acl[] $acl set of permissions associated with the key + * + * @return self + */ + public function setAcl($acl) + { + $this->container['acl'] = $acl; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description'] ?? null; + } + + /** + * Sets description + * + * @param string|null $description A comment used to identify a key more easily in the dashboard. It is not interpreted by the API. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets indexes + * + * @return string[]|null + */ + public function getIndexes() + { + return $this->container['indexes'] ?? null; + } + + /** + * Sets indexes + * + * @param string[]|null $indexes Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed. + * + * @return self + */ + public function setIndexes($indexes) + { + $this->container['indexes'] = $indexes; + + return $this; + } + + /** + * Gets maxHitsPerQuery + * + * @return int|null + */ + public function getMaxHitsPerQuery() + { + return $this->container['maxHitsPerQuery'] ?? null; + } + + /** + * Sets maxHitsPerQuery + * + * @param int|null $maxHitsPerQuery Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. + * + * @return self + */ + public function setMaxHitsPerQuery($maxHitsPerQuery) + { + $this->container['maxHitsPerQuery'] = $maxHitsPerQuery; + + return $this; + } + + /** + * Gets maxQueriesPerIPPerHour + * + * @return int|null + */ + public function getMaxQueriesPerIPPerHour() + { + return $this->container['maxQueriesPerIPPerHour'] ?? null; + } + + /** + * Sets maxQueriesPerIPPerHour + * + * @param int|null $maxQueriesPerIPPerHour maximum number of API calls per hour allowed from a given IP address or a user token + * + * @return self + */ + public function setMaxQueriesPerIPPerHour($maxQueriesPerIPPerHour) + { + $this->container['maxQueriesPerIPPerHour'] = $maxQueriesPerIPPerHour; + + return $this; + } + + /** + * Gets queryParameters + * + * @return string|null + */ + public function getQueryParameters() + { + return $this->container['queryParameters'] ?? null; + } + + /** + * Sets queryParameters + * + * @param string|null $queryParameters URL-encoded query string. Force some query parameters to be applied for each query made with this API key. + * + * @return self + */ + public function setQueryParameters($queryParameters) + { + $this->container['queryParameters'] = $queryParameters; + + return $this; + } + + /** + * Gets referers + * + * @return string[]|null + */ + public function getReferers() + { + return $this->container['referers'] ?? null; + } + + /** + * Sets referers + * + * @param string[]|null $referers Restrict this new API key to specific referers. If empty or blank, defaults to all referers. + * + * @return self + */ + public function setReferers($referers) + { + $this->container['referers'] = $referers; + + return $this; + } + + /** + * Gets validity + * + * @return int|null + */ + public function getValidity() + { + return $this->container['validity'] ?? null; + } + + /** + * Sets validity + * + * @param int|null $validity Validity limit for this key in seconds. The key will automatically be removed after this period of time. + * + * @return self + */ + public function setValidity($validity) + { + $this->container['validity'] = $validity; + + return $this; + } + + /** + * Gets createdAt + * + * @return string + */ + public function getCreatedAt() + { + return $this->container['createdAt'] ?? null; + } + + /** + * Sets createdAt + * + * @param string $createdAt date of creation (ISO-8601 format) + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/Languages.php b/clients/algoliasearch-client-php/lib/Model/Search/Languages.php new file mode 100644 index 0000000000..d2cc849aba --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/Languages.php @@ -0,0 +1,281 @@ + '\Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage', + 'stopwords' => '\Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage', + 'compounds' => '\Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'plurals' => null, + 'stopwords' => null, + 'compounds' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'plurals' => 'setPlurals', + 'stopwords' => 'setStopwords', + 'compounds' => 'setCompounds', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'plurals' => 'getPlurals', + 'stopwords' => 'getStopwords', + 'compounds' => 'getCompounds', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['plurals'])) { + $this->container['plurals'] = $data['plurals']; + } + if (isset($data['stopwords'])) { + $this->container['stopwords'] = $data['stopwords']; + } + if (isset($data['compounds'])) { + $this->container['compounds'] = $data['compounds']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['plurals']) || $this->container['plurals'] === null) { + $invalidProperties[] = "'plurals' can't be null"; + } + if (!isset($this->container['stopwords']) || $this->container['stopwords'] === null) { + $invalidProperties[] = "'stopwords' can't be null"; + } + if (!isset($this->container['compounds']) || $this->container['compounds'] === null) { + $invalidProperties[] = "'compounds' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets plurals + * + * @return \Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage + */ + public function getPlurals() + { + return $this->container['plurals'] ?? null; + } + + /** + * Sets plurals + * + * @param \Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage $plurals plurals + * + * @return self + */ + public function setPlurals($plurals) + { + $this->container['plurals'] = $plurals; + + return $this; + } + + /** + * Gets stopwords + * + * @return \Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage + */ + public function getStopwords() + { + return $this->container['stopwords'] ?? null; + } + + /** + * Sets stopwords + * + * @param \Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage $stopwords stopwords + * + * @return self + */ + public function setStopwords($stopwords) + { + $this->container['stopwords'] = $stopwords; + + return $this; + } + + /** + * Gets compounds + * + * @return \Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage + */ + public function getCompounds() + { + return $this->container['compounds'] ?? null; + } + + /** + * Sets compounds + * + * @param \Algolia\AlgoliaSearch\Model\Search\DictionaryLanguage $compounds compounds + * + * @return self + */ + public function setCompounds($compounds) + { + $this->container['compounds'] = $compounds; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/ListApiKeysResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/ListApiKeysResponse.php new file mode 100644 index 0000000000..e8f27b83d0 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/ListApiKeysResponse.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Search\Key[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'keys' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'keys' => 'setKeys', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'keys' => 'getKeys', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['keys'])) { + $this->container['keys'] = $data['keys']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['keys']) || $this->container['keys'] === null) { + $invalidProperties[] = "'keys' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets keys + * + * @return \Algolia\AlgoliaSearch\Model\Search\Key[] + */ + public function getKeys() + { + return $this->container['keys'] ?? null; + } + + /** + * Sets keys + * + * @param \Algolia\AlgoliaSearch\Model\Search\Key[] $keys list of api keys + * + * @return self + */ + public function setKeys($keys) + { + $this->container['keys'] = $keys; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/ListClustersResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/ListClustersResponse.php new file mode 100644 index 0000000000..03840ab690 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/ListClustersResponse.php @@ -0,0 +1,213 @@ + 'string[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'topUsers' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'topUsers' => 'setTopUsers', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'topUsers' => 'getTopUsers', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['topUsers'])) { + $this->container['topUsers'] = $data['topUsers']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['topUsers']) || $this->container['topUsers'] === null) { + $invalidProperties[] = "'topUsers' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets topUsers + * + * @return string[] + */ + public function getTopUsers() + { + return $this->container['topUsers'] ?? null; + } + + /** + * Sets topUsers + * + * @param string[] $topUsers mapping of cluster names to top users + * + * @return self + */ + public function setTopUsers($topUsers) + { + $this->container['topUsers'] = $topUsers; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/ListIndicesResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/ListIndicesResponse.php new file mode 100644 index 0000000000..ce3ffa7ce7 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/ListIndicesResponse.php @@ -0,0 +1,238 @@ + '\Algolia\AlgoliaSearch\Model\Search\Indice[]', + 'nbPages' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'items' => null, + 'nbPages' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems', + 'nbPages' => 'setNbPages', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems', + 'nbPages' => 'getNbPages', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['items'])) { + $this->container['items'] = $data['items']; + } + if (isset($data['nbPages'])) { + $this->container['nbPages'] = $data['nbPages']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets items + * + * @return \Algolia\AlgoliaSearch\Model\Search\Indice[]|null + */ + public function getItems() + { + return $this->container['items'] ?? null; + } + + /** + * Sets items + * + * @param \Algolia\AlgoliaSearch\Model\Search\Indice[]|null $items list of the fetched indices + * + * @return self + */ + public function setItems($items) + { + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets nbPages + * + * @return int|null + */ + public function getNbPages() + { + return $this->container['nbPages'] ?? null; + } + + /** + * Sets nbPages + * + * @param int|null $nbPages number of pages + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/ListUserIdsResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/ListUserIdsResponse.php new file mode 100644 index 0000000000..17713c6b4f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/ListUserIdsResponse.php @@ -0,0 +1,213 @@ + '\Algolia\AlgoliaSearch\Model\Search\UserId[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'userIDs' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userIDs' => 'setUserIDs', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userIDs' => 'getUserIDs', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['userIDs'])) { + $this->container['userIDs'] = $data['userIDs']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['userIDs']) || $this->container['userIDs'] === null) { + $invalidProperties[] = "'userIDs' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets userIDs + * + * @return \Algolia\AlgoliaSearch\Model\Search\UserId[] + */ + public function getUserIDs() + { + return $this->container['userIDs'] ?? null; + } + + /** + * Sets userIDs + * + * @param \Algolia\AlgoliaSearch\Model\Search\UserId[] $userIDs list of userIDs + * + * @return self + */ + public function setUserIDs($userIDs) + { + $this->container['userIDs'] = $userIDs; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/LogType.php b/clients/algoliasearch-client-php/lib/Model/Search/LogType.php new file mode 100644 index 0000000000..f533573414 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/LogType.php @@ -0,0 +1,39 @@ + '\Algolia\AlgoliaSearch\Model\Search\Action', + 'body' => 'object', + 'indexName' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'action' => null, + 'body' => null, + 'indexName' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction', + 'body' => 'setBody', + 'indexName' => 'setIndexName', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction', + 'body' => 'getBody', + 'indexName' => 'getIndexName', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['action'])) { + $this->container['action'] = $data['action']; + } + if (isset($data['body'])) { + $this->container['body'] = $data['body']; + } + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets action + * + * @return \Algolia\AlgoliaSearch\Model\Search\Action|null + */ + public function getAction() + { + return $this->container['action'] ?? null; + } + + /** + * Sets action + * + * @param \Algolia\AlgoliaSearch\Model\Search\Action|null $action action + * + * @return self + */ + public function setAction($action) + { + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets body + * + * @return object|null + */ + public function getBody() + { + return $this->container['body'] ?? null; + } + + /** + * Sets body + * + * @param object|null $body arguments to the operation (depends on the type of the operation) + * + * @return self + */ + public function setBody($body) + { + $this->container['body'] = $body; + + return $this; + } + + /** + * Gets indexName + * + * @return string|null + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string|null $indexName index to target for this operation + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/MultipleBatchResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/MultipleBatchResponse.php new file mode 100644 index 0000000000..172a781bc0 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/MultipleBatchResponse.php @@ -0,0 +1,238 @@ + 'object', + 'objectIDs' => 'string[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'taskID' => null, + 'objectIDs' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'taskID' => 'setTaskID', + 'objectIDs' => 'setObjectIDs', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'taskID' => 'getTaskID', + 'objectIDs' => 'getObjectIDs', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['taskID'])) { + $this->container['taskID'] = $data['taskID']; + } + if (isset($data['objectIDs'])) { + $this->container['objectIDs'] = $data['objectIDs']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets taskID + * + * @return object|null + */ + public function getTaskID() + { + return $this->container['taskID'] ?? null; + } + + /** + * Sets taskID + * + * @param object|null $taskID list of tasksIDs per index + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + + /** + * Gets objectIDs + * + * @return string[]|null + */ + public function getObjectIDs() + { + return $this->container['objectIDs'] ?? null; + } + + /** + * Sets objectIDs + * + * @param string[]|null $objectIDs list of objectID + * + * @return self + */ + public function setObjectIDs($objectIDs) + { + $this->container['objectIDs'] = $objectIDs; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/MultipleGetObjectsParams.php b/clients/algoliasearch-client-php/lib/Model/Search/MultipleGetObjectsParams.php new file mode 100644 index 0000000000..1e4aafbd73 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/MultipleGetObjectsParams.php @@ -0,0 +1,278 @@ + 'string[]', + 'objectID' => 'string', + 'indexName' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'attributesToRetrieve' => null, + 'objectID' => null, + 'indexName' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'objectID' => 'setObjectID', + 'indexName' => 'setIndexName', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'objectID' => 'getObjectID', + 'indexName' => 'getIndexName', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['attributesToRetrieve'])) { + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; + } + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['objectID']) || $this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if (!isset($this->container['indexName']) || $this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve'] ?? null; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve List of attributes to retrieve. By default, all retrievable attributes are returned. + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string $objectID ID of the object within that index + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string $indexName name of the index containing the object + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueries.php b/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueries.php new file mode 100644 index 0000000000..cca818522a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueries.php @@ -0,0 +1,335 @@ + 'string', + 'query' => 'string', + 'type' => '\Algolia\AlgoliaSearch\Model\Search\MultipleQueriesType', + 'facet' => 'string', + 'params' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'indexName' => null, + 'query' => null, + 'type' => null, + 'facet' => null, + 'params' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'indexName' => 'setIndexName', + 'query' => 'setQuery', + 'type' => 'setType', + 'facet' => 'setFacet', + 'params' => 'setParams', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'indexName' => 'getIndexName', + 'query' => 'getQuery', + 'type' => 'getType', + 'facet' => 'getFacet', + 'params' => 'getParams', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['indexName'])) { + $this->container['indexName'] = $data['indexName']; + } + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['type'])) { + $this->container['type'] = $data['type']; + } + if (isset($data['facet'])) { + $this->container['facet'] = $data['facet']; + } + if (isset($data['params'])) { + $this->container['params'] = $data['params']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['indexName']) || $this->container['indexName'] === null) { + $invalidProperties[] = "'indexName' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets indexName + * + * @return string + */ + public function getIndexName() + { + return $this->container['indexName'] ?? null; + } + + /** + * Sets indexName + * + * @param string $indexName the Algolia index name + * + * @return self + */ + public function setIndexName($indexName) + { + $this->container['indexName'] = $indexName; + + return $this; + } + + /** + * Gets query + * + * @return string|null + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string|null $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets type + * + * @return \Algolia\AlgoliaSearch\Model\Search\MultipleQueriesType|null + */ + public function getType() + { + return $this->container['type'] ?? null; + } + + /** + * Sets type + * + * @param \Algolia\AlgoliaSearch\Model\Search\MultipleQueriesType|null $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets facet + * + * @return string|null + */ + public function getFacet() + { + return $this->container['facet'] ?? null; + } + + /** + * Sets facet + * + * @param string|null $facet the `facet` name + * + * @return self + */ + public function setFacet($facet) + { + $this->container['facet'] = $facet; + + return $this; + } + + /** + * Gets params + * + * @return string|null + */ + public function getParams() + { + return $this->container['params'] ?? null; + } + + /** + * Sets params + * + * @param string|null $params a query string of search parameters + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesParams.php b/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesParams.php new file mode 100644 index 0000000000..e9242eb7c3 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesParams.php @@ -0,0 +1,242 @@ + '\Algolia\AlgoliaSearch\Model\Search\MultipleQueries[]', + 'strategy' => '\Algolia\AlgoliaSearch\Model\Search\MultipleQueriesStrategy', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'requests' => null, + 'strategy' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'requests' => 'setRequests', + 'strategy' => 'setStrategy', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'requests' => 'getRequests', + 'strategy' => 'getStrategy', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['requests'])) { + $this->container['requests'] = $data['requests']; + } + if (isset($data['strategy'])) { + $this->container['strategy'] = $data['strategy']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['requests']) || $this->container['requests'] === null) { + $invalidProperties[] = "'requests' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets requests + * + * @return \Algolia\AlgoliaSearch\Model\Search\MultipleQueries[] + */ + public function getRequests() + { + return $this->container['requests'] ?? null; + } + + /** + * Sets requests + * + * @param \Algolia\AlgoliaSearch\Model\Search\MultipleQueries[] $requests requests + * + * @return self + */ + public function setRequests($requests) + { + $this->container['requests'] = $requests; + + return $this; + } + + /** + * Gets strategy + * + * @return \Algolia\AlgoliaSearch\Model\Search\MultipleQueriesStrategy|null + */ + public function getStrategy() + { + return $this->container['strategy'] ?? null; + } + + /** + * Sets strategy + * + * @param \Algolia\AlgoliaSearch\Model\Search\MultipleQueriesStrategy|null $strategy strategy + * + * @return self + */ + public function setStrategy($strategy) + { + $this->container['strategy'] = $strategy; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesResponse.php new file mode 100644 index 0000000000..09deb20a35 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesResponse.php @@ -0,0 +1,207 @@ + '\Algolia\AlgoliaSearch\Model\Search\SearchResponse[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'results' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'results' => 'setResults', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'results' => 'getResults', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['results'])) { + $this->container['results'] = $data['results']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets results + * + * @return \Algolia\AlgoliaSearch\Model\Search\SearchResponse[]|null + */ + public function getResults() + { + return $this->container['results'] ?? null; + } + + /** + * Sets results + * + * @param \Algolia\AlgoliaSearch\Model\Search\SearchResponse[]|null $results results + * + * @return self + */ + public function setResults($results) + { + $this->container['results'] = $results; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesStrategy.php b/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesStrategy.php new file mode 100644 index 0000000000..181ba10989 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/MultipleQueriesStrategy.php @@ -0,0 +1,33 @@ + '\Algolia\AlgoliaSearch\Model\Search\OperationType', + 'destination' => 'string', + 'scope' => '\Algolia\AlgoliaSearch\Model\Search\ScopeType[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'operation' => null, + 'destination' => null, + 'scope' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'operation' => 'setOperation', + 'destination' => 'setDestination', + 'scope' => 'setScope', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'operation' => 'getOperation', + 'destination' => 'getDestination', + 'scope' => 'getScope', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['operation'])) { + $this->container['operation'] = $data['operation']; + } + if (isset($data['destination'])) { + $this->container['destination'] = $data['destination']; + } + if (isset($data['scope'])) { + $this->container['scope'] = $data['scope']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['operation']) || $this->container['operation'] === null) { + $invalidProperties[] = "'operation' can't be null"; + } + if (!isset($this->container['destination']) || $this->container['destination'] === null) { + $invalidProperties[] = "'destination' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets operation + * + * @return \Algolia\AlgoliaSearch\Model\Search\OperationType + */ + public function getOperation() + { + return $this->container['operation'] ?? null; + } + + /** + * Sets operation + * + * @param \Algolia\AlgoliaSearch\Model\Search\OperationType $operation operation + * + * @return self + */ + public function setOperation($operation) + { + $this->container['operation'] = $operation; + + return $this; + } + + /** + * Gets destination + * + * @return string + */ + public function getDestination() + { + return $this->container['destination'] ?? null; + } + + /** + * Sets destination + * + * @param string $destination the Algolia index name + * + * @return self + */ + public function setDestination($destination) + { + $this->container['destination'] = $destination; + + return $this; + } + + /** + * Gets scope + * + * @return \Algolia\AlgoliaSearch\Model\Search\ScopeType[]|null + */ + public function getScope() + { + return $this->container['scope'] ?? null; + } + + /** + * Sets scope + * + * @param \Algolia\AlgoliaSearch\Model\Search\ScopeType[]|null $scope Scope of the data to copy. When absent, a full copy is performed. When present, only the selected scopes are copied. + * + * @return self + */ + public function setScope($scope) + { + $this->container['scope'] = $scope; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/OperationType.php b/clients/algoliasearch-client-php/lib/Model/Search/OperationType.php new file mode 100644 index 0000000000..94e2e12710 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/OperationType.php @@ -0,0 +1,35 @@ + 'string', + 'automaticFacetFilters' => '\Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]', + 'automaticOptionalFacetFilters' => '\Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'query' => null, + 'automaticFacetFilters' => null, + 'automaticOptionalFacetFilters' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'automaticFacetFilters' => 'setAutomaticFacetFilters', + 'automaticOptionalFacetFilters' => 'setAutomaticOptionalFacetFilters', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'automaticFacetFilters' => 'getAutomaticFacetFilters', + 'automaticOptionalFacetFilters' => 'getAutomaticOptionalFacetFilters', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['automaticFacetFilters'])) { + $this->container['automaticFacetFilters'] = $data['automaticFacetFilters']; + } + if (isset($data['automaticOptionalFacetFilters'])) { + $this->container['automaticOptionalFacetFilters'] = $data['automaticOptionalFacetFilters']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets query + * + * @return string|null + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string|null $query query string + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets automaticFacetFilters + * + * @return \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null + */ + public function getAutomaticFacetFilters() + { + return $this->container['automaticFacetFilters'] ?? null; + } + + /** + * Sets automaticFacetFilters + * + * @param \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null $automaticFacetFilters names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern + * + * @return self + */ + public function setAutomaticFacetFilters($automaticFacetFilters) + { + $this->container['automaticFacetFilters'] = $automaticFacetFilters; + + return $this; + } + + /** + * Gets automaticOptionalFacetFilters + * + * @return \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null + */ + public function getAutomaticOptionalFacetFilters() + { + return $this->container['automaticOptionalFacetFilters'] ?? null; + } + + /** + * Sets automaticOptionalFacetFilters + * + * @param \Algolia\AlgoliaSearch\Model\Search\AutomaticFacetFilter[]|null $automaticOptionalFacetFilters same syntax as automaticFacetFilters, but the engine treats the filters as optional + * + * @return self + */ + public function setAutomaticOptionalFacetFilters($automaticOptionalFacetFilters) + { + $this->container['automaticOptionalFacetFilters'] = $automaticOptionalFacetFilters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/Promote.php b/clients/algoliasearch-client-php/lib/Model/Search/Promote.php new file mode 100644 index 0000000000..f143a57876 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/Promote.php @@ -0,0 +1,275 @@ + 'string', + 'objectIDs' => 'string[]', + 'position' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'objectID' => null, + 'objectIDs' => null, + 'position' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'objectIDs' => 'setObjectIDs', + 'position' => 'setPosition', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'objectIDs' => 'getObjectIDs', + 'position' => 'getPosition', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + if (isset($data['objectIDs'])) { + $this->container['objectIDs'] = $data['objectIDs']; + } + if (isset($data['position'])) { + $this->container['position'] = $data['position']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['position']) || $this->container['position'] === null) { + $invalidProperties[] = "'position' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets objectID + * + * @return string|null + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string|null $objectID unique identifier of the object to promote + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets objectIDs + * + * @return string[]|null + */ + public function getObjectIDs() + { + return $this->container['objectIDs'] ?? null; + } + + /** + * Sets objectIDs + * + * @param string[]|null $objectIDs array of unique identifiers of the objects to promote + * + * @return self + */ + public function setObjectIDs($objectIDs) + { + $this->container['objectIDs'] = $objectIDs; + + return $this; + } + + /** + * Gets position + * + * @return int + */ + public function getPosition() + { + return $this->container['position'] ?? null; + } + + /** + * Sets position + * + * @param int $position The position to promote the objects to (zero-based). If you pass objectIDs, the objects are placed at this position as a group. For example, if you pass four objectIDs to position 0, the objects take the first four positions. + * + * @return self + */ + public function setPosition($position) + { + $this->container['position'] = $position; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/RankingInfo.php b/clients/algoliasearch-client-php/lib/Model/Search/RankingInfo.php new file mode 100644 index 0000000000..80425fdc92 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/RankingInfo.php @@ -0,0 +1,517 @@ + 'int', + 'firstMatchedWord' => 'int', + 'geoDistance' => 'int', + 'geoPrecision' => 'int', + 'matchedGeoLocation' => 'array', + 'nbExactWords' => 'int', + 'nbTypos' => 'int', + 'promoted' => 'bool', + 'proximityDistance' => 'int', + 'userScore' => 'int', + 'word' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'filters' => null, + 'firstMatchedWord' => null, + 'geoDistance' => null, + 'geoPrecision' => null, + 'matchedGeoLocation' => null, + 'nbExactWords' => null, + 'nbTypos' => null, + 'promoted' => null, + 'proximityDistance' => null, + 'userScore' => null, + 'word' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'filters' => 'setFilters', + 'firstMatchedWord' => 'setFirstMatchedWord', + 'geoDistance' => 'setGeoDistance', + 'geoPrecision' => 'setGeoPrecision', + 'matchedGeoLocation' => 'setMatchedGeoLocation', + 'nbExactWords' => 'setNbExactWords', + 'nbTypos' => 'setNbTypos', + 'promoted' => 'setPromoted', + 'proximityDistance' => 'setProximityDistance', + 'userScore' => 'setUserScore', + 'word' => 'setWord', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'filters' => 'getFilters', + 'firstMatchedWord' => 'getFirstMatchedWord', + 'geoDistance' => 'getGeoDistance', + 'geoPrecision' => 'getGeoPrecision', + 'matchedGeoLocation' => 'getMatchedGeoLocation', + 'nbExactWords' => 'getNbExactWords', + 'nbTypos' => 'getNbTypos', + 'promoted' => 'getPromoted', + 'proximityDistance' => 'getProximityDistance', + 'userScore' => 'getUserScore', + 'word' => 'getWord', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['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['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['word'])) { + $this->container['word'] = $data['word']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets filters + * + * @return int|null + */ + public function getFilters() + { + return $this->container['filters'] ?? null; + } + + /** + * Sets filters + * + * @param int|null $filters this field is reserved for advanced usage + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets firstMatchedWord + * + * @return int|null + */ + public function getFirstMatchedWord() + { + return $this->container['firstMatchedWord'] ?? null; + } + + /** + * Sets firstMatchedWord + * + * @param int|null $firstMatchedWord position of the most important matched attribute in the attributes to index list + * + * @return self + */ + public function setFirstMatchedWord($firstMatchedWord) + { + $this->container['firstMatchedWord'] = $firstMatchedWord; + + return $this; + } + + /** + * Gets geoDistance + * + * @return int|null + */ + public function getGeoDistance() + { + return $this->container['geoDistance'] ?? null; + } + + /** + * Sets geoDistance + * + * @param int|null $geoDistance distance between the geo location in the search query and the best matching geo location in the record, divided by the geo precision (in meters) + * + * @return self + */ + public function setGeoDistance($geoDistance) + { + $this->container['geoDistance'] = $geoDistance; + + return $this; + } + + /** + * Gets geoPrecision + * + * @return int|null + */ + public function getGeoPrecision() + { + return $this->container['geoPrecision'] ?? null; + } + + /** + * Sets geoPrecision + * + * @param int|null $geoPrecision precision used when computing the geo distance, in meters + * + * @return self + */ + public function setGeoPrecision($geoPrecision) + { + $this->container['geoPrecision'] = $geoPrecision; + + return $this; + } + + /** + * Gets matchedGeoLocation + * + * @return array|null + */ + public function getMatchedGeoLocation() + { + return $this->container['matchedGeoLocation'] ?? null; + } + + /** + * Sets matchedGeoLocation + * + * @param array|null $matchedGeoLocation matchedGeoLocation + * + * @return self + */ + public function setMatchedGeoLocation($matchedGeoLocation) + { + $this->container['matchedGeoLocation'] = $matchedGeoLocation; + + return $this; + } + + /** + * Gets nbExactWords + * + * @return int|null + */ + public function getNbExactWords() + { + return $this->container['nbExactWords'] ?? null; + } + + /** + * Sets nbExactWords + * + * @param int|null $nbExactWords number of exactly matched words + * + * @return self + */ + public function setNbExactWords($nbExactWords) + { + $this->container['nbExactWords'] = $nbExactWords; + + return $this; + } + + /** + * Gets nbTypos + * + * @return int|null + */ + public function getNbTypos() + { + return $this->container['nbTypos'] ?? null; + } + + /** + * Sets nbTypos + * + * @param int|null $nbTypos number of typos encountered when matching the record + * + * @return self + */ + public function setNbTypos($nbTypos) + { + $this->container['nbTypos'] = $nbTypos; + + return $this; + } + + /** + * Gets promoted + * + * @return bool|null + */ + public function getPromoted() + { + return $this->container['promoted'] ?? null; + } + + /** + * Sets promoted + * + * @param bool|null $promoted present and set to true if a Rule promoted the hit + * + * @return self + */ + public function setPromoted($promoted) + { + $this->container['promoted'] = $promoted; + + return $this; + } + + /** + * Gets proximityDistance + * + * @return int|null + */ + public function getProximityDistance() + { + return $this->container['proximityDistance'] ?? null; + } + + /** + * Sets proximityDistance + * + * @param int|null $proximityDistance when the query contains more than one word, the sum of the distances between matched words (in meters) + * + * @return self + */ + public function setProximityDistance($proximityDistance) + { + $this->container['proximityDistance'] = $proximityDistance; + + return $this; + } + + /** + * Gets userScore + * + * @return int|null + */ + public function getUserScore() + { + return $this->container['userScore'] ?? null; + } + + /** + * Sets userScore + * + * @param int|null $userScore custom ranking for the object, expressed as a single integer value + * + * @return self + */ + public function setUserScore($userScore) + { + $this->container['userScore'] = $userScore; + + return $this; + } + + /** + * Gets word + * + * @return int|null + */ + public function getWord() + { + return $this->container['word'] ?? null; + } + + /** + * Sets word + * + * @param int|null $word number of matched words, including prefixes and typos + * + * @return self + */ + public function setWord($word) + { + $this->container['word'] = $word; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/RankingInfoMatchedGeoLocation.php b/clients/algoliasearch-client-php/lib/Model/Search/RankingInfoMatchedGeoLocation.php new file mode 100644 index 0000000000..ba39c6e61d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/RankingInfoMatchedGeoLocation.php @@ -0,0 +1,269 @@ + 'double', + 'lng' => 'double', + '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 property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'lat' => 'setLat', + 'lng' => 'setLng', + 'distance' => 'setDistance', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'lat' => 'getLat', + 'lng' => 'getLng', + 'distance' => 'getDistance', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['lat'])) { + $this->container['lat'] = $data['lat']; + } + if (isset($data['lng'])) { + $this->container['lng'] = $data['lng']; + } + if (isset($data['distance'])) { + $this->container['distance'] = $data['distance']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets lat + * + * @return float|null + */ + public function getLat() + { + return $this->container['lat'] ?? null; + } + + /** + * Sets lat + * + * @param float|null $lat latitude of the matched location + * + * @return self + */ + public function setLat($lat) + { + $this->container['lat'] = $lat; + + return $this; + } + + /** + * Gets lng + * + * @return float|null + */ + public function getLng() + { + return $this->container['lng'] ?? null; + } + + /** + * Sets lng + * + * @param float|null $lng longitude of the matched location + * + * @return self + */ + public function setLng($lng) + { + $this->container['lng'] = $lng; + + return $this; + } + + /** + * Gets distance + * + * @return int|null + */ + public function getDistance() + { + return $this->container['distance'] ?? null; + } + + /** + * Sets distance + * + * @param int|null $distance distance between the matched location and the search location (in meters) + * + * @return self + */ + public function setDistance($distance) + { + $this->container['distance'] = $distance; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/RemoveUserIdResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/RemoveUserIdResponse.php new file mode 100644 index 0000000000..78b839abc0 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/RemoveUserIdResponse.php @@ -0,0 +1,211 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'deletedAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'deletedAt' => 'setDeletedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'deletedAt' => 'getDeletedAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['deletedAt'])) { + $this->container['deletedAt'] = $data['deletedAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['deletedAt']) || $this->container['deletedAt'] === null) { + $invalidProperties[] = "'deletedAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets deletedAt + * + * @return string + */ + public function getDeletedAt() + { + return $this->container['deletedAt'] ?? null; + } + + /** + * Sets deletedAt + * + * @param string $deletedAt date of deletion (ISO-8601 format) + * + * @return self + */ + public function setDeletedAt($deletedAt) + { + $this->container['deletedAt'] = $deletedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/ReplaceSourceResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/ReplaceSourceResponse.php new file mode 100644 index 0000000000..44bebee98f --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/ReplaceSourceResponse.php @@ -0,0 +1,211 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'updatedAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'updatedAt' => 'setUpdatedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'updatedAt' => 'getUpdatedAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['updatedAt'])) { + $this->container['updatedAt'] = $data['updatedAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['updatedAt']) || $this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets updatedAt + * + * @return string + */ + public function getUpdatedAt() + { + return $this->container['updatedAt'] ?? null; + } + + /** + * Sets updatedAt + * + * @param string $updatedAt date of last update (ISO-8601 format) + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/RequiredSearchParams.php b/clients/algoliasearch-client-php/lib/Model/Search/RequiredSearchParams.php new file mode 100644 index 0000000000..568f659bd1 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/RequiredSearchParams.php @@ -0,0 +1,211 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'query' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['query']) || $this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/Rule.php b/clients/algoliasearch-client-php/lib/Model/Search/Rule.php new file mode 100644 index 0000000000..57799350c9 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/Rule.php @@ -0,0 +1,371 @@ + 'string', + 'conditions' => '\Algolia\AlgoliaSearch\Model\Search\Condition[]', + 'consequence' => '\Algolia\AlgoliaSearch\Model\Search\Consequence', + 'description' => 'string', + 'enabled' => 'bool', + 'validity' => '\Algolia\AlgoliaSearch\Model\Search\TimeRange[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'objectID' => null, + 'conditions' => null, + 'consequence' => null, + 'description' => null, + 'enabled' => null, + 'validity' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'conditions' => 'setConditions', + 'consequence' => 'setConsequence', + 'description' => 'setDescription', + 'enabled' => 'setEnabled', + 'validity' => 'setValidity', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'conditions' => 'getConditions', + 'consequence' => 'getConsequence', + 'description' => 'getDescription', + 'enabled' => 'getEnabled', + 'validity' => 'getValidity', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + if (isset($data['conditions'])) { + $this->container['conditions'] = $data['conditions']; + } + if (isset($data['consequence'])) { + $this->container['consequence'] = $data['consequence']; + } + if (isset($data['description'])) { + $this->container['description'] = $data['description']; + } + if (isset($data['enabled'])) { + $this->container['enabled'] = $data['enabled']; + } + if (isset($data['validity'])) { + $this->container['validity'] = $data['validity']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['objectID']) || $this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if (!isset($this->container['consequence']) || $this->container['consequence'] === null) { + $invalidProperties[] = "'consequence' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets conditions + * + * @return \Algolia\AlgoliaSearch\Model\Search\Condition[]|null + */ + public function getConditions() + { + return $this->container['conditions'] ?? null; + } + + /** + * Sets conditions + * + * @param \Algolia\AlgoliaSearch\Model\Search\Condition[]|null $conditions A list of conditions that should apply to activate a Rule. You can use up to 25 conditions per Rule. + * + * @return self + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets consequence + * + * @return \Algolia\AlgoliaSearch\Model\Search\Consequence + */ + public function getConsequence() + { + return $this->container['consequence'] ?? null; + } + + /** + * Sets consequence + * + * @param \Algolia\AlgoliaSearch\Model\Search\Consequence $consequence consequence + * + * @return self + */ + public function setConsequence($consequence) + { + $this->container['consequence'] = $consequence; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description'] ?? null; + } + + /** + * Sets description + * + * @param string|null $description This field is intended for Rule management purposes, in particular to ease searching for Rules and presenting them to human readers. It's not interpreted by the API. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled'] ?? null; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Whether the Rule is enabled. Disabled Rules remain in the index, but aren't applied at query time. + * + * @return self + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets validity + * + * @return \Algolia\AlgoliaSearch\Model\Search\TimeRange[]|null + */ + public function getValidity() + { + return $this->container['validity'] ?? null; + } + + /** + * Sets validity + * + * @param \Algolia\AlgoliaSearch\Model\Search\TimeRange[]|null $validity By default, Rules are permanently valid. When validity periods are specified, the Rule applies only during those periods; it's ignored the rest of the time. The list must not be empty. + * + * @return self + */ + public function setValidity($validity) + { + $this->container['validity'] = $validity; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SaveObjectResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/SaveObjectResponse.php new file mode 100644 index 0000000000..09b5a8d2b5 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SaveObjectResponse.php @@ -0,0 +1,269 @@ + 'string', + 'taskID' => 'int', + 'objectID' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'createdAt' => null, + 'taskID' => null, + 'objectID' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt', + 'taskID' => 'setTaskID', + 'objectID' => 'setObjectID', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt', + 'taskID' => 'getTaskID', + 'objectID' => 'getObjectID', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['createdAt'])) { + $this->container['createdAt'] = $data['createdAt']; + } + if (isset($data['taskID'])) { + $this->container['taskID'] = $data['taskID']; + } + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets createdAt + * + * @return string|null + */ + public function getCreatedAt() + { + return $this->container['createdAt'] ?? null; + } + + /** + * Sets createdAt + * + * @param string|null $createdAt createdAt + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets taskID + * + * @return int|null + */ + public function getTaskID() + { + return $this->container['taskID'] ?? null; + } + + /** + * Sets taskID + * + * @param int|null $taskID taskID of the task to wait for + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + + /** + * Gets objectID + * + * @return string|null + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string|null $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SaveSynonymResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/SaveSynonymResponse.php new file mode 100644 index 0000000000..7f7c54d790 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SaveSynonymResponse.php @@ -0,0 +1,279 @@ + 'int', + 'updatedAt' => 'string', + 'id' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'taskID' => null, + 'updatedAt' => null, + 'id' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'taskID' => 'setTaskID', + 'updatedAt' => 'setUpdatedAt', + 'id' => 'setId', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'taskID' => 'getTaskID', + 'updatedAt' => 'getUpdatedAt', + 'id' => 'getId', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['taskID'])) { + $this->container['taskID'] = $data['taskID']; + } + if (isset($data['updatedAt'])) { + $this->container['updatedAt'] = $data['updatedAt']; + } + if (isset($data['id'])) { + $this->container['id'] = $data['id']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['taskID']) || $this->container['taskID'] === null) { + $invalidProperties[] = "'taskID' can't be null"; + } + if (!isset($this->container['updatedAt']) || $this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' can't be null"; + } + if (!isset($this->container['id']) || $this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets taskID + * + * @return int + */ + public function getTaskID() + { + return $this->container['taskID'] ?? null; + } + + /** + * Sets taskID + * + * @param int $taskID taskID of the task to wait for + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + + /** + * Gets updatedAt + * + * @return string + */ + public function getUpdatedAt() + { + return $this->container['updatedAt'] ?? null; + } + + /** + * Sets updatedAt + * + * @param string $updatedAt date of last update (ISO-8601 format) + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id'] ?? null; + } + + /** + * Sets id + * + * @param string $id objectID of the inserted object + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/ScopeType.php b/clients/algoliasearch-client-php/lib/Model/Search/ScopeType.php new file mode 100644 index 0000000000..9622fa4ac6 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/ScopeType.php @@ -0,0 +1,36 @@ + 'string', + 'page' => 'int', + 'hitsPerPage' => 'int', + 'language' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'query' => null, + 'page' => null, + 'hitsPerPage' => null, + 'language' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'page' => 'setPage', + 'hitsPerPage' => 'setHitsPerPage', + 'language' => 'setLanguage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'page' => 'getPage', + 'hitsPerPage' => 'getHitsPerPage', + 'language' => 'getLanguage', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + if (isset($data['language'])) { + $this->container['language'] = $data['language']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['query']) || $this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int|null $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets language + * + * @return string|null + */ + public function getLanguage() + { + return $this->container['language'] ?? null; + } + + /** + * Sets language + * + * @param string|null $language Language ISO code supported by the dictionary (e.g., \"en\" for English). + * + * @return self + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacetValuesRequest.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacetValuesRequest.php new file mode 100644 index 0000000000..e50d505766 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacetValuesRequest.php @@ -0,0 +1,277 @@ + 'string', + 'facetQuery' => 'string', + 'maxFacetHits' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'params' => null, + 'facetQuery' => null, + 'maxFacetHits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'params' => 'setParams', + 'facetQuery' => 'setFacetQuery', + 'maxFacetHits' => 'setMaxFacetHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'params' => 'getParams', + 'facetQuery' => 'getFacetQuery', + 'maxFacetHits' => 'getMaxFacetHits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['params'])) { + $this->container['params'] = $data['params']; + } + if (isset($data['facetQuery'])) { + $this->container['facetQuery'] = $data['facetQuery']; + } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (isset($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets params + * + * @return string|null + */ + public function getParams() + { + return $this->container['params'] ?? null; + } + + /** + * Sets params + * + * @param string|null $params search parameters as URL-encoded query string + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets facetQuery + * + * @return string|null + */ + public function getFacetQuery() + { + return $this->container['facetQuery'] ?? null; + } + + /** + * Sets facetQuery + * + * @param string|null $facetQuery text to search inside the facet's values + * + * @return self + */ + public function setFacetQuery($facetQuery) + { + $this->container['facetQuery'] = $facetQuery; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling SearchForFacetValuesRequest., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacetValuesResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacetValuesResponse.php new file mode 100644 index 0000000000..0d7f5c0778 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacetValuesResponse.php @@ -0,0 +1,211 @@ + '\Algolia\AlgoliaSearch\Model\Search\SearchForFacetValuesResponseFacetHits[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'facetHits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'facetHits' => 'setFacetHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'facetHits' => 'getFacetHits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['facetHits'])) { + $this->container['facetHits'] = $data['facetHits']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['facetHits']) || $this->container['facetHits'] === null) { + $invalidProperties[] = "'facetHits' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets facetHits + * + * @return \Algolia\AlgoliaSearch\Model\Search\SearchForFacetValuesResponseFacetHits[] + */ + public function getFacetHits() + { + return $this->container['facetHits'] ?? null; + } + + /** + * Sets facetHits + * + * @param \Algolia\AlgoliaSearch\Model\Search\SearchForFacetValuesResponseFacetHits[] $facetHits facetHits + * + * @return self + */ + public function setFacetHits($facetHits) + { + $this->container['facetHits'] = $facetHits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacetValuesResponseFacetHits.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacetValuesResponseFacetHits.php new file mode 100644 index 0000000000..35f07c22fb --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchForFacetValuesResponseFacetHits.php @@ -0,0 +1,279 @@ + '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 property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'highlighted' => 'setHighlighted', + 'count' => 'setCount', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'highlighted' => 'getHighlighted', + 'count' => 'getCount', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['value'])) { + $this->container['value'] = $data['value']; + } + if (isset($data['highlighted'])) { + $this->container['highlighted'] = $data['highlighted']; + } + if (isset($data['count'])) { + $this->container['count'] = $data['count']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['value']) || $this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if (!isset($this->container['highlighted']) || $this->container['highlighted'] === null) { + $invalidProperties[] = "'highlighted' can't be null"; + } + if (!isset($this->container['count']) || $this->container['count'] === null) { + $invalidProperties[] = "'count' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value + * + * @param string $value raw value of the facet + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets highlighted + * + * @return string + */ + public function getHighlighted() + { + return $this->container['highlighted'] ?? null; + } + + /** + * Sets highlighted + * + * @param string $highlighted markup text with occurrences highlighted + * + * @return self + */ + public function setHighlighted($highlighted) + { + $this->container['highlighted'] = $highlighted; + + return $this; + } + + /** + * Gets count + * + * @return int + */ + public function getCount() + { + return $this->container['count'] ?? null; + } + + /** + * Sets count + * + * @param int $count How many objects contain this facet value. This takes into account the extra search parameters specified in the query. Like for a regular search query, the counts may not be exhaustive. + * + * @return self + */ + public function setCount($count) + { + $this->container['count'] = $count; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchHits.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchHits.php new file mode 100644 index 0000000000..e413c3da5a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchHits.php @@ -0,0 +1,207 @@ + '\Algolia\AlgoliaSearch\Model\Search\Hit[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'hits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['hits'])) { + $this->container['hits'] = $data['hits']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets hits + * + * @return \Algolia\AlgoliaSearch\Model\Search\Hit[]|null + */ + public function getHits() + { + return $this->container['hits'] ?? null; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Search\Hit[]|null $hits hits + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchParams.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchParams.php new file mode 100644 index 0000000000..17aa2d1e29 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchParams.php @@ -0,0 +1,2857 @@ + 'string', + 'similarQuery' => 'string', + 'filters' => 'string', + 'facetFilters' => 'string[]', + 'optionalFilters' => 'string[]', + 'numericFilters' => 'string[]', + 'tagFilters' => 'string[]', + 'sumOrFiltersScores' => 'bool', + 'facets' => 'string[]', + 'maxValuesPerFacet' => 'int', + 'facetingAfterDistinct' => 'bool', + 'sortFacetValuesBy' => 'string', + 'page' => 'int', + 'offset' => 'int', + 'length' => 'int', + 'aroundLatLng' => 'string', + 'aroundLatLngViaIP' => 'bool', + 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', + 'aroundPrecision' => 'int', + 'minimumAroundRadius' => 'int', + 'insideBoundingBox' => 'float[]', + 'insidePolygon' => 'float[]', + 'naturalLanguages' => 'string[]', + 'ruleContexts' => 'string[]', + 'personalizationImpact' => 'int', + 'userToken' => 'string', + 'getRankingInfo' => 'bool', + 'clickAnalytics' => 'bool', + 'analytics' => 'bool', + 'analyticsTags' => 'string[]', + 'percentileComputation' => 'bool', + 'enableABTest' => 'bool', + 'enableReRanking' => 'bool', + 'query' => 'string', + 'searchableAttributes' => 'string[]', + 'attributesForFaceting' => 'string[]', + 'unretrievableAttributes' => 'string[]', + 'attributesToRetrieve' => 'string[]', + 'restrictSearchableAttributes' => 'string[]', + 'ranking' => 'string[]', + 'customRanking' => 'string[]', + 'relevancyStrictness' => 'int', + 'attributesToHighlight' => 'string[]', + 'attributesToSnippet' => 'string[]', + 'highlightPreTag' => 'string', + 'highlightPostTag' => 'string', + 'snippetEllipsisText' => 'string', + 'restrictHighlightAndSnippetArrays' => 'bool', + 'hitsPerPage' => 'int', + 'minWordSizefor1Typo' => 'int', + 'minWordSizefor2Typos' => 'int', + 'typoTolerance' => 'string', + 'allowTyposOnNumericTokens' => 'bool', + 'disableTypoToleranceOnAttributes' => 'string[]', + 'separatorsToIndex' => 'string', + 'ignorePlurals' => 'string', + 'removeStopWords' => 'string', + 'keepDiacriticsOnCharacters' => 'string', + 'queryLanguages' => 'string[]', + 'decompoundQuery' => 'bool', + 'enableRules' => 'bool', + 'enablePersonalization' => 'bool', + 'queryType' => 'string', + 'removeWordsIfNoResults' => 'string', + 'advancedSyntax' => 'bool', + 'optionalWords' => 'string[]', + 'disableExactOnAttributes' => 'string[]', + 'exactOnSingleWordQuery' => 'string', + 'alternativesAsExact' => 'string[]', + 'advancedSyntaxFeatures' => 'string[]', + 'distinct' => 'int', + 'synonyms' => 'bool', + 'replaceSynonymsInHighlight' => 'bool', + 'minProximity' => 'int', + 'responseFields' => 'string[]', + 'maxFacetHits' => 'int', + 'attributeCriteriaComputedByMinProximity' => 'bool', + 'renderingContent' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'params' => null, + 'similarQuery' => null, + 'filters' => null, + 'facetFilters' => null, + 'optionalFilters' => null, + 'numericFilters' => null, + 'tagFilters' => null, + 'sumOrFiltersScores' => null, + 'facets' => null, + 'maxValuesPerFacet' => null, + 'facetingAfterDistinct' => null, + 'sortFacetValuesBy' => null, + 'page' => null, + 'offset' => null, + 'length' => null, + 'aroundLatLng' => null, + 'aroundLatLngViaIP' => null, + 'aroundRadius' => null, + 'aroundPrecision' => null, + 'minimumAroundRadius' => null, + 'insideBoundingBox' => null, + 'insidePolygon' => null, + 'naturalLanguages' => null, + 'ruleContexts' => null, + 'personalizationImpact' => null, + 'userToken' => null, + 'getRankingInfo' => null, + 'clickAnalytics' => null, + 'analytics' => null, + 'analyticsTags' => null, + 'percentileComputation' => null, + 'enableABTest' => null, + 'enableReRanking' => null, + 'query' => null, + 'searchableAttributes' => null, + 'attributesForFaceting' => null, + 'unretrievableAttributes' => null, + 'attributesToRetrieve' => null, + 'restrictSearchableAttributes' => null, + 'ranking' => null, + 'customRanking' => null, + 'relevancyStrictness' => null, + 'attributesToHighlight' => null, + 'attributesToSnippet' => null, + 'highlightPreTag' => null, + 'highlightPostTag' => null, + 'snippetEllipsisText' => null, + 'restrictHighlightAndSnippetArrays' => null, + 'hitsPerPage' => null, + 'minWordSizefor1Typo' => null, + 'minWordSizefor2Typos' => null, + 'typoTolerance' => null, + 'allowTyposOnNumericTokens' => null, + 'disableTypoToleranceOnAttributes' => null, + 'separatorsToIndex' => null, + 'ignorePlurals' => null, + 'removeStopWords' => null, + 'keepDiacriticsOnCharacters' => null, + 'queryLanguages' => null, + 'decompoundQuery' => null, + 'enableRules' => null, + 'enablePersonalization' => null, + 'queryType' => null, + 'removeWordsIfNoResults' => null, + 'advancedSyntax' => null, + 'optionalWords' => null, + 'disableExactOnAttributes' => null, + 'exactOnSingleWordQuery' => null, + 'alternativesAsExact' => null, + 'advancedSyntaxFeatures' => null, + 'distinct' => null, + 'synonyms' => null, + 'replaceSynonymsInHighlight' => null, + 'minProximity' => null, + 'responseFields' => null, + 'maxFacetHits' => null, + 'attributeCriteriaComputedByMinProximity' => null, + 'renderingContent' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'params' => 'setParams', + 'similarQuery' => 'setSimilarQuery', + 'filters' => 'setFilters', + 'facetFilters' => 'setFacetFilters', + 'optionalFilters' => 'setOptionalFilters', + 'numericFilters' => 'setNumericFilters', + 'tagFilters' => 'setTagFilters', + 'sumOrFiltersScores' => 'setSumOrFiltersScores', + 'facets' => 'setFacets', + 'maxValuesPerFacet' => 'setMaxValuesPerFacet', + 'facetingAfterDistinct' => 'setFacetingAfterDistinct', + 'sortFacetValuesBy' => 'setSortFacetValuesBy', + 'page' => 'setPage', + 'offset' => 'setOffset', + 'length' => 'setLength', + 'aroundLatLng' => 'setAroundLatLng', + 'aroundLatLngViaIP' => 'setAroundLatLngViaIP', + 'aroundRadius' => 'setAroundRadius', + 'aroundPrecision' => 'setAroundPrecision', + 'minimumAroundRadius' => 'setMinimumAroundRadius', + 'insideBoundingBox' => 'setInsideBoundingBox', + 'insidePolygon' => 'setInsidePolygon', + 'naturalLanguages' => 'setNaturalLanguages', + 'ruleContexts' => 'setRuleContexts', + 'personalizationImpact' => 'setPersonalizationImpact', + 'userToken' => 'setUserToken', + 'getRankingInfo' => 'setGetRankingInfo', + 'clickAnalytics' => 'setClickAnalytics', + 'analytics' => 'setAnalytics', + 'analyticsTags' => 'setAnalyticsTags', + 'percentileComputation' => 'setPercentileComputation', + 'enableABTest' => 'setEnableABTest', + 'enableReRanking' => 'setEnableReRanking', + 'query' => 'setQuery', + 'searchableAttributes' => 'setSearchableAttributes', + 'attributesForFaceting' => 'setAttributesForFaceting', + 'unretrievableAttributes' => 'setUnretrievableAttributes', + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'restrictSearchableAttributes' => 'setRestrictSearchableAttributes', + 'ranking' => 'setRanking', + 'customRanking' => 'setCustomRanking', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'attributesToHighlight' => 'setAttributesToHighlight', + 'attributesToSnippet' => 'setAttributesToSnippet', + 'highlightPreTag' => 'setHighlightPreTag', + 'highlightPostTag' => 'setHighlightPostTag', + 'snippetEllipsisText' => 'setSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'setRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'setHitsPerPage', + 'minWordSizefor1Typo' => 'setMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'setMinWordSizefor2Typos', + 'typoTolerance' => 'setTypoTolerance', + 'allowTyposOnNumericTokens' => 'setAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'setDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'setSeparatorsToIndex', + 'ignorePlurals' => 'setIgnorePlurals', + 'removeStopWords' => 'setRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'setKeepDiacriticsOnCharacters', + 'queryLanguages' => 'setQueryLanguages', + 'decompoundQuery' => 'setDecompoundQuery', + 'enableRules' => 'setEnableRules', + 'enablePersonalization' => 'setEnablePersonalization', + 'queryType' => 'setQueryType', + 'removeWordsIfNoResults' => 'setRemoveWordsIfNoResults', + 'advancedSyntax' => 'setAdvancedSyntax', + 'optionalWords' => 'setOptionalWords', + 'disableExactOnAttributes' => 'setDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'setExactOnSingleWordQuery', + 'alternativesAsExact' => 'setAlternativesAsExact', + 'advancedSyntaxFeatures' => 'setAdvancedSyntaxFeatures', + 'distinct' => 'setDistinct', + 'synonyms' => 'setSynonyms', + 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', + 'minProximity' => 'setMinProximity', + 'responseFields' => 'setResponseFields', + 'maxFacetHits' => 'setMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'setRenderingContent', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'params' => 'getParams', + 'similarQuery' => 'getSimilarQuery', + 'filters' => 'getFilters', + 'facetFilters' => 'getFacetFilters', + 'optionalFilters' => 'getOptionalFilters', + 'numericFilters' => 'getNumericFilters', + 'tagFilters' => 'getTagFilters', + 'sumOrFiltersScores' => 'getSumOrFiltersScores', + 'facets' => 'getFacets', + 'maxValuesPerFacet' => 'getMaxValuesPerFacet', + 'facetingAfterDistinct' => 'getFacetingAfterDistinct', + 'sortFacetValuesBy' => 'getSortFacetValuesBy', + 'page' => 'getPage', + 'offset' => 'getOffset', + 'length' => 'getLength', + 'aroundLatLng' => 'getAroundLatLng', + 'aroundLatLngViaIP' => 'getAroundLatLngViaIP', + 'aroundRadius' => 'getAroundRadius', + 'aroundPrecision' => 'getAroundPrecision', + 'minimumAroundRadius' => 'getMinimumAroundRadius', + 'insideBoundingBox' => 'getInsideBoundingBox', + 'insidePolygon' => 'getInsidePolygon', + 'naturalLanguages' => 'getNaturalLanguages', + 'ruleContexts' => 'getRuleContexts', + 'personalizationImpact' => 'getPersonalizationImpact', + 'userToken' => 'getUserToken', + 'getRankingInfo' => 'getGetRankingInfo', + 'clickAnalytics' => 'getClickAnalytics', + 'analytics' => 'getAnalytics', + 'analyticsTags' => 'getAnalyticsTags', + 'percentileComputation' => 'getPercentileComputation', + 'enableABTest' => 'getEnableABTest', + 'enableReRanking' => 'getEnableReRanking', + 'query' => 'getQuery', + 'searchableAttributes' => 'getSearchableAttributes', + 'attributesForFaceting' => 'getAttributesForFaceting', + 'unretrievableAttributes' => 'getUnretrievableAttributes', + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'restrictSearchableAttributes' => 'getRestrictSearchableAttributes', + 'ranking' => 'getRanking', + 'customRanking' => 'getCustomRanking', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'attributesToHighlight' => 'getAttributesToHighlight', + 'attributesToSnippet' => 'getAttributesToSnippet', + 'highlightPreTag' => 'getHighlightPreTag', + 'highlightPostTag' => 'getHighlightPostTag', + 'snippetEllipsisText' => 'getSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'getRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'getHitsPerPage', + 'minWordSizefor1Typo' => 'getMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'getMinWordSizefor2Typos', + 'typoTolerance' => 'getTypoTolerance', + 'allowTyposOnNumericTokens' => 'getAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'getDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'getSeparatorsToIndex', + 'ignorePlurals' => 'getIgnorePlurals', + 'removeStopWords' => 'getRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'getKeepDiacriticsOnCharacters', + 'queryLanguages' => 'getQueryLanguages', + 'decompoundQuery' => 'getDecompoundQuery', + 'enableRules' => 'getEnableRules', + 'enablePersonalization' => 'getEnablePersonalization', + 'queryType' => 'getQueryType', + 'removeWordsIfNoResults' => 'getRemoveWordsIfNoResults', + 'advancedSyntax' => 'getAdvancedSyntax', + 'optionalWords' => 'getOptionalWords', + 'disableExactOnAttributes' => 'getDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'getExactOnSingleWordQuery', + 'alternativesAsExact' => 'getAlternativesAsExact', + 'advancedSyntaxFeatures' => 'getAdvancedSyntaxFeatures', + 'distinct' => 'getDistinct', + 'synonyms' => 'getSynonyms', + 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', + 'minProximity' => 'getMinProximity', + 'responseFields' => 'getResponseFields', + 'maxFacetHits' => 'getMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'getRenderingContent', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + const TYPO_TOLERANCE_TRUE = 'true'; + const TYPO_TOLERANCE_FALSE = 'false'; + const TYPO_TOLERANCE_MIN = 'min'; + const TYPO_TOLERANCE_STRICT = 'strict'; + const QUERY_TYPE_PREFIX_LAST = 'prefixLast'; + const QUERY_TYPE_PREFIX_ALL = 'prefixAll'; + const QUERY_TYPE_PREFIX_NONE = 'prefixNone'; + const REMOVE_WORDS_IF_NO_RESULTS_NONE = 'none'; + const REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS = 'lastWords'; + const REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS = 'firstWords'; + const REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL = 'allOptional'; + const EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE = 'attribute'; + const EXACT_ON_SINGLE_WORD_QUERY_NONE = 'none'; + const EXACT_ON_SINGLE_WORD_QUERY_WORD = 'word'; + const ALTERNATIVES_AS_EXACT_IGNORE_PLURALS = 'ignorePlurals'; + const ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM = 'singleWordSynonym'; + const ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM = 'multiWordsSynonym'; + const ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE = 'exactPhrase'; + const ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS = 'excludeWords'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypoToleranceAllowableValues() + { + return [ + self::TYPO_TOLERANCE_TRUE, + self::TYPO_TOLERANCE_FALSE, + self::TYPO_TOLERANCE_MIN, + self::TYPO_TOLERANCE_STRICT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getQueryTypeAllowableValues() + { + return [ + self::QUERY_TYPE_PREFIX_LAST, + self::QUERY_TYPE_PREFIX_ALL, + self::QUERY_TYPE_PREFIX_NONE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemoveWordsIfNoResultsAllowableValues() + { + return [ + self::REMOVE_WORDS_IF_NO_RESULTS_NONE, + self::REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExactOnSingleWordQueryAllowableValues() + { + return [ + self::EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE, + self::EXACT_ON_SINGLE_WORD_QUERY_NONE, + self::EXACT_ON_SINGLE_WORD_QUERY_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAlternativesAsExactAllowableValues() + { + return [ + self::ALTERNATIVES_AS_EXACT_IGNORE_PLURALS, + self::ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM, + self::ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdvancedSyntaxFeaturesAllowableValues() + { + return [ + self::ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE, + self::ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['params'])) { + $this->container['params'] = $data['params']; + } + if (isset($data['similarQuery'])) { + $this->container['similarQuery'] = $data['similarQuery']; + } + if (isset($data['filters'])) { + $this->container['filters'] = $data['filters']; + } + 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['tagFilters'])) { + $this->container['tagFilters'] = $data['tagFilters']; + } + if (isset($data['sumOrFiltersScores'])) { + $this->container['sumOrFiltersScores'] = $data['sumOrFiltersScores']; + } + if (isset($data['facets'])) { + $this->container['facets'] = $data['facets']; + } + if (isset($data['maxValuesPerFacet'])) { + $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; + } + if (isset($data['facetingAfterDistinct'])) { + $this->container['facetingAfterDistinct'] = $data['facetingAfterDistinct']; + } + if (isset($data['sortFacetValuesBy'])) { + $this->container['sortFacetValuesBy'] = $data['sortFacetValuesBy']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['offset'])) { + $this->container['offset'] = $data['offset']; + } + if (isset($data['length'])) { + $this->container['length'] = $data['length']; + } + 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['naturalLanguages'])) { + $this->container['naturalLanguages'] = $data['naturalLanguages']; + } + if (isset($data['ruleContexts'])) { + $this->container['ruleContexts'] = $data['ruleContexts']; + } + if (isset($data['personalizationImpact'])) { + $this->container['personalizationImpact'] = $data['personalizationImpact']; + } + if (isset($data['userToken'])) { + $this->container['userToken'] = $data['userToken']; + } + if (isset($data['getRankingInfo'])) { + $this->container['getRankingInfo'] = $data['getRankingInfo']; + } + 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['percentileComputation'])) { + $this->container['percentileComputation'] = $data['percentileComputation']; + } + if (isset($data['enableABTest'])) { + $this->container['enableABTest'] = $data['enableABTest']; + } + if (isset($data['enableReRanking'])) { + $this->container['enableReRanking'] = $data['enableReRanking']; + } + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['searchableAttributes'])) { + $this->container['searchableAttributes'] = $data['searchableAttributes']; + } + if (isset($data['attributesForFaceting'])) { + $this->container['attributesForFaceting'] = $data['attributesForFaceting']; + } + if (isset($data['unretrievableAttributes'])) { + $this->container['unretrievableAttributes'] = $data['unretrievableAttributes']; + } + if (isset($data['attributesToRetrieve'])) { + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; + } + if (isset($data['restrictSearchableAttributes'])) { + $this->container['restrictSearchableAttributes'] = $data['restrictSearchableAttributes']; + } + if (isset($data['ranking'])) { + $this->container['ranking'] = $data['ranking']; + } + if (isset($data['customRanking'])) { + $this->container['customRanking'] = $data['customRanking']; + } + if (isset($data['relevancyStrictness'])) { + $this->container['relevancyStrictness'] = $data['relevancyStrictness']; + } + if (isset($data['attributesToHighlight'])) { + $this->container['attributesToHighlight'] = $data['attributesToHighlight']; + } + if (isset($data['attributesToSnippet'])) { + $this->container['attributesToSnippet'] = $data['attributesToSnippet']; + } + if (isset($data['highlightPreTag'])) { + $this->container['highlightPreTag'] = $data['highlightPreTag']; + } + if (isset($data['highlightPostTag'])) { + $this->container['highlightPostTag'] = $data['highlightPostTag']; + } + if (isset($data['snippetEllipsisText'])) { + $this->container['snippetEllipsisText'] = $data['snippetEllipsisText']; + } + if (isset($data['restrictHighlightAndSnippetArrays'])) { + $this->container['restrictHighlightAndSnippetArrays'] = $data['restrictHighlightAndSnippetArrays']; + } + if (isset($data['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + if (isset($data['minWordSizefor1Typo'])) { + $this->container['minWordSizefor1Typo'] = $data['minWordSizefor1Typo']; + } + if (isset($data['minWordSizefor2Typos'])) { + $this->container['minWordSizefor2Typos'] = $data['minWordSizefor2Typos']; + } + if (isset($data['typoTolerance'])) { + $this->container['typoTolerance'] = $data['typoTolerance']; + } + if (isset($data['allowTyposOnNumericTokens'])) { + $this->container['allowTyposOnNumericTokens'] = $data['allowTyposOnNumericTokens']; + } + if (isset($data['disableTypoToleranceOnAttributes'])) { + $this->container['disableTypoToleranceOnAttributes'] = $data['disableTypoToleranceOnAttributes']; + } + if (isset($data['separatorsToIndex'])) { + $this->container['separatorsToIndex'] = $data['separatorsToIndex']; + } + if (isset($data['ignorePlurals'])) { + $this->container['ignorePlurals'] = $data['ignorePlurals']; + } + if (isset($data['removeStopWords'])) { + $this->container['removeStopWords'] = $data['removeStopWords']; + } + if (isset($data['keepDiacriticsOnCharacters'])) { + $this->container['keepDiacriticsOnCharacters'] = $data['keepDiacriticsOnCharacters']; + } + if (isset($data['queryLanguages'])) { + $this->container['queryLanguages'] = $data['queryLanguages']; + } + if (isset($data['decompoundQuery'])) { + $this->container['decompoundQuery'] = $data['decompoundQuery']; + } + if (isset($data['enableRules'])) { + $this->container['enableRules'] = $data['enableRules']; + } + if (isset($data['enablePersonalization'])) { + $this->container['enablePersonalization'] = $data['enablePersonalization']; + } + if (isset($data['queryType'])) { + $this->container['queryType'] = $data['queryType']; + } + if (isset($data['removeWordsIfNoResults'])) { + $this->container['removeWordsIfNoResults'] = $data['removeWordsIfNoResults']; + } + if (isset($data['advancedSyntax'])) { + $this->container['advancedSyntax'] = $data['advancedSyntax']; + } + if (isset($data['optionalWords'])) { + $this->container['optionalWords'] = $data['optionalWords']; + } + if (isset($data['disableExactOnAttributes'])) { + $this->container['disableExactOnAttributes'] = $data['disableExactOnAttributes']; + } + if (isset($data['exactOnSingleWordQuery'])) { + $this->container['exactOnSingleWordQuery'] = $data['exactOnSingleWordQuery']; + } + if (isset($data['alternativesAsExact'])) { + $this->container['alternativesAsExact'] = $data['alternativesAsExact']; + } + if (isset($data['advancedSyntaxFeatures'])) { + $this->container['advancedSyntaxFeatures'] = $data['advancedSyntaxFeatures']; + } + if (isset($data['distinct'])) { + $this->container['distinct'] = $data['distinct']; + } + if (isset($data['synonyms'])) { + $this->container['synonyms'] = $data['synonyms']; + } + if (isset($data['replaceSynonymsInHighlight'])) { + $this->container['replaceSynonymsInHighlight'] = $data['replaceSynonymsInHighlight']; + } + if (isset($data['minProximity'])) { + $this->container['minProximity'] = $data['minProximity']; + } + if (isset($data['responseFields'])) { + $this->container['responseFields'] = $data['responseFields']; + } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } + if (isset($data['attributeCriteriaComputedByMinProximity'])) { + $this->container['attributeCriteriaComputedByMinProximity'] = $data['attributeCriteriaComputedByMinProximity']; + } + if (isset($data['renderingContent'])) { + $this->container['renderingContent'] = $data['renderingContent']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (isset($this->container['length']) && ($this->container['length'] > 1000)) { + $invalidProperties[] = "invalid value for 'length', must be smaller than or equal to 1000."; + } + + if (isset($this->container['length']) && ($this->container['length'] < 1)) { + $invalidProperties[] = "invalid value for 'length', must be bigger than or equal to 1."; + } + + if (isset($this->container['minimumAroundRadius']) && ($this->container['minimumAroundRadius'] < 1)) { + $invalidProperties[] = "invalid value for 'minimumAroundRadius', must be bigger than or equal to 1."; + } + + if (!isset($this->container['query']) || $this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (isset($this->container['typoTolerance']) && !in_array($this->container['typoTolerance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'typoTolerance', must be one of '%s'", + $this->container['typoTolerance'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getQueryTypeAllowableValues(); + if (isset($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'queryType', must be one of '%s'", + $this->container['queryType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (isset($this->container['removeWordsIfNoResults']) && !in_array($this->container['removeWordsIfNoResults'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $this->container['removeWordsIfNoResults'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (isset($this->container['exactOnSingleWordQuery']) && !in_array($this->container['exactOnSingleWordQuery'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $this->container['exactOnSingleWordQuery'], + implode("', '", $allowedValues) + ); + } + + if (isset($this->container['distinct']) && ($this->container['distinct'] > 4)) { + $invalidProperties[] = "invalid value for 'distinct', must be smaller than or equal to 4."; + } + + if (isset($this->container['distinct']) && ($this->container['distinct'] < 0)) { + $invalidProperties[] = "invalid value for 'distinct', must be bigger than or equal to 0."; + } + + if (isset($this->container['minProximity']) && ($this->container['minProximity'] > 7)) { + $invalidProperties[] = "invalid value for 'minProximity', must be smaller than or equal to 7."; + } + + if (isset($this->container['minProximity']) && ($this->container['minProximity'] < 1)) { + $invalidProperties[] = "invalid value for 'minProximity', must be bigger than or equal to 1."; + } + + if (isset($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets params + * + * @return string|null + */ + public function getParams() + { + return $this->container['params'] ?? null; + } + + /** + * Sets params + * + * @param string|null $params search parameters as URL-encoded query string + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets similarQuery + * + * @return string|null + */ + public function getSimilarQuery() + { + return $this->container['similarQuery'] ?? null; + } + + /** + * Sets similarQuery + * + * @param string|null $similarQuery overrides the query parameter and performs a more generic search that can be used to find \"similar\" results + * + * @return self + */ + public function setSimilarQuery($similarQuery) + { + $this->container['similarQuery'] = $similarQuery; + + return $this; + } + + /** + * Gets filters + * + * @return string|null + */ + public function getFilters() + { + return $this->container['filters'] ?? null; + } + + /** + * Sets filters + * + * @param string|null $filters filter the query with numeric, facet and/or tag filters + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets facetFilters + * + * @return string[]|null + */ + public function getFacetFilters() + { + return $this->container['facetFilters'] ?? null; + } + + /** + * Sets facetFilters + * + * @param string[]|null $facetFilters filter hits by facet value + * + * @return self + */ + public function setFacetFilters($facetFilters) + { + $this->container['facetFilters'] = $facetFilters; + + return $this; + } + + /** + * Gets optionalFilters + * + * @return string[]|null + */ + public function getOptionalFilters() + { + return $this->container['optionalFilters'] ?? null; + } + + /** + * Sets optionalFilters + * + * @param string[]|null $optionalFilters create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter + * + * @return self + */ + public function setOptionalFilters($optionalFilters) + { + $this->container['optionalFilters'] = $optionalFilters; + + return $this; + } + + /** + * Gets numericFilters + * + * @return string[]|null + */ + public function getNumericFilters() + { + return $this->container['numericFilters'] ?? null; + } + + /** + * Sets numericFilters + * + * @param string[]|null $numericFilters filter on numeric attributes + * + * @return self + */ + public function setNumericFilters($numericFilters) + { + $this->container['numericFilters'] = $numericFilters; + + return $this; + } + + /** + * Gets tagFilters + * + * @return string[]|null + */ + public function getTagFilters() + { + return $this->container['tagFilters'] ?? null; + } + + /** + * Sets tagFilters + * + * @param string[]|null $tagFilters filter hits by tags + * + * @return self + */ + public function setTagFilters($tagFilters) + { + $this->container['tagFilters'] = $tagFilters; + + return $this; + } + + /** + * Gets sumOrFiltersScores + * + * @return bool|null + */ + public function getSumOrFiltersScores() + { + return $this->container['sumOrFiltersScores'] ?? null; + } + + /** + * Sets sumOrFiltersScores + * + * @param bool|null $sumOrFiltersScores determines how to calculate the total score for filtering + * + * @return self + */ + public function setSumOrFiltersScores($sumOrFiltersScores) + { + $this->container['sumOrFiltersScores'] = $sumOrFiltersScores; + + return $this; + } + + /** + * Gets facets + * + * @return string[]|null + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets + * + * @param string[]|null $facets retrieve facets and their facet values + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets maxValuesPerFacet + * + * @return int|null + */ + public function getMaxValuesPerFacet() + { + return $this->container['maxValuesPerFacet'] ?? null; + } + + /** + * Sets maxValuesPerFacet + * + * @param int|null $maxValuesPerFacet maximum number of facet values to return for each facet during a regular search + * + * @return self + */ + public function setMaxValuesPerFacet($maxValuesPerFacet) + { + $this->container['maxValuesPerFacet'] = $maxValuesPerFacet; + + return $this; + } + + /** + * Gets facetingAfterDistinct + * + * @return bool|null + */ + public function getFacetingAfterDistinct() + { + return $this->container['facetingAfterDistinct'] ?? null; + } + + /** + * Sets facetingAfterDistinct + * + * @param bool|null $facetingAfterDistinct force faceting to be applied after de-duplication (via the Distinct setting) + * + * @return self + */ + public function setFacetingAfterDistinct($facetingAfterDistinct) + { + $this->container['facetingAfterDistinct'] = $facetingAfterDistinct; + + return $this; + } + + /** + * Gets sortFacetValuesBy + * + * @return string|null + */ + public function getSortFacetValuesBy() + { + return $this->container['sortFacetValuesBy'] ?? null; + } + + /** + * Sets sortFacetValuesBy + * + * @param string|null $sortFacetValuesBy controls how facet values are fetched + * + * @return self + */ + public function setSortFacetValuesBy($sortFacetValuesBy) + { + $this->container['sortFacetValuesBy'] = $sortFacetValuesBy; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int|null $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets offset + * + * @return int|null + */ + public function getOffset() + { + return $this->container['offset'] ?? null; + } + + /** + * Sets offset + * + * @param int|null $offset specify the offset of the first hit to return + * + * @return self + */ + public function setOffset($offset) + { + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets length + * + * @return int|null + */ + public function getLength() + { + return $this->container['length'] ?? null; + } + + /** + * Sets length + * + * @param int|null $length set the number of hits to retrieve (used only with offset) + * + * @return self + */ + public function setLength($length) + { + if (!is_null($length) && ($length > 1000)) { + throw new \InvalidArgumentException('invalid value for $length when calling SearchParams., must be smaller than or equal to 1000.'); + } + if (!is_null($length) && ($length < 1)) { + throw new \InvalidArgumentException('invalid value for $length when calling SearchParams., must be bigger than or equal to 1.'); + } + + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng'] ?? null; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng search for entries around a central geolocation, enabling a geo search within a circular area + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets aroundLatLngViaIP + * + * @return bool|null + */ + public function getAroundLatLngViaIP() + { + return $this->container['aroundLatLngViaIP'] ?? null; + } + + /** + * Sets aroundLatLngViaIP + * + * @param bool|null $aroundLatLngViaIP search for entries around a given location automatically computed from the requester's IP address + * + * @return self + */ + public function setAroundLatLngViaIP($aroundLatLngViaIP) + { + $this->container['aroundLatLngViaIP'] = $aroundLatLngViaIP; + + return $this; + } + + /** + * Gets aroundRadius + * + * @return \Algolia\AlgoliaSearch\Model\Search\AroundRadius|null + */ + public function getAroundRadius() + { + return $this->container['aroundRadius'] ?? null; + } + + /** + * Sets aroundRadius + * + * @param \Algolia\AlgoliaSearch\Model\Search\AroundRadius|null $aroundRadius aroundRadius + * + * @return self + */ + public function setAroundRadius($aroundRadius) + { + $this->container['aroundRadius'] = $aroundRadius; + + return $this; + } + + /** + * Gets aroundPrecision + * + * @return int|null + */ + public function getAroundPrecision() + { + return $this->container['aroundPrecision'] ?? null; + } + + /** + * Sets aroundPrecision + * + * @param int|null $aroundPrecision precision of geo search (in meters), to add grouping by geo location to the ranking formula + * + * @return self + */ + public function setAroundPrecision($aroundPrecision) + { + $this->container['aroundPrecision'] = $aroundPrecision; + + return $this; + } + + /** + * Gets minimumAroundRadius + * + * @return int|null + */ + public function getMinimumAroundRadius() + { + return $this->container['minimumAroundRadius'] ?? null; + } + + /** + * Sets minimumAroundRadius + * + * @param int|null $minimumAroundRadius minimum radius (in meters) used for a geo search when aroundRadius is not set + * + * @return self + */ + public function setMinimumAroundRadius($minimumAroundRadius) + { + if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { + throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling SearchParams., must be bigger than or equal to 1.'); + } + + $this->container['minimumAroundRadius'] = $minimumAroundRadius; + + return $this; + } + + /** + * Gets insideBoundingBox + * + * @return float[]|null + */ + public function getInsideBoundingBox() + { + return $this->container['insideBoundingBox'] ?? null; + } + + /** + * Sets insideBoundingBox + * + * @param float[]|null $insideBoundingBox search inside a rectangular area (in geo coordinates) + * + * @return self + */ + public function setInsideBoundingBox($insideBoundingBox) + { + $this->container['insideBoundingBox'] = $insideBoundingBox; + + return $this; + } + + /** + * Gets insidePolygon + * + * @return float[]|null + */ + public function getInsidePolygon() + { + return $this->container['insidePolygon'] ?? null; + } + + /** + * Sets insidePolygon + * + * @param float[]|null $insidePolygon search inside a polygon (in geo coordinates) + * + * @return self + */ + public function setInsidePolygon($insidePolygon) + { + $this->container['insidePolygon'] = $insidePolygon; + + return $this; + } + + /** + * Gets naturalLanguages + * + * @return string[]|null + */ + public function getNaturalLanguages() + { + return $this->container['naturalLanguages'] ?? null; + } + + /** + * Sets naturalLanguages + * + * @param string[]|null $naturalLanguages This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. + * + * @return self + */ + public function setNaturalLanguages($naturalLanguages) + { + $this->container['naturalLanguages'] = $naturalLanguages; + + return $this; + } + + /** + * Gets ruleContexts + * + * @return string[]|null + */ + public function getRuleContexts() + { + return $this->container['ruleContexts'] ?? null; + } + + /** + * Sets ruleContexts + * + * @param string[]|null $ruleContexts enables contextual rules + * + * @return self + */ + public function setRuleContexts($ruleContexts) + { + $this->container['ruleContexts'] = $ruleContexts; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int|null + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact'] ?? null; + } + + /** + * Sets personalizationImpact + * + * @param int|null $personalizationImpact define the impact of the Personalization feature + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + return $this; + } + + /** + * Gets userToken + * + * @return string|null + */ + public function getUserToken() + { + return $this->container['userToken'] ?? null; + } + + /** + * Sets userToken + * + * @param string|null $userToken associates a certain user token with the current search + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets getRankingInfo + * + * @return bool|null + */ + public function getGetRankingInfo() + { + return $this->container['getRankingInfo'] ?? null; + } + + /** + * Sets getRankingInfo + * + * @param bool|null $getRankingInfo retrieve detailed ranking information + * + * @return self + */ + public function setGetRankingInfo($getRankingInfo) + { + $this->container['getRankingInfo'] = $getRankingInfo; + + return $this; + } + + /** + * Gets clickAnalytics + * + * @return bool|null + */ + public function getClickAnalytics() + { + return $this->container['clickAnalytics'] ?? null; + } + + /** + * Sets clickAnalytics + * + * @param bool|null $clickAnalytics enable the Click Analytics feature + * + * @return self + */ + public function setClickAnalytics($clickAnalytics) + { + $this->container['clickAnalytics'] = $clickAnalytics; + + return $this; + } + + /** + * Gets analytics + * + * @return bool|null + */ + public function getAnalytics() + { + return $this->container['analytics'] ?? null; + } + + /** + * Sets analytics + * + * @param bool|null $analytics whether the current query will be taken into account in the Analytics + * + * @return self + */ + public function setAnalytics($analytics) + { + $this->container['analytics'] = $analytics; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[]|null + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags'] ?? null; + } + + /** + * Sets analyticsTags + * + * @param string[]|null $analyticsTags list of tags to apply to the query for analytics purposes + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets percentileComputation + * + * @return bool|null + */ + public function getPercentileComputation() + { + return $this->container['percentileComputation'] ?? null; + } + + /** + * Sets percentileComputation + * + * @param bool|null $percentileComputation whether to include or exclude a query from the processing-time percentile computation + * + * @return self + */ + public function setPercentileComputation($percentileComputation) + { + $this->container['percentileComputation'] = $percentileComputation; + + return $this; + } + + /** + * Gets enableABTest + * + * @return bool|null + */ + public function getEnableABTest() + { + return $this->container['enableABTest'] ?? null; + } + + /** + * Sets enableABTest + * + * @param bool|null $enableABTest whether this search should participate in running AB tests + * + * @return self + */ + public function setEnableABTest($enableABTest) + { + $this->container['enableABTest'] = $enableABTest; + + return $this; + } + + /** + * Gets enableReRanking + * + * @return bool|null + */ + public function getEnableReRanking() + { + return $this->container['enableReRanking'] ?? null; + } + + /** + * Sets enableReRanking + * + * @param bool|null $enableReRanking whether this search should use AI Re-Ranking + * + * @return self + */ + public function setEnableReRanking($enableReRanking) + { + $this->container['enableReRanking'] = $enableReRanking; + + return $this; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets searchableAttributes + * + * @return string[]|null + */ + public function getSearchableAttributes() + { + return $this->container['searchableAttributes'] ?? null; + } + + /** + * Sets searchableAttributes + * + * @param string[]|null $searchableAttributes the complete list of attributes used for searching + * + * @return self + */ + public function setSearchableAttributes($searchableAttributes) + { + $this->container['searchableAttributes'] = $searchableAttributes; + + return $this; + } + + /** + * Gets attributesForFaceting + * + * @return string[]|null + */ + public function getAttributesForFaceting() + { + return $this->container['attributesForFaceting'] ?? null; + } + + /** + * Sets attributesForFaceting + * + * @param string[]|null $attributesForFaceting the complete list of attributes that will be used for faceting + * + * @return self + */ + public function setAttributesForFaceting($attributesForFaceting) + { + $this->container['attributesForFaceting'] = $attributesForFaceting; + + return $this; + } + + /** + * Gets unretrievableAttributes + * + * @return string[]|null + */ + public function getUnretrievableAttributes() + { + return $this->container['unretrievableAttributes'] ?? null; + } + + /** + * Sets unretrievableAttributes + * + * @param string[]|null $unretrievableAttributes list of attributes that can't be retrieved at query time + * + * @return self + */ + public function setUnretrievableAttributes($unretrievableAttributes) + { + $this->container['unretrievableAttributes'] = $unretrievableAttributes; + + return $this; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve'] ?? null; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve this parameter controls which attributes to retrieve and which not to retrieve + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets restrictSearchableAttributes + * + * @return string[]|null + */ + public function getRestrictSearchableAttributes() + { + return $this->container['restrictSearchableAttributes'] ?? null; + } + + /** + * Sets restrictSearchableAttributes + * + * @param string[]|null $restrictSearchableAttributes restricts a given query to look in only a subset of your searchable attributes + * + * @return self + */ + public function setRestrictSearchableAttributes($restrictSearchableAttributes) + { + $this->container['restrictSearchableAttributes'] = $restrictSearchableAttributes; + + return $this; + } + + /** + * Gets ranking + * + * @return string[]|null + */ + public function getRanking() + { + return $this->container['ranking'] ?? null; + } + + /** + * Sets ranking + * + * @param string[]|null $ranking controls how Algolia should sort your results + * + * @return self + */ + public function setRanking($ranking) + { + $this->container['ranking'] = $ranking; + + return $this; + } + + /** + * Gets customRanking + * + * @return string[]|null + */ + public function getCustomRanking() + { + return $this->container['customRanking'] ?? null; + } + + /** + * Sets customRanking + * + * @param string[]|null $customRanking specifies the custom ranking criterion + * + * @return self + */ + public function setCustomRanking($customRanking) + { + $this->container['customRanking'] = $customRanking; + + return $this; + } + + /** + * Gets relevancyStrictness + * + * @return int|null + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness'] ?? null; + } + + /** + * Sets relevancyStrictness + * + * @param int|null $relevancyStrictness controls the relevancy threshold below which less relevant results aren't included in the results + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets attributesToHighlight + * + * @return string[]|null + */ + public function getAttributesToHighlight() + { + return $this->container['attributesToHighlight'] ?? null; + } + + /** + * Sets attributesToHighlight + * + * @param string[]|null $attributesToHighlight list of attributes to highlight + * + * @return self + */ + public function setAttributesToHighlight($attributesToHighlight) + { + $this->container['attributesToHighlight'] = $attributesToHighlight; + + return $this; + } + + /** + * Gets attributesToSnippet + * + * @return string[]|null + */ + public function getAttributesToSnippet() + { + return $this->container['attributesToSnippet'] ?? null; + } + + /** + * Sets attributesToSnippet + * + * @param string[]|null $attributesToSnippet list of attributes to snippet, with an optional maximum number of words to snippet + * + * @return self + */ + public function setAttributesToSnippet($attributesToSnippet) + { + $this->container['attributesToSnippet'] = $attributesToSnippet; + + return $this; + } + + /** + * Gets highlightPreTag + * + * @return string|null + */ + public function getHighlightPreTag() + { + return $this->container['highlightPreTag'] ?? null; + } + + /** + * Sets highlightPreTag + * + * @param string|null $highlightPreTag the HTML string to insert before the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPreTag($highlightPreTag) + { + $this->container['highlightPreTag'] = $highlightPreTag; + + return $this; + } + + /** + * Gets highlightPostTag + * + * @return string|null + */ + public function getHighlightPostTag() + { + return $this->container['highlightPostTag'] ?? null; + } + + /** + * Sets highlightPostTag + * + * @param string|null $highlightPostTag the HTML string to insert after the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPostTag($highlightPostTag) + { + $this->container['highlightPostTag'] = $highlightPostTag; + + return $this; + } + + /** + * Gets snippetEllipsisText + * + * @return string|null + */ + public function getSnippetEllipsisText() + { + return $this->container['snippetEllipsisText'] ?? null; + } + + /** + * Sets snippetEllipsisText + * + * @param string|null $snippetEllipsisText string used as an ellipsis indicator when a snippet is truncated + * + * @return self + */ + public function setSnippetEllipsisText($snippetEllipsisText) + { + $this->container['snippetEllipsisText'] = $snippetEllipsisText; + + return $this; + } + + /** + * Gets restrictHighlightAndSnippetArrays + * + * @return bool|null + */ + public function getRestrictHighlightAndSnippetArrays() + { + return $this->container['restrictHighlightAndSnippetArrays'] ?? null; + } + + /** + * Sets restrictHighlightAndSnippetArrays + * + * @param bool|null $restrictHighlightAndSnippetArrays restrict highlighting and snippeting to items that matched the query + * + * @return self + */ + public function setRestrictHighlightAndSnippetArrays($restrictHighlightAndSnippetArrays) + { + $this->container['restrictHighlightAndSnippetArrays'] = $restrictHighlightAndSnippetArrays; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets minWordSizefor1Typo + * + * @return int|null + */ + public function getMinWordSizefor1Typo() + { + return $this->container['minWordSizefor1Typo'] ?? null; + } + + /** + * Sets minWordSizefor1Typo + * + * @param int|null $minWordSizefor1Typo minimum number of characters a word in the query string must contain to accept matches with 1 typo + * + * @return self + */ + public function setMinWordSizefor1Typo($minWordSizefor1Typo) + { + $this->container['minWordSizefor1Typo'] = $minWordSizefor1Typo; + + return $this; + } + + /** + * Gets minWordSizefor2Typos + * + * @return int|null + */ + public function getMinWordSizefor2Typos() + { + return $this->container['minWordSizefor2Typos'] ?? null; + } + + /** + * Sets minWordSizefor2Typos + * + * @param int|null $minWordSizefor2Typos minimum number of characters a word in the query string must contain to accept matches with 2 typos + * + * @return self + */ + public function setMinWordSizefor2Typos($minWordSizefor2Typos) + { + $this->container['minWordSizefor2Typos'] = $minWordSizefor2Typos; + + return $this; + } + + /** + * Gets typoTolerance + * + * @return string|null + */ + public function getTypoTolerance() + { + return $this->container['typoTolerance'] ?? null; + } + + /** + * Sets typoTolerance + * + * @param string|null $typoTolerance controls whether typo tolerance is enabled and how it is applied + * + * @return self + */ + public function setTypoTolerance($typoTolerance) + { + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($typoTolerance) && !in_array($typoTolerance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'typoTolerance', must be one of '%s'", + $typoTolerance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['typoTolerance'] = $typoTolerance; + + return $this; + } + + /** + * Gets allowTyposOnNumericTokens + * + * @return bool|null + */ + public function getAllowTyposOnNumericTokens() + { + return $this->container['allowTyposOnNumericTokens'] ?? null; + } + + /** + * Sets allowTyposOnNumericTokens + * + * @param bool|null $allowTyposOnNumericTokens whether to allow typos on numbers (\"numeric tokens\") in the query string + * + * @return self + */ + public function setAllowTyposOnNumericTokens($allowTyposOnNumericTokens) + { + $this->container['allowTyposOnNumericTokens'] = $allowTyposOnNumericTokens; + + return $this; + } + + /** + * Gets disableTypoToleranceOnAttributes + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnAttributes() + { + return $this->container['disableTypoToleranceOnAttributes'] ?? null; + } + + /** + * Sets disableTypoToleranceOnAttributes + * + * @param string[]|null $disableTypoToleranceOnAttributes list of attributes on which you want to disable typo tolerance + * + * @return self + */ + public function setDisableTypoToleranceOnAttributes($disableTypoToleranceOnAttributes) + { + $this->container['disableTypoToleranceOnAttributes'] = $disableTypoToleranceOnAttributes; + + return $this; + } + + /** + * Gets separatorsToIndex + * + * @return string|null + */ + public function getSeparatorsToIndex() + { + return $this->container['separatorsToIndex'] ?? null; + } + + /** + * Sets separatorsToIndex + * + * @param string|null $separatorsToIndex control which separators are indexed + * + * @return self + */ + public function setSeparatorsToIndex($separatorsToIndex) + { + $this->container['separatorsToIndex'] = $separatorsToIndex; + + return $this; + } + + /** + * Gets ignorePlurals + * + * @return string|null + */ + public function getIgnorePlurals() + { + return $this->container['ignorePlurals'] ?? null; + } + + /** + * Sets ignorePlurals + * + * @param string|null $ignorePlurals treats singular, plurals, and other forms of declensions as matching terms + * + * @return self + */ + public function setIgnorePlurals($ignorePlurals) + { + $this->container['ignorePlurals'] = $ignorePlurals; + + return $this; + } + + /** + * Gets removeStopWords + * + * @return string|null + */ + public function getRemoveStopWords() + { + return $this->container['removeStopWords'] ?? null; + } + + /** + * Sets removeStopWords + * + * @param string|null $removeStopWords removes stop (common) words from the query before executing it + * + * @return self + */ + public function setRemoveStopWords($removeStopWords) + { + $this->container['removeStopWords'] = $removeStopWords; + + return $this; + } + + /** + * Gets keepDiacriticsOnCharacters + * + * @return string|null + */ + public function getKeepDiacriticsOnCharacters() + { + return $this->container['keepDiacriticsOnCharacters'] ?? null; + } + + /** + * Sets keepDiacriticsOnCharacters + * + * @param string|null $keepDiacriticsOnCharacters list of characters that the engine shouldn't automatically normalize + * + * @return self + */ + public function setKeepDiacriticsOnCharacters($keepDiacriticsOnCharacters) + { + $this->container['keepDiacriticsOnCharacters'] = $keepDiacriticsOnCharacters; + + return $this; + } + + /** + * Gets queryLanguages + * + * @return string[]|null + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages'] ?? null; + } + + /** + * Sets queryLanguages + * + * @param string[]|null $queryLanguages sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets decompoundQuery + * + * @return bool|null + */ + public function getDecompoundQuery() + { + return $this->container['decompoundQuery'] ?? null; + } + + /** + * Sets decompoundQuery + * + * @param bool|null $decompoundQuery splits compound words into their composing atoms in the query + * + * @return self + */ + public function setDecompoundQuery($decompoundQuery) + { + $this->container['decompoundQuery'] = $decompoundQuery; + + return $this; + } + + /** + * Gets enableRules + * + * @return bool|null + */ + public function getEnableRules() + { + return $this->container['enableRules'] ?? null; + } + + /** + * Sets enableRules + * + * @param bool|null $enableRules whether Rules should be globally enabled + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets enablePersonalization + * + * @return bool|null + */ + public function getEnablePersonalization() + { + return $this->container['enablePersonalization'] ?? null; + } + + /** + * Sets enablePersonalization + * + * @param bool|null $enablePersonalization enable the Personalization feature + * + * @return self + */ + public function setEnablePersonalization($enablePersonalization) + { + $this->container['enablePersonalization'] = $enablePersonalization; + + return $this; + } + + /** + * Gets queryType + * + * @return string|null + */ + public function getQueryType() + { + return $this->container['queryType'] ?? null; + } + + /** + * Sets queryType + * + * @param string|null $queryType controls if and how query words are interpreted as prefixes + * + * @return self + */ + public function setQueryType($queryType) + { + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($queryType) && !in_array($queryType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'queryType', must be one of '%s'", + $queryType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['queryType'] = $queryType; + + return $this; + } + + /** + * Gets removeWordsIfNoResults + * + * @return string|null + */ + public function getRemoveWordsIfNoResults() + { + return $this->container['removeWordsIfNoResults'] ?? null; + } + + /** + * Sets removeWordsIfNoResults + * + * @param string|null $removeWordsIfNoResults selects a strategy to remove words from the query when it doesn't match any hits + * + * @return self + */ + public function setRemoveWordsIfNoResults($removeWordsIfNoResults) + { + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($removeWordsIfNoResults) && !in_array($removeWordsIfNoResults, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $removeWordsIfNoResults, + implode("', '", $allowedValues) + ) + ); + } + $this->container['removeWordsIfNoResults'] = $removeWordsIfNoResults; + + return $this; + } + + /** + * Gets advancedSyntax + * + * @return bool|null + */ + public function getAdvancedSyntax() + { + return $this->container['advancedSyntax'] ?? null; + } + + /** + * Sets advancedSyntax + * + * @param bool|null $advancedSyntax enables the advanced query syntax + * + * @return self + */ + public function setAdvancedSyntax($advancedSyntax) + { + $this->container['advancedSyntax'] = $advancedSyntax; + + return $this; + } + + /** + * Gets optionalWords + * + * @return string[]|null + */ + public function getOptionalWords() + { + return $this->container['optionalWords'] ?? null; + } + + /** + * Sets optionalWords + * + * @param string[]|null $optionalWords a list of words that should be considered as optional when found in the query + * + * @return self + */ + public function setOptionalWords($optionalWords) + { + $this->container['optionalWords'] = $optionalWords; + + return $this; + } + + /** + * Gets disableExactOnAttributes + * + * @return string[]|null + */ + public function getDisableExactOnAttributes() + { + return $this->container['disableExactOnAttributes'] ?? null; + } + + /** + * Sets disableExactOnAttributes + * + * @param string[]|null $disableExactOnAttributes list of attributes on which you want to disable the exact ranking criterion + * + * @return self + */ + public function setDisableExactOnAttributes($disableExactOnAttributes) + { + $this->container['disableExactOnAttributes'] = $disableExactOnAttributes; + + return $this; + } + + /** + * Gets exactOnSingleWordQuery + * + * @return string|null + */ + public function getExactOnSingleWordQuery() + { + return $this->container['exactOnSingleWordQuery'] ?? null; + } + + /** + * Sets exactOnSingleWordQuery + * + * @param string|null $exactOnSingleWordQuery controls how the exact ranking criterion is computed when the query contains only one word + * + * @return self + */ + public function setExactOnSingleWordQuery($exactOnSingleWordQuery) + { + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($exactOnSingleWordQuery) && !in_array($exactOnSingleWordQuery, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $exactOnSingleWordQuery, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exactOnSingleWordQuery'] = $exactOnSingleWordQuery; + + return $this; + } + + /** + * Gets alternativesAsExact + * + * @return string[]|null + */ + public function getAlternativesAsExact() + { + return $this->container['alternativesAsExact'] ?? null; + } + + /** + * Sets alternativesAsExact + * + * @param string[]|null $alternativesAsExact list of alternatives that should be considered an exact match by the exact ranking criterion + * + * @return self + */ + public function setAlternativesAsExact($alternativesAsExact) + { + $allowedValues = $this->getAlternativesAsExactAllowableValues(); + if (!is_null($alternativesAsExact) && array_diff($alternativesAsExact, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'alternativesAsExact', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['alternativesAsExact'] = $alternativesAsExact; + + return $this; + } + + /** + * Gets advancedSyntaxFeatures + * + * @return string[]|null + */ + public function getAdvancedSyntaxFeatures() + { + return $this->container['advancedSyntaxFeatures'] ?? null; + } + + /** + * Sets advancedSyntaxFeatures + * + * @param string[]|null $advancedSyntaxFeatures allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled + * + * @return self + */ + public function setAdvancedSyntaxFeatures($advancedSyntaxFeatures) + { + $allowedValues = $this->getAdvancedSyntaxFeaturesAllowableValues(); + if (!is_null($advancedSyntaxFeatures) && array_diff($advancedSyntaxFeatures, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'advancedSyntaxFeatures', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['advancedSyntaxFeatures'] = $advancedSyntaxFeatures; + + return $this; + } + + /** + * Gets distinct + * + * @return int|null + */ + public function getDistinct() + { + return $this->container['distinct'] ?? null; + } + + /** + * Sets distinct + * + * @param int|null $distinct enables de-duplication or grouping of results + * + * @return self + */ + public function setDistinct($distinct) + { + if (!is_null($distinct) && ($distinct > 4)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling SearchParams., must be smaller than or equal to 4.'); + } + if (!is_null($distinct) && ($distinct < 0)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling SearchParams., must be bigger than or equal to 0.'); + } + + $this->container['distinct'] = $distinct; + + return $this; + } + + /** + * Gets synonyms + * + * @return bool|null + */ + public function getSynonyms() + { + return $this->container['synonyms'] ?? null; + } + + /** + * Sets synonyms + * + * @param bool|null $synonyms whether to take into account an index's synonyms for a particular search + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets replaceSynonymsInHighlight + * + * @return bool|null + */ + public function getReplaceSynonymsInHighlight() + { + return $this->container['replaceSynonymsInHighlight'] ?? null; + } + + /** + * Sets replaceSynonymsInHighlight + * + * @param bool|null $replaceSynonymsInHighlight whether to highlight and snippet the original word that matches the synonym or the synonym itself + * + * @return self + */ + public function setReplaceSynonymsInHighlight($replaceSynonymsInHighlight) + { + $this->container['replaceSynonymsInHighlight'] = $replaceSynonymsInHighlight; + + return $this; + } + + /** + * Gets minProximity + * + * @return int|null + */ + public function getMinProximity() + { + return $this->container['minProximity'] ?? null; + } + + /** + * Sets minProximity + * + * @param int|null $minProximity precision of the proximity ranking criterion + * + * @return self + */ + public function setMinProximity($minProximity) + { + if (!is_null($minProximity) && ($minProximity > 7)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling SearchParams., must be smaller than or equal to 7.'); + } + if (!is_null($minProximity) && ($minProximity < 1)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling SearchParams., must be bigger than or equal to 1.'); + } + + $this->container['minProximity'] = $minProximity; + + return $this; + } + + /** + * Gets responseFields + * + * @return string[]|null + */ + public function getResponseFields() + { + return $this->container['responseFields'] ?? null; + } + + /** + * Sets responseFields + * + * @param string[]|null $responseFields Choose which fields to return in the API response. This parameters applies to search and browse queries. + * + * @return self + */ + public function setResponseFields($responseFields) + { + $this->container['responseFields'] = $responseFields; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling SearchParams., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets attributeCriteriaComputedByMinProximity + * + * @return bool|null + */ + public function getAttributeCriteriaComputedByMinProximity() + { + return $this->container['attributeCriteriaComputedByMinProximity'] ?? null; + } + + /** + * Sets attributeCriteriaComputedByMinProximity + * + * @param bool|null $attributeCriteriaComputedByMinProximity when attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage + * + * @return self + */ + public function setAttributeCriteriaComputedByMinProximity($attributeCriteriaComputedByMinProximity) + { + $this->container['attributeCriteriaComputedByMinProximity'] = $attributeCriteriaComputedByMinProximity; + + return $this; + } + + /** + * Gets renderingContent + * + * @return object|null + */ + public function getRenderingContent() + { + return $this->container['renderingContent'] ?? null; + } + + /** + * Sets renderingContent + * + * @param object|null $renderingContent Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchParamsObject.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchParamsObject.php new file mode 100644 index 0000000000..c062e9a260 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchParamsObject.php @@ -0,0 +1,2826 @@ + 'string', + 'filters' => 'string', + 'facetFilters' => 'string[]', + 'optionalFilters' => 'string[]', + 'numericFilters' => 'string[]', + 'tagFilters' => 'string[]', + 'sumOrFiltersScores' => 'bool', + 'facets' => 'string[]', + 'maxValuesPerFacet' => 'int', + 'facetingAfterDistinct' => 'bool', + 'sortFacetValuesBy' => 'string', + 'page' => 'int', + 'offset' => 'int', + 'length' => 'int', + 'aroundLatLng' => 'string', + 'aroundLatLngViaIP' => 'bool', + 'aroundRadius' => '\Algolia\AlgoliaSearch\Model\Search\AroundRadius', + 'aroundPrecision' => 'int', + 'minimumAroundRadius' => 'int', + 'insideBoundingBox' => 'float[]', + 'insidePolygon' => 'float[]', + 'naturalLanguages' => 'string[]', + 'ruleContexts' => 'string[]', + 'personalizationImpact' => 'int', + 'userToken' => 'string', + 'getRankingInfo' => 'bool', + 'clickAnalytics' => 'bool', + 'analytics' => 'bool', + 'analyticsTags' => 'string[]', + 'percentileComputation' => 'bool', + 'enableABTest' => 'bool', + 'enableReRanking' => 'bool', + 'query' => 'string', + 'searchableAttributes' => 'string[]', + 'attributesForFaceting' => 'string[]', + 'unretrievableAttributes' => 'string[]', + 'attributesToRetrieve' => 'string[]', + 'restrictSearchableAttributes' => 'string[]', + 'ranking' => 'string[]', + 'customRanking' => 'string[]', + 'relevancyStrictness' => 'int', + 'attributesToHighlight' => 'string[]', + 'attributesToSnippet' => 'string[]', + 'highlightPreTag' => 'string', + 'highlightPostTag' => 'string', + 'snippetEllipsisText' => 'string', + 'restrictHighlightAndSnippetArrays' => 'bool', + 'hitsPerPage' => 'int', + 'minWordSizefor1Typo' => 'int', + 'minWordSizefor2Typos' => 'int', + 'typoTolerance' => 'string', + 'allowTyposOnNumericTokens' => 'bool', + 'disableTypoToleranceOnAttributes' => 'string[]', + 'separatorsToIndex' => 'string', + 'ignorePlurals' => 'string', + 'removeStopWords' => 'string', + 'keepDiacriticsOnCharacters' => 'string', + 'queryLanguages' => 'string[]', + 'decompoundQuery' => 'bool', + 'enableRules' => 'bool', + 'enablePersonalization' => 'bool', + 'queryType' => 'string', + 'removeWordsIfNoResults' => 'string', + 'advancedSyntax' => 'bool', + 'optionalWords' => 'string[]', + 'disableExactOnAttributes' => 'string[]', + 'exactOnSingleWordQuery' => 'string', + 'alternativesAsExact' => 'string[]', + 'advancedSyntaxFeatures' => 'string[]', + 'distinct' => 'int', + 'synonyms' => 'bool', + 'replaceSynonymsInHighlight' => 'bool', + 'minProximity' => 'int', + 'responseFields' => 'string[]', + 'maxFacetHits' => 'int', + 'attributeCriteriaComputedByMinProximity' => 'bool', + 'renderingContent' => 'object', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'similarQuery' => null, + 'filters' => null, + 'facetFilters' => null, + 'optionalFilters' => null, + 'numericFilters' => null, + 'tagFilters' => null, + 'sumOrFiltersScores' => null, + 'facets' => null, + 'maxValuesPerFacet' => null, + 'facetingAfterDistinct' => null, + 'sortFacetValuesBy' => null, + 'page' => null, + 'offset' => null, + 'length' => null, + 'aroundLatLng' => null, + 'aroundLatLngViaIP' => null, + 'aroundRadius' => null, + 'aroundPrecision' => null, + 'minimumAroundRadius' => null, + 'insideBoundingBox' => null, + 'insidePolygon' => null, + 'naturalLanguages' => null, + 'ruleContexts' => null, + 'personalizationImpact' => null, + 'userToken' => null, + 'getRankingInfo' => null, + 'clickAnalytics' => null, + 'analytics' => null, + 'analyticsTags' => null, + 'percentileComputation' => null, + 'enableABTest' => null, + 'enableReRanking' => null, + 'query' => null, + 'searchableAttributes' => null, + 'attributesForFaceting' => null, + 'unretrievableAttributes' => null, + 'attributesToRetrieve' => null, + 'restrictSearchableAttributes' => null, + 'ranking' => null, + 'customRanking' => null, + 'relevancyStrictness' => null, + 'attributesToHighlight' => null, + 'attributesToSnippet' => null, + 'highlightPreTag' => null, + 'highlightPostTag' => null, + 'snippetEllipsisText' => null, + 'restrictHighlightAndSnippetArrays' => null, + 'hitsPerPage' => null, + 'minWordSizefor1Typo' => null, + 'minWordSizefor2Typos' => null, + 'typoTolerance' => null, + 'allowTyposOnNumericTokens' => null, + 'disableTypoToleranceOnAttributes' => null, + 'separatorsToIndex' => null, + 'ignorePlurals' => null, + 'removeStopWords' => null, + 'keepDiacriticsOnCharacters' => null, + 'queryLanguages' => null, + 'decompoundQuery' => null, + 'enableRules' => null, + 'enablePersonalization' => null, + 'queryType' => null, + 'removeWordsIfNoResults' => null, + 'advancedSyntax' => null, + 'optionalWords' => null, + 'disableExactOnAttributes' => null, + 'exactOnSingleWordQuery' => null, + 'alternativesAsExact' => null, + 'advancedSyntaxFeatures' => null, + 'distinct' => null, + 'synonyms' => null, + 'replaceSynonymsInHighlight' => null, + 'minProximity' => null, + 'responseFields' => null, + 'maxFacetHits' => null, + 'attributeCriteriaComputedByMinProximity' => null, + 'renderingContent' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'similarQuery' => 'setSimilarQuery', + 'filters' => 'setFilters', + 'facetFilters' => 'setFacetFilters', + 'optionalFilters' => 'setOptionalFilters', + 'numericFilters' => 'setNumericFilters', + 'tagFilters' => 'setTagFilters', + 'sumOrFiltersScores' => 'setSumOrFiltersScores', + 'facets' => 'setFacets', + 'maxValuesPerFacet' => 'setMaxValuesPerFacet', + 'facetingAfterDistinct' => 'setFacetingAfterDistinct', + 'sortFacetValuesBy' => 'setSortFacetValuesBy', + 'page' => 'setPage', + 'offset' => 'setOffset', + 'length' => 'setLength', + 'aroundLatLng' => 'setAroundLatLng', + 'aroundLatLngViaIP' => 'setAroundLatLngViaIP', + 'aroundRadius' => 'setAroundRadius', + 'aroundPrecision' => 'setAroundPrecision', + 'minimumAroundRadius' => 'setMinimumAroundRadius', + 'insideBoundingBox' => 'setInsideBoundingBox', + 'insidePolygon' => 'setInsidePolygon', + 'naturalLanguages' => 'setNaturalLanguages', + 'ruleContexts' => 'setRuleContexts', + 'personalizationImpact' => 'setPersonalizationImpact', + 'userToken' => 'setUserToken', + 'getRankingInfo' => 'setGetRankingInfo', + 'clickAnalytics' => 'setClickAnalytics', + 'analytics' => 'setAnalytics', + 'analyticsTags' => 'setAnalyticsTags', + 'percentileComputation' => 'setPercentileComputation', + 'enableABTest' => 'setEnableABTest', + 'enableReRanking' => 'setEnableReRanking', + 'query' => 'setQuery', + 'searchableAttributes' => 'setSearchableAttributes', + 'attributesForFaceting' => 'setAttributesForFaceting', + 'unretrievableAttributes' => 'setUnretrievableAttributes', + 'attributesToRetrieve' => 'setAttributesToRetrieve', + 'restrictSearchableAttributes' => 'setRestrictSearchableAttributes', + 'ranking' => 'setRanking', + 'customRanking' => 'setCustomRanking', + 'relevancyStrictness' => 'setRelevancyStrictness', + 'attributesToHighlight' => 'setAttributesToHighlight', + 'attributesToSnippet' => 'setAttributesToSnippet', + 'highlightPreTag' => 'setHighlightPreTag', + 'highlightPostTag' => 'setHighlightPostTag', + 'snippetEllipsisText' => 'setSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'setRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'setHitsPerPage', + 'minWordSizefor1Typo' => 'setMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'setMinWordSizefor2Typos', + 'typoTolerance' => 'setTypoTolerance', + 'allowTyposOnNumericTokens' => 'setAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'setDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'setSeparatorsToIndex', + 'ignorePlurals' => 'setIgnorePlurals', + 'removeStopWords' => 'setRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'setKeepDiacriticsOnCharacters', + 'queryLanguages' => 'setQueryLanguages', + 'decompoundQuery' => 'setDecompoundQuery', + 'enableRules' => 'setEnableRules', + 'enablePersonalization' => 'setEnablePersonalization', + 'queryType' => 'setQueryType', + 'removeWordsIfNoResults' => 'setRemoveWordsIfNoResults', + 'advancedSyntax' => 'setAdvancedSyntax', + 'optionalWords' => 'setOptionalWords', + 'disableExactOnAttributes' => 'setDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'setExactOnSingleWordQuery', + 'alternativesAsExact' => 'setAlternativesAsExact', + 'advancedSyntaxFeatures' => 'setAdvancedSyntaxFeatures', + 'distinct' => 'setDistinct', + 'synonyms' => 'setSynonyms', + 'replaceSynonymsInHighlight' => 'setReplaceSynonymsInHighlight', + 'minProximity' => 'setMinProximity', + 'responseFields' => 'setResponseFields', + 'maxFacetHits' => 'setMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'setAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'setRenderingContent', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'similarQuery' => 'getSimilarQuery', + 'filters' => 'getFilters', + 'facetFilters' => 'getFacetFilters', + 'optionalFilters' => 'getOptionalFilters', + 'numericFilters' => 'getNumericFilters', + 'tagFilters' => 'getTagFilters', + 'sumOrFiltersScores' => 'getSumOrFiltersScores', + 'facets' => 'getFacets', + 'maxValuesPerFacet' => 'getMaxValuesPerFacet', + 'facetingAfterDistinct' => 'getFacetingAfterDistinct', + 'sortFacetValuesBy' => 'getSortFacetValuesBy', + 'page' => 'getPage', + 'offset' => 'getOffset', + 'length' => 'getLength', + 'aroundLatLng' => 'getAroundLatLng', + 'aroundLatLngViaIP' => 'getAroundLatLngViaIP', + 'aroundRadius' => 'getAroundRadius', + 'aroundPrecision' => 'getAroundPrecision', + 'minimumAroundRadius' => 'getMinimumAroundRadius', + 'insideBoundingBox' => 'getInsideBoundingBox', + 'insidePolygon' => 'getInsidePolygon', + 'naturalLanguages' => 'getNaturalLanguages', + 'ruleContexts' => 'getRuleContexts', + 'personalizationImpact' => 'getPersonalizationImpact', + 'userToken' => 'getUserToken', + 'getRankingInfo' => 'getGetRankingInfo', + 'clickAnalytics' => 'getClickAnalytics', + 'analytics' => 'getAnalytics', + 'analyticsTags' => 'getAnalyticsTags', + 'percentileComputation' => 'getPercentileComputation', + 'enableABTest' => 'getEnableABTest', + 'enableReRanking' => 'getEnableReRanking', + 'query' => 'getQuery', + 'searchableAttributes' => 'getSearchableAttributes', + 'attributesForFaceting' => 'getAttributesForFaceting', + 'unretrievableAttributes' => 'getUnretrievableAttributes', + 'attributesToRetrieve' => 'getAttributesToRetrieve', + 'restrictSearchableAttributes' => 'getRestrictSearchableAttributes', + 'ranking' => 'getRanking', + 'customRanking' => 'getCustomRanking', + 'relevancyStrictness' => 'getRelevancyStrictness', + 'attributesToHighlight' => 'getAttributesToHighlight', + 'attributesToSnippet' => 'getAttributesToSnippet', + 'highlightPreTag' => 'getHighlightPreTag', + 'highlightPostTag' => 'getHighlightPostTag', + 'snippetEllipsisText' => 'getSnippetEllipsisText', + 'restrictHighlightAndSnippetArrays' => 'getRestrictHighlightAndSnippetArrays', + 'hitsPerPage' => 'getHitsPerPage', + 'minWordSizefor1Typo' => 'getMinWordSizefor1Typo', + 'minWordSizefor2Typos' => 'getMinWordSizefor2Typos', + 'typoTolerance' => 'getTypoTolerance', + 'allowTyposOnNumericTokens' => 'getAllowTyposOnNumericTokens', + 'disableTypoToleranceOnAttributes' => 'getDisableTypoToleranceOnAttributes', + 'separatorsToIndex' => 'getSeparatorsToIndex', + 'ignorePlurals' => 'getIgnorePlurals', + 'removeStopWords' => 'getRemoveStopWords', + 'keepDiacriticsOnCharacters' => 'getKeepDiacriticsOnCharacters', + 'queryLanguages' => 'getQueryLanguages', + 'decompoundQuery' => 'getDecompoundQuery', + 'enableRules' => 'getEnableRules', + 'enablePersonalization' => 'getEnablePersonalization', + 'queryType' => 'getQueryType', + 'removeWordsIfNoResults' => 'getRemoveWordsIfNoResults', + 'advancedSyntax' => 'getAdvancedSyntax', + 'optionalWords' => 'getOptionalWords', + 'disableExactOnAttributes' => 'getDisableExactOnAttributes', + 'exactOnSingleWordQuery' => 'getExactOnSingleWordQuery', + 'alternativesAsExact' => 'getAlternativesAsExact', + 'advancedSyntaxFeatures' => 'getAdvancedSyntaxFeatures', + 'distinct' => 'getDistinct', + 'synonyms' => 'getSynonyms', + 'replaceSynonymsInHighlight' => 'getReplaceSynonymsInHighlight', + 'minProximity' => 'getMinProximity', + 'responseFields' => 'getResponseFields', + 'maxFacetHits' => 'getMaxFacetHits', + 'attributeCriteriaComputedByMinProximity' => 'getAttributeCriteriaComputedByMinProximity', + 'renderingContent' => 'getRenderingContent', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + const TYPO_TOLERANCE_TRUE = 'true'; + const TYPO_TOLERANCE_FALSE = 'false'; + const TYPO_TOLERANCE_MIN = 'min'; + const TYPO_TOLERANCE_STRICT = 'strict'; + const QUERY_TYPE_PREFIX_LAST = 'prefixLast'; + const QUERY_TYPE_PREFIX_ALL = 'prefixAll'; + const QUERY_TYPE_PREFIX_NONE = 'prefixNone'; + const REMOVE_WORDS_IF_NO_RESULTS_NONE = 'none'; + const REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS = 'lastWords'; + const REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS = 'firstWords'; + const REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL = 'allOptional'; + const EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE = 'attribute'; + const EXACT_ON_SINGLE_WORD_QUERY_NONE = 'none'; + const EXACT_ON_SINGLE_WORD_QUERY_WORD = 'word'; + const ALTERNATIVES_AS_EXACT_IGNORE_PLURALS = 'ignorePlurals'; + const ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM = 'singleWordSynonym'; + const ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM = 'multiWordsSynonym'; + const ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE = 'exactPhrase'; + const ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS = 'excludeWords'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypoToleranceAllowableValues() + { + return [ + self::TYPO_TOLERANCE_TRUE, + self::TYPO_TOLERANCE_FALSE, + self::TYPO_TOLERANCE_MIN, + self::TYPO_TOLERANCE_STRICT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getQueryTypeAllowableValues() + { + return [ + self::QUERY_TYPE_PREFIX_LAST, + self::QUERY_TYPE_PREFIX_ALL, + self::QUERY_TYPE_PREFIX_NONE, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getRemoveWordsIfNoResultsAllowableValues() + { + return [ + self::REMOVE_WORDS_IF_NO_RESULTS_NONE, + self::REMOVE_WORDS_IF_NO_RESULTS_LAST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_FIRST_WORDS, + self::REMOVE_WORDS_IF_NO_RESULTS_ALL_OPTIONAL, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExactOnSingleWordQueryAllowableValues() + { + return [ + self::EXACT_ON_SINGLE_WORD_QUERY_ATTRIBUTE, + self::EXACT_ON_SINGLE_WORD_QUERY_NONE, + self::EXACT_ON_SINGLE_WORD_QUERY_WORD, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAlternativesAsExactAllowableValues() + { + return [ + self::ALTERNATIVES_AS_EXACT_IGNORE_PLURALS, + self::ALTERNATIVES_AS_EXACT_SINGLE_WORD_SYNONYM, + self::ALTERNATIVES_AS_EXACT_MULTI_WORDS_SYNONYM, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getAdvancedSyntaxFeaturesAllowableValues() + { + return [ + self::ADVANCED_SYNTAX_FEATURES_EXACT_PHRASE, + self::ADVANCED_SYNTAX_FEATURES_EXCLUDE_WORDS, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['similarQuery'])) { + $this->container['similarQuery'] = $data['similarQuery']; + } + if (isset($data['filters'])) { + $this->container['filters'] = $data['filters']; + } + 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['tagFilters'])) { + $this->container['tagFilters'] = $data['tagFilters']; + } + if (isset($data['sumOrFiltersScores'])) { + $this->container['sumOrFiltersScores'] = $data['sumOrFiltersScores']; + } + if (isset($data['facets'])) { + $this->container['facets'] = $data['facets']; + } + if (isset($data['maxValuesPerFacet'])) { + $this->container['maxValuesPerFacet'] = $data['maxValuesPerFacet']; + } + if (isset($data['facetingAfterDistinct'])) { + $this->container['facetingAfterDistinct'] = $data['facetingAfterDistinct']; + } + if (isset($data['sortFacetValuesBy'])) { + $this->container['sortFacetValuesBy'] = $data['sortFacetValuesBy']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['offset'])) { + $this->container['offset'] = $data['offset']; + } + if (isset($data['length'])) { + $this->container['length'] = $data['length']; + } + 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['naturalLanguages'])) { + $this->container['naturalLanguages'] = $data['naturalLanguages']; + } + if (isset($data['ruleContexts'])) { + $this->container['ruleContexts'] = $data['ruleContexts']; + } + if (isset($data['personalizationImpact'])) { + $this->container['personalizationImpact'] = $data['personalizationImpact']; + } + if (isset($data['userToken'])) { + $this->container['userToken'] = $data['userToken']; + } + if (isset($data['getRankingInfo'])) { + $this->container['getRankingInfo'] = $data['getRankingInfo']; + } + 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['percentileComputation'])) { + $this->container['percentileComputation'] = $data['percentileComputation']; + } + if (isset($data['enableABTest'])) { + $this->container['enableABTest'] = $data['enableABTest']; + } + if (isset($data['enableReRanking'])) { + $this->container['enableReRanking'] = $data['enableReRanking']; + } + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['searchableAttributes'])) { + $this->container['searchableAttributes'] = $data['searchableAttributes']; + } + if (isset($data['attributesForFaceting'])) { + $this->container['attributesForFaceting'] = $data['attributesForFaceting']; + } + if (isset($data['unretrievableAttributes'])) { + $this->container['unretrievableAttributes'] = $data['unretrievableAttributes']; + } + if (isset($data['attributesToRetrieve'])) { + $this->container['attributesToRetrieve'] = $data['attributesToRetrieve']; + } + if (isset($data['restrictSearchableAttributes'])) { + $this->container['restrictSearchableAttributes'] = $data['restrictSearchableAttributes']; + } + if (isset($data['ranking'])) { + $this->container['ranking'] = $data['ranking']; + } + if (isset($data['customRanking'])) { + $this->container['customRanking'] = $data['customRanking']; + } + if (isset($data['relevancyStrictness'])) { + $this->container['relevancyStrictness'] = $data['relevancyStrictness']; + } + if (isset($data['attributesToHighlight'])) { + $this->container['attributesToHighlight'] = $data['attributesToHighlight']; + } + if (isset($data['attributesToSnippet'])) { + $this->container['attributesToSnippet'] = $data['attributesToSnippet']; + } + if (isset($data['highlightPreTag'])) { + $this->container['highlightPreTag'] = $data['highlightPreTag']; + } + if (isset($data['highlightPostTag'])) { + $this->container['highlightPostTag'] = $data['highlightPostTag']; + } + if (isset($data['snippetEllipsisText'])) { + $this->container['snippetEllipsisText'] = $data['snippetEllipsisText']; + } + if (isset($data['restrictHighlightAndSnippetArrays'])) { + $this->container['restrictHighlightAndSnippetArrays'] = $data['restrictHighlightAndSnippetArrays']; + } + if (isset($data['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + if (isset($data['minWordSizefor1Typo'])) { + $this->container['minWordSizefor1Typo'] = $data['minWordSizefor1Typo']; + } + if (isset($data['minWordSizefor2Typos'])) { + $this->container['minWordSizefor2Typos'] = $data['minWordSizefor2Typos']; + } + if (isset($data['typoTolerance'])) { + $this->container['typoTolerance'] = $data['typoTolerance']; + } + if (isset($data['allowTyposOnNumericTokens'])) { + $this->container['allowTyposOnNumericTokens'] = $data['allowTyposOnNumericTokens']; + } + if (isset($data['disableTypoToleranceOnAttributes'])) { + $this->container['disableTypoToleranceOnAttributes'] = $data['disableTypoToleranceOnAttributes']; + } + if (isset($data['separatorsToIndex'])) { + $this->container['separatorsToIndex'] = $data['separatorsToIndex']; + } + if (isset($data['ignorePlurals'])) { + $this->container['ignorePlurals'] = $data['ignorePlurals']; + } + if (isset($data['removeStopWords'])) { + $this->container['removeStopWords'] = $data['removeStopWords']; + } + if (isset($data['keepDiacriticsOnCharacters'])) { + $this->container['keepDiacriticsOnCharacters'] = $data['keepDiacriticsOnCharacters']; + } + if (isset($data['queryLanguages'])) { + $this->container['queryLanguages'] = $data['queryLanguages']; + } + if (isset($data['decompoundQuery'])) { + $this->container['decompoundQuery'] = $data['decompoundQuery']; + } + if (isset($data['enableRules'])) { + $this->container['enableRules'] = $data['enableRules']; + } + if (isset($data['enablePersonalization'])) { + $this->container['enablePersonalization'] = $data['enablePersonalization']; + } + if (isset($data['queryType'])) { + $this->container['queryType'] = $data['queryType']; + } + if (isset($data['removeWordsIfNoResults'])) { + $this->container['removeWordsIfNoResults'] = $data['removeWordsIfNoResults']; + } + if (isset($data['advancedSyntax'])) { + $this->container['advancedSyntax'] = $data['advancedSyntax']; + } + if (isset($data['optionalWords'])) { + $this->container['optionalWords'] = $data['optionalWords']; + } + if (isset($data['disableExactOnAttributes'])) { + $this->container['disableExactOnAttributes'] = $data['disableExactOnAttributes']; + } + if (isset($data['exactOnSingleWordQuery'])) { + $this->container['exactOnSingleWordQuery'] = $data['exactOnSingleWordQuery']; + } + if (isset($data['alternativesAsExact'])) { + $this->container['alternativesAsExact'] = $data['alternativesAsExact']; + } + if (isset($data['advancedSyntaxFeatures'])) { + $this->container['advancedSyntaxFeatures'] = $data['advancedSyntaxFeatures']; + } + if (isset($data['distinct'])) { + $this->container['distinct'] = $data['distinct']; + } + if (isset($data['synonyms'])) { + $this->container['synonyms'] = $data['synonyms']; + } + if (isset($data['replaceSynonymsInHighlight'])) { + $this->container['replaceSynonymsInHighlight'] = $data['replaceSynonymsInHighlight']; + } + if (isset($data['minProximity'])) { + $this->container['minProximity'] = $data['minProximity']; + } + if (isset($data['responseFields'])) { + $this->container['responseFields'] = $data['responseFields']; + } + if (isset($data['maxFacetHits'])) { + $this->container['maxFacetHits'] = $data['maxFacetHits']; + } + if (isset($data['attributeCriteriaComputedByMinProximity'])) { + $this->container['attributeCriteriaComputedByMinProximity'] = $data['attributeCriteriaComputedByMinProximity']; + } + if (isset($data['renderingContent'])) { + $this->container['renderingContent'] = $data['renderingContent']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (isset($this->container['length']) && ($this->container['length'] > 1000)) { + $invalidProperties[] = "invalid value for 'length', must be smaller than or equal to 1000."; + } + + if (isset($this->container['length']) && ($this->container['length'] < 1)) { + $invalidProperties[] = "invalid value for 'length', must be bigger than or equal to 1."; + } + + if (isset($this->container['minimumAroundRadius']) && ($this->container['minimumAroundRadius'] < 1)) { + $invalidProperties[] = "invalid value for 'minimumAroundRadius', must be bigger than or equal to 1."; + } + + if (!isset($this->container['query']) || $this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (isset($this->container['typoTolerance']) && !in_array($this->container['typoTolerance'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'typoTolerance', must be one of '%s'", + $this->container['typoTolerance'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getQueryTypeAllowableValues(); + if (isset($this->container['queryType']) && !in_array($this->container['queryType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'queryType', must be one of '%s'", + $this->container['queryType'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (isset($this->container['removeWordsIfNoResults']) && !in_array($this->container['removeWordsIfNoResults'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $this->container['removeWordsIfNoResults'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (isset($this->container['exactOnSingleWordQuery']) && !in_array($this->container['exactOnSingleWordQuery'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $this->container['exactOnSingleWordQuery'], + implode("', '", $allowedValues) + ); + } + + if (isset($this->container['distinct']) && ($this->container['distinct'] > 4)) { + $invalidProperties[] = "invalid value for 'distinct', must be smaller than or equal to 4."; + } + + if (isset($this->container['distinct']) && ($this->container['distinct'] < 0)) { + $invalidProperties[] = "invalid value for 'distinct', must be bigger than or equal to 0."; + } + + if (isset($this->container['minProximity']) && ($this->container['minProximity'] > 7)) { + $invalidProperties[] = "invalid value for 'minProximity', must be smaller than or equal to 7."; + } + + if (isset($this->container['minProximity']) && ($this->container['minProximity'] < 1)) { + $invalidProperties[] = "invalid value for 'minProximity', must be bigger than or equal to 1."; + } + + if (isset($this->container['maxFacetHits']) && ($this->container['maxFacetHits'] > 100)) { + $invalidProperties[] = "invalid value for 'maxFacetHits', must be smaller than or equal to 100."; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets similarQuery + * + * @return string|null + */ + public function getSimilarQuery() + { + return $this->container['similarQuery'] ?? null; + } + + /** + * Sets similarQuery + * + * @param string|null $similarQuery overrides the query parameter and performs a more generic search that can be used to find \"similar\" results + * + * @return self + */ + public function setSimilarQuery($similarQuery) + { + $this->container['similarQuery'] = $similarQuery; + + return $this; + } + + /** + * Gets filters + * + * @return string|null + */ + public function getFilters() + { + return $this->container['filters'] ?? null; + } + + /** + * Sets filters + * + * @param string|null $filters filter the query with numeric, facet and/or tag filters + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + + /** + * Gets facetFilters + * + * @return string[]|null + */ + public function getFacetFilters() + { + return $this->container['facetFilters'] ?? null; + } + + /** + * Sets facetFilters + * + * @param string[]|null $facetFilters filter hits by facet value + * + * @return self + */ + public function setFacetFilters($facetFilters) + { + $this->container['facetFilters'] = $facetFilters; + + return $this; + } + + /** + * Gets optionalFilters + * + * @return string[]|null + */ + public function getOptionalFilters() + { + return $this->container['optionalFilters'] ?? null; + } + + /** + * Sets optionalFilters + * + * @param string[]|null $optionalFilters create filters for ranking purposes, where records that match the filter are ranked higher, or lower in the case of a negative optional filter + * + * @return self + */ + public function setOptionalFilters($optionalFilters) + { + $this->container['optionalFilters'] = $optionalFilters; + + return $this; + } + + /** + * Gets numericFilters + * + * @return string[]|null + */ + public function getNumericFilters() + { + return $this->container['numericFilters'] ?? null; + } + + /** + * Sets numericFilters + * + * @param string[]|null $numericFilters filter on numeric attributes + * + * @return self + */ + public function setNumericFilters($numericFilters) + { + $this->container['numericFilters'] = $numericFilters; + + return $this; + } + + /** + * Gets tagFilters + * + * @return string[]|null + */ + public function getTagFilters() + { + return $this->container['tagFilters'] ?? null; + } + + /** + * Sets tagFilters + * + * @param string[]|null $tagFilters filter hits by tags + * + * @return self + */ + public function setTagFilters($tagFilters) + { + $this->container['tagFilters'] = $tagFilters; + + return $this; + } + + /** + * Gets sumOrFiltersScores + * + * @return bool|null + */ + public function getSumOrFiltersScores() + { + return $this->container['sumOrFiltersScores'] ?? null; + } + + /** + * Sets sumOrFiltersScores + * + * @param bool|null $sumOrFiltersScores determines how to calculate the total score for filtering + * + * @return self + */ + public function setSumOrFiltersScores($sumOrFiltersScores) + { + $this->container['sumOrFiltersScores'] = $sumOrFiltersScores; + + return $this; + } + + /** + * Gets facets + * + * @return string[]|null + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets + * + * @param string[]|null $facets retrieve facets and their facet values + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets maxValuesPerFacet + * + * @return int|null + */ + public function getMaxValuesPerFacet() + { + return $this->container['maxValuesPerFacet'] ?? null; + } + + /** + * Sets maxValuesPerFacet + * + * @param int|null $maxValuesPerFacet maximum number of facet values to return for each facet during a regular search + * + * @return self + */ + public function setMaxValuesPerFacet($maxValuesPerFacet) + { + $this->container['maxValuesPerFacet'] = $maxValuesPerFacet; + + return $this; + } + + /** + * Gets facetingAfterDistinct + * + * @return bool|null + */ + public function getFacetingAfterDistinct() + { + return $this->container['facetingAfterDistinct'] ?? null; + } + + /** + * Sets facetingAfterDistinct + * + * @param bool|null $facetingAfterDistinct force faceting to be applied after de-duplication (via the Distinct setting) + * + * @return self + */ + public function setFacetingAfterDistinct($facetingAfterDistinct) + { + $this->container['facetingAfterDistinct'] = $facetingAfterDistinct; + + return $this; + } + + /** + * Gets sortFacetValuesBy + * + * @return string|null + */ + public function getSortFacetValuesBy() + { + return $this->container['sortFacetValuesBy'] ?? null; + } + + /** + * Sets sortFacetValuesBy + * + * @param string|null $sortFacetValuesBy controls how facet values are fetched + * + * @return self + */ + public function setSortFacetValuesBy($sortFacetValuesBy) + { + $this->container['sortFacetValuesBy'] = $sortFacetValuesBy; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int|null $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets offset + * + * @return int|null + */ + public function getOffset() + { + return $this->container['offset'] ?? null; + } + + /** + * Sets offset + * + * @param int|null $offset specify the offset of the first hit to return + * + * @return self + */ + public function setOffset($offset) + { + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets length + * + * @return int|null + */ + public function getLength() + { + return $this->container['length'] ?? null; + } + + /** + * Sets length + * + * @param int|null $length set the number of hits to retrieve (used only with offset) + * + * @return self + */ + public function setLength($length) + { + if (!is_null($length) && ($length > 1000)) { + throw new \InvalidArgumentException('invalid value for $length when calling SearchParamsObject., must be smaller than or equal to 1000.'); + } + if (!is_null($length) && ($length < 1)) { + throw new \InvalidArgumentException('invalid value for $length when calling SearchParamsObject., must be bigger than or equal to 1.'); + } + + $this->container['length'] = $length; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng'] ?? null; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng search for entries around a central geolocation, enabling a geo search within a circular area + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets aroundLatLngViaIP + * + * @return bool|null + */ + public function getAroundLatLngViaIP() + { + return $this->container['aroundLatLngViaIP'] ?? null; + } + + /** + * Sets aroundLatLngViaIP + * + * @param bool|null $aroundLatLngViaIP search for entries around a given location automatically computed from the requester's IP address + * + * @return self + */ + public function setAroundLatLngViaIP($aroundLatLngViaIP) + { + $this->container['aroundLatLngViaIP'] = $aroundLatLngViaIP; + + return $this; + } + + /** + * Gets aroundRadius + * + * @return \Algolia\AlgoliaSearch\Model\Search\AroundRadius|null + */ + public function getAroundRadius() + { + return $this->container['aroundRadius'] ?? null; + } + + /** + * Sets aroundRadius + * + * @param \Algolia\AlgoliaSearch\Model\Search\AroundRadius|null $aroundRadius aroundRadius + * + * @return self + */ + public function setAroundRadius($aroundRadius) + { + $this->container['aroundRadius'] = $aroundRadius; + + return $this; + } + + /** + * Gets aroundPrecision + * + * @return int|null + */ + public function getAroundPrecision() + { + return $this->container['aroundPrecision'] ?? null; + } + + /** + * Sets aroundPrecision + * + * @param int|null $aroundPrecision precision of geo search (in meters), to add grouping by geo location to the ranking formula + * + * @return self + */ + public function setAroundPrecision($aroundPrecision) + { + $this->container['aroundPrecision'] = $aroundPrecision; + + return $this; + } + + /** + * Gets minimumAroundRadius + * + * @return int|null + */ + public function getMinimumAroundRadius() + { + return $this->container['minimumAroundRadius'] ?? null; + } + + /** + * Sets minimumAroundRadius + * + * @param int|null $minimumAroundRadius minimum radius (in meters) used for a geo search when aroundRadius is not set + * + * @return self + */ + public function setMinimumAroundRadius($minimumAroundRadius) + { + if (!is_null($minimumAroundRadius) && ($minimumAroundRadius < 1)) { + throw new \InvalidArgumentException('invalid value for $minimumAroundRadius when calling SearchParamsObject., must be bigger than or equal to 1.'); + } + + $this->container['minimumAroundRadius'] = $minimumAroundRadius; + + return $this; + } + + /** + * Gets insideBoundingBox + * + * @return float[]|null + */ + public function getInsideBoundingBox() + { + return $this->container['insideBoundingBox'] ?? null; + } + + /** + * Sets insideBoundingBox + * + * @param float[]|null $insideBoundingBox search inside a rectangular area (in geo coordinates) + * + * @return self + */ + public function setInsideBoundingBox($insideBoundingBox) + { + $this->container['insideBoundingBox'] = $insideBoundingBox; + + return $this; + } + + /** + * Gets insidePolygon + * + * @return float[]|null + */ + public function getInsidePolygon() + { + return $this->container['insidePolygon'] ?? null; + } + + /** + * Sets insidePolygon + * + * @param float[]|null $insidePolygon search inside a polygon (in geo coordinates) + * + * @return self + */ + public function setInsidePolygon($insidePolygon) + { + $this->container['insidePolygon'] = $insidePolygon; + + return $this; + } + + /** + * Gets naturalLanguages + * + * @return string[]|null + */ + public function getNaturalLanguages() + { + return $this->container['naturalLanguages'] ?? null; + } + + /** + * Sets naturalLanguages + * + * @param string[]|null $naturalLanguages This parameter changes the default values of certain parameters and settings that work best for a natural language query, such as ignorePlurals, removeStopWords, removeWordsIfNoResults, analyticsTags and ruleContexts. These parameters and settings work well together when the query is formatted in natural language instead of keywords, for example when your user performs a voice search. + * + * @return self + */ + public function setNaturalLanguages($naturalLanguages) + { + $this->container['naturalLanguages'] = $naturalLanguages; + + return $this; + } + + /** + * Gets ruleContexts + * + * @return string[]|null + */ + public function getRuleContexts() + { + return $this->container['ruleContexts'] ?? null; + } + + /** + * Sets ruleContexts + * + * @param string[]|null $ruleContexts enables contextual rules + * + * @return self + */ + public function setRuleContexts($ruleContexts) + { + $this->container['ruleContexts'] = $ruleContexts; + + return $this; + } + + /** + * Gets personalizationImpact + * + * @return int|null + */ + public function getPersonalizationImpact() + { + return $this->container['personalizationImpact'] ?? null; + } + + /** + * Sets personalizationImpact + * + * @param int|null $personalizationImpact define the impact of the Personalization feature + * + * @return self + */ + public function setPersonalizationImpact($personalizationImpact) + { + $this->container['personalizationImpact'] = $personalizationImpact; + + return $this; + } + + /** + * Gets userToken + * + * @return string|null + */ + public function getUserToken() + { + return $this->container['userToken'] ?? null; + } + + /** + * Sets userToken + * + * @param string|null $userToken associates a certain user token with the current search + * + * @return self + */ + public function setUserToken($userToken) + { + $this->container['userToken'] = $userToken; + + return $this; + } + + /** + * Gets getRankingInfo + * + * @return bool|null + */ + public function getGetRankingInfo() + { + return $this->container['getRankingInfo'] ?? null; + } + + /** + * Sets getRankingInfo + * + * @param bool|null $getRankingInfo retrieve detailed ranking information + * + * @return self + */ + public function setGetRankingInfo($getRankingInfo) + { + $this->container['getRankingInfo'] = $getRankingInfo; + + return $this; + } + + /** + * Gets clickAnalytics + * + * @return bool|null + */ + public function getClickAnalytics() + { + return $this->container['clickAnalytics'] ?? null; + } + + /** + * Sets clickAnalytics + * + * @param bool|null $clickAnalytics enable the Click Analytics feature + * + * @return self + */ + public function setClickAnalytics($clickAnalytics) + { + $this->container['clickAnalytics'] = $clickAnalytics; + + return $this; + } + + /** + * Gets analytics + * + * @return bool|null + */ + public function getAnalytics() + { + return $this->container['analytics'] ?? null; + } + + /** + * Sets analytics + * + * @param bool|null $analytics whether the current query will be taken into account in the Analytics + * + * @return self + */ + public function setAnalytics($analytics) + { + $this->container['analytics'] = $analytics; + + return $this; + } + + /** + * Gets analyticsTags + * + * @return string[]|null + */ + public function getAnalyticsTags() + { + return $this->container['analyticsTags'] ?? null; + } + + /** + * Sets analyticsTags + * + * @param string[]|null $analyticsTags list of tags to apply to the query for analytics purposes + * + * @return self + */ + public function setAnalyticsTags($analyticsTags) + { + $this->container['analyticsTags'] = $analyticsTags; + + return $this; + } + + /** + * Gets percentileComputation + * + * @return bool|null + */ + public function getPercentileComputation() + { + return $this->container['percentileComputation'] ?? null; + } + + /** + * Sets percentileComputation + * + * @param bool|null $percentileComputation whether to include or exclude a query from the processing-time percentile computation + * + * @return self + */ + public function setPercentileComputation($percentileComputation) + { + $this->container['percentileComputation'] = $percentileComputation; + + return $this; + } + + /** + * Gets enableABTest + * + * @return bool|null + */ + public function getEnableABTest() + { + return $this->container['enableABTest'] ?? null; + } + + /** + * Sets enableABTest + * + * @param bool|null $enableABTest whether this search should participate in running AB tests + * + * @return self + */ + public function setEnableABTest($enableABTest) + { + $this->container['enableABTest'] = $enableABTest; + + return $this; + } + + /** + * Gets enableReRanking + * + * @return bool|null + */ + public function getEnableReRanking() + { + return $this->container['enableReRanking'] ?? null; + } + + /** + * Sets enableReRanking + * + * @param bool|null $enableReRanking whether this search should use AI Re-Ranking + * + * @return self + */ + public function setEnableReRanking($enableReRanking) + { + $this->container['enableReRanking'] = $enableReRanking; + + return $this; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets searchableAttributes + * + * @return string[]|null + */ + public function getSearchableAttributes() + { + return $this->container['searchableAttributes'] ?? null; + } + + /** + * Sets searchableAttributes + * + * @param string[]|null $searchableAttributes the complete list of attributes used for searching + * + * @return self + */ + public function setSearchableAttributes($searchableAttributes) + { + $this->container['searchableAttributes'] = $searchableAttributes; + + return $this; + } + + /** + * Gets attributesForFaceting + * + * @return string[]|null + */ + public function getAttributesForFaceting() + { + return $this->container['attributesForFaceting'] ?? null; + } + + /** + * Sets attributesForFaceting + * + * @param string[]|null $attributesForFaceting the complete list of attributes that will be used for faceting + * + * @return self + */ + public function setAttributesForFaceting($attributesForFaceting) + { + $this->container['attributesForFaceting'] = $attributesForFaceting; + + return $this; + } + + /** + * Gets unretrievableAttributes + * + * @return string[]|null + */ + public function getUnretrievableAttributes() + { + return $this->container['unretrievableAttributes'] ?? null; + } + + /** + * Sets unretrievableAttributes + * + * @param string[]|null $unretrievableAttributes list of attributes that can't be retrieved at query time + * + * @return self + */ + public function setUnretrievableAttributes($unretrievableAttributes) + { + $this->container['unretrievableAttributes'] = $unretrievableAttributes; + + return $this; + } + + /** + * Gets attributesToRetrieve + * + * @return string[]|null + */ + public function getAttributesToRetrieve() + { + return $this->container['attributesToRetrieve'] ?? null; + } + + /** + * Sets attributesToRetrieve + * + * @param string[]|null $attributesToRetrieve this parameter controls which attributes to retrieve and which not to retrieve + * + * @return self + */ + public function setAttributesToRetrieve($attributesToRetrieve) + { + $this->container['attributesToRetrieve'] = $attributesToRetrieve; + + return $this; + } + + /** + * Gets restrictSearchableAttributes + * + * @return string[]|null + */ + public function getRestrictSearchableAttributes() + { + return $this->container['restrictSearchableAttributes'] ?? null; + } + + /** + * Sets restrictSearchableAttributes + * + * @param string[]|null $restrictSearchableAttributes restricts a given query to look in only a subset of your searchable attributes + * + * @return self + */ + public function setRestrictSearchableAttributes($restrictSearchableAttributes) + { + $this->container['restrictSearchableAttributes'] = $restrictSearchableAttributes; + + return $this; + } + + /** + * Gets ranking + * + * @return string[]|null + */ + public function getRanking() + { + return $this->container['ranking'] ?? null; + } + + /** + * Sets ranking + * + * @param string[]|null $ranking controls how Algolia should sort your results + * + * @return self + */ + public function setRanking($ranking) + { + $this->container['ranking'] = $ranking; + + return $this; + } + + /** + * Gets customRanking + * + * @return string[]|null + */ + public function getCustomRanking() + { + return $this->container['customRanking'] ?? null; + } + + /** + * Sets customRanking + * + * @param string[]|null $customRanking specifies the custom ranking criterion + * + * @return self + */ + public function setCustomRanking($customRanking) + { + $this->container['customRanking'] = $customRanking; + + return $this; + } + + /** + * Gets relevancyStrictness + * + * @return int|null + */ + public function getRelevancyStrictness() + { + return $this->container['relevancyStrictness'] ?? null; + } + + /** + * Sets relevancyStrictness + * + * @param int|null $relevancyStrictness controls the relevancy threshold below which less relevant results aren't included in the results + * + * @return self + */ + public function setRelevancyStrictness($relevancyStrictness) + { + $this->container['relevancyStrictness'] = $relevancyStrictness; + + return $this; + } + + /** + * Gets attributesToHighlight + * + * @return string[]|null + */ + public function getAttributesToHighlight() + { + return $this->container['attributesToHighlight'] ?? null; + } + + /** + * Sets attributesToHighlight + * + * @param string[]|null $attributesToHighlight list of attributes to highlight + * + * @return self + */ + public function setAttributesToHighlight($attributesToHighlight) + { + $this->container['attributesToHighlight'] = $attributesToHighlight; + + return $this; + } + + /** + * Gets attributesToSnippet + * + * @return string[]|null + */ + public function getAttributesToSnippet() + { + return $this->container['attributesToSnippet'] ?? null; + } + + /** + * Sets attributesToSnippet + * + * @param string[]|null $attributesToSnippet list of attributes to snippet, with an optional maximum number of words to snippet + * + * @return self + */ + public function setAttributesToSnippet($attributesToSnippet) + { + $this->container['attributesToSnippet'] = $attributesToSnippet; + + return $this; + } + + /** + * Gets highlightPreTag + * + * @return string|null + */ + public function getHighlightPreTag() + { + return $this->container['highlightPreTag'] ?? null; + } + + /** + * Sets highlightPreTag + * + * @param string|null $highlightPreTag the HTML string to insert before the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPreTag($highlightPreTag) + { + $this->container['highlightPreTag'] = $highlightPreTag; + + return $this; + } + + /** + * Gets highlightPostTag + * + * @return string|null + */ + public function getHighlightPostTag() + { + return $this->container['highlightPostTag'] ?? null; + } + + /** + * Sets highlightPostTag + * + * @param string|null $highlightPostTag the HTML string to insert after the highlighted parts in all highlight and snippet results + * + * @return self + */ + public function setHighlightPostTag($highlightPostTag) + { + $this->container['highlightPostTag'] = $highlightPostTag; + + return $this; + } + + /** + * Gets snippetEllipsisText + * + * @return string|null + */ + public function getSnippetEllipsisText() + { + return $this->container['snippetEllipsisText'] ?? null; + } + + /** + * Sets snippetEllipsisText + * + * @param string|null $snippetEllipsisText string used as an ellipsis indicator when a snippet is truncated + * + * @return self + */ + public function setSnippetEllipsisText($snippetEllipsisText) + { + $this->container['snippetEllipsisText'] = $snippetEllipsisText; + + return $this; + } + + /** + * Gets restrictHighlightAndSnippetArrays + * + * @return bool|null + */ + public function getRestrictHighlightAndSnippetArrays() + { + return $this->container['restrictHighlightAndSnippetArrays'] ?? null; + } + + /** + * Sets restrictHighlightAndSnippetArrays + * + * @param bool|null $restrictHighlightAndSnippetArrays restrict highlighting and snippeting to items that matched the query + * + * @return self + */ + public function setRestrictHighlightAndSnippetArrays($restrictHighlightAndSnippetArrays) + { + $this->container['restrictHighlightAndSnippetArrays'] = $restrictHighlightAndSnippetArrays; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets minWordSizefor1Typo + * + * @return int|null + */ + public function getMinWordSizefor1Typo() + { + return $this->container['minWordSizefor1Typo'] ?? null; + } + + /** + * Sets minWordSizefor1Typo + * + * @param int|null $minWordSizefor1Typo minimum number of characters a word in the query string must contain to accept matches with 1 typo + * + * @return self + */ + public function setMinWordSizefor1Typo($minWordSizefor1Typo) + { + $this->container['minWordSizefor1Typo'] = $minWordSizefor1Typo; + + return $this; + } + + /** + * Gets minWordSizefor2Typos + * + * @return int|null + */ + public function getMinWordSizefor2Typos() + { + return $this->container['minWordSizefor2Typos'] ?? null; + } + + /** + * Sets minWordSizefor2Typos + * + * @param int|null $minWordSizefor2Typos minimum number of characters a word in the query string must contain to accept matches with 2 typos + * + * @return self + */ + public function setMinWordSizefor2Typos($minWordSizefor2Typos) + { + $this->container['minWordSizefor2Typos'] = $minWordSizefor2Typos; + + return $this; + } + + /** + * Gets typoTolerance + * + * @return string|null + */ + public function getTypoTolerance() + { + return $this->container['typoTolerance'] ?? null; + } + + /** + * Sets typoTolerance + * + * @param string|null $typoTolerance controls whether typo tolerance is enabled and how it is applied + * + * @return self + */ + public function setTypoTolerance($typoTolerance) + { + $allowedValues = $this->getTypoToleranceAllowableValues(); + if (!is_null($typoTolerance) && !in_array($typoTolerance, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'typoTolerance', must be one of '%s'", + $typoTolerance, + implode("', '", $allowedValues) + ) + ); + } + $this->container['typoTolerance'] = $typoTolerance; + + return $this; + } + + /** + * Gets allowTyposOnNumericTokens + * + * @return bool|null + */ + public function getAllowTyposOnNumericTokens() + { + return $this->container['allowTyposOnNumericTokens'] ?? null; + } + + /** + * Sets allowTyposOnNumericTokens + * + * @param bool|null $allowTyposOnNumericTokens whether to allow typos on numbers (\"numeric tokens\") in the query string + * + * @return self + */ + public function setAllowTyposOnNumericTokens($allowTyposOnNumericTokens) + { + $this->container['allowTyposOnNumericTokens'] = $allowTyposOnNumericTokens; + + return $this; + } + + /** + * Gets disableTypoToleranceOnAttributes + * + * @return string[]|null + */ + public function getDisableTypoToleranceOnAttributes() + { + return $this->container['disableTypoToleranceOnAttributes'] ?? null; + } + + /** + * Sets disableTypoToleranceOnAttributes + * + * @param string[]|null $disableTypoToleranceOnAttributes list of attributes on which you want to disable typo tolerance + * + * @return self + */ + public function setDisableTypoToleranceOnAttributes($disableTypoToleranceOnAttributes) + { + $this->container['disableTypoToleranceOnAttributes'] = $disableTypoToleranceOnAttributes; + + return $this; + } + + /** + * Gets separatorsToIndex + * + * @return string|null + */ + public function getSeparatorsToIndex() + { + return $this->container['separatorsToIndex'] ?? null; + } + + /** + * Sets separatorsToIndex + * + * @param string|null $separatorsToIndex control which separators are indexed + * + * @return self + */ + public function setSeparatorsToIndex($separatorsToIndex) + { + $this->container['separatorsToIndex'] = $separatorsToIndex; + + return $this; + } + + /** + * Gets ignorePlurals + * + * @return string|null + */ + public function getIgnorePlurals() + { + return $this->container['ignorePlurals'] ?? null; + } + + /** + * Sets ignorePlurals + * + * @param string|null $ignorePlurals treats singular, plurals, and other forms of declensions as matching terms + * + * @return self + */ + public function setIgnorePlurals($ignorePlurals) + { + $this->container['ignorePlurals'] = $ignorePlurals; + + return $this; + } + + /** + * Gets removeStopWords + * + * @return string|null + */ + public function getRemoveStopWords() + { + return $this->container['removeStopWords'] ?? null; + } + + /** + * Sets removeStopWords + * + * @param string|null $removeStopWords removes stop (common) words from the query before executing it + * + * @return self + */ + public function setRemoveStopWords($removeStopWords) + { + $this->container['removeStopWords'] = $removeStopWords; + + return $this; + } + + /** + * Gets keepDiacriticsOnCharacters + * + * @return string|null + */ + public function getKeepDiacriticsOnCharacters() + { + return $this->container['keepDiacriticsOnCharacters'] ?? null; + } + + /** + * Sets keepDiacriticsOnCharacters + * + * @param string|null $keepDiacriticsOnCharacters list of characters that the engine shouldn't automatically normalize + * + * @return self + */ + public function setKeepDiacriticsOnCharacters($keepDiacriticsOnCharacters) + { + $this->container['keepDiacriticsOnCharacters'] = $keepDiacriticsOnCharacters; + + return $this; + } + + /** + * Gets queryLanguages + * + * @return string[]|null + */ + public function getQueryLanguages() + { + return $this->container['queryLanguages'] ?? null; + } + + /** + * Sets queryLanguages + * + * @param string[]|null $queryLanguages sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection + * + * @return self + */ + public function setQueryLanguages($queryLanguages) + { + $this->container['queryLanguages'] = $queryLanguages; + + return $this; + } + + /** + * Gets decompoundQuery + * + * @return bool|null + */ + public function getDecompoundQuery() + { + return $this->container['decompoundQuery'] ?? null; + } + + /** + * Sets decompoundQuery + * + * @param bool|null $decompoundQuery splits compound words into their composing atoms in the query + * + * @return self + */ + public function setDecompoundQuery($decompoundQuery) + { + $this->container['decompoundQuery'] = $decompoundQuery; + + return $this; + } + + /** + * Gets enableRules + * + * @return bool|null + */ + public function getEnableRules() + { + return $this->container['enableRules'] ?? null; + } + + /** + * Sets enableRules + * + * @param bool|null $enableRules whether Rules should be globally enabled + * + * @return self + */ + public function setEnableRules($enableRules) + { + $this->container['enableRules'] = $enableRules; + + return $this; + } + + /** + * Gets enablePersonalization + * + * @return bool|null + */ + public function getEnablePersonalization() + { + return $this->container['enablePersonalization'] ?? null; + } + + /** + * Sets enablePersonalization + * + * @param bool|null $enablePersonalization enable the Personalization feature + * + * @return self + */ + public function setEnablePersonalization($enablePersonalization) + { + $this->container['enablePersonalization'] = $enablePersonalization; + + return $this; + } + + /** + * Gets queryType + * + * @return string|null + */ + public function getQueryType() + { + return $this->container['queryType'] ?? null; + } + + /** + * Sets queryType + * + * @param string|null $queryType controls if and how query words are interpreted as prefixes + * + * @return self + */ + public function setQueryType($queryType) + { + $allowedValues = $this->getQueryTypeAllowableValues(); + if (!is_null($queryType) && !in_array($queryType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'queryType', must be one of '%s'", + $queryType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['queryType'] = $queryType; + + return $this; + } + + /** + * Gets removeWordsIfNoResults + * + * @return string|null + */ + public function getRemoveWordsIfNoResults() + { + return $this->container['removeWordsIfNoResults'] ?? null; + } + + /** + * Sets removeWordsIfNoResults + * + * @param string|null $removeWordsIfNoResults selects a strategy to remove words from the query when it doesn't match any hits + * + * @return self + */ + public function setRemoveWordsIfNoResults($removeWordsIfNoResults) + { + $allowedValues = $this->getRemoveWordsIfNoResultsAllowableValues(); + if (!is_null($removeWordsIfNoResults) && !in_array($removeWordsIfNoResults, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'removeWordsIfNoResults', must be one of '%s'", + $removeWordsIfNoResults, + implode("', '", $allowedValues) + ) + ); + } + $this->container['removeWordsIfNoResults'] = $removeWordsIfNoResults; + + return $this; + } + + /** + * Gets advancedSyntax + * + * @return bool|null + */ + public function getAdvancedSyntax() + { + return $this->container['advancedSyntax'] ?? null; + } + + /** + * Sets advancedSyntax + * + * @param bool|null $advancedSyntax enables the advanced query syntax + * + * @return self + */ + public function setAdvancedSyntax($advancedSyntax) + { + $this->container['advancedSyntax'] = $advancedSyntax; + + return $this; + } + + /** + * Gets optionalWords + * + * @return string[]|null + */ + public function getOptionalWords() + { + return $this->container['optionalWords'] ?? null; + } + + /** + * Sets optionalWords + * + * @param string[]|null $optionalWords a list of words that should be considered as optional when found in the query + * + * @return self + */ + public function setOptionalWords($optionalWords) + { + $this->container['optionalWords'] = $optionalWords; + + return $this; + } + + /** + * Gets disableExactOnAttributes + * + * @return string[]|null + */ + public function getDisableExactOnAttributes() + { + return $this->container['disableExactOnAttributes'] ?? null; + } + + /** + * Sets disableExactOnAttributes + * + * @param string[]|null $disableExactOnAttributes list of attributes on which you want to disable the exact ranking criterion + * + * @return self + */ + public function setDisableExactOnAttributes($disableExactOnAttributes) + { + $this->container['disableExactOnAttributes'] = $disableExactOnAttributes; + + return $this; + } + + /** + * Gets exactOnSingleWordQuery + * + * @return string|null + */ + public function getExactOnSingleWordQuery() + { + return $this->container['exactOnSingleWordQuery'] ?? null; + } + + /** + * Sets exactOnSingleWordQuery + * + * @param string|null $exactOnSingleWordQuery controls how the exact ranking criterion is computed when the query contains only one word + * + * @return self + */ + public function setExactOnSingleWordQuery($exactOnSingleWordQuery) + { + $allowedValues = $this->getExactOnSingleWordQueryAllowableValues(); + if (!is_null($exactOnSingleWordQuery) && !in_array($exactOnSingleWordQuery, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'exactOnSingleWordQuery', must be one of '%s'", + $exactOnSingleWordQuery, + implode("', '", $allowedValues) + ) + ); + } + $this->container['exactOnSingleWordQuery'] = $exactOnSingleWordQuery; + + return $this; + } + + /** + * Gets alternativesAsExact + * + * @return string[]|null + */ + public function getAlternativesAsExact() + { + return $this->container['alternativesAsExact'] ?? null; + } + + /** + * Sets alternativesAsExact + * + * @param string[]|null $alternativesAsExact list of alternatives that should be considered an exact match by the exact ranking criterion + * + * @return self + */ + public function setAlternativesAsExact($alternativesAsExact) + { + $allowedValues = $this->getAlternativesAsExactAllowableValues(); + if (!is_null($alternativesAsExact) && array_diff($alternativesAsExact, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'alternativesAsExact', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['alternativesAsExact'] = $alternativesAsExact; + + return $this; + } + + /** + * Gets advancedSyntaxFeatures + * + * @return string[]|null + */ + public function getAdvancedSyntaxFeatures() + { + return $this->container['advancedSyntaxFeatures'] ?? null; + } + + /** + * Sets advancedSyntaxFeatures + * + * @param string[]|null $advancedSyntaxFeatures allows you to specify which advanced syntax features are active when ‘advancedSyntax' is enabled + * + * @return self + */ + public function setAdvancedSyntaxFeatures($advancedSyntaxFeatures) + { + $allowedValues = $this->getAdvancedSyntaxFeaturesAllowableValues(); + if (!is_null($advancedSyntaxFeatures) && array_diff($advancedSyntaxFeatures, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'advancedSyntaxFeatures', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['advancedSyntaxFeatures'] = $advancedSyntaxFeatures; + + return $this; + } + + /** + * Gets distinct + * + * @return int|null + */ + public function getDistinct() + { + return $this->container['distinct'] ?? null; + } + + /** + * Sets distinct + * + * @param int|null $distinct enables de-duplication or grouping of results + * + * @return self + */ + public function setDistinct($distinct) + { + if (!is_null($distinct) && ($distinct > 4)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling SearchParamsObject., must be smaller than or equal to 4.'); + } + if (!is_null($distinct) && ($distinct < 0)) { + throw new \InvalidArgumentException('invalid value for $distinct when calling SearchParamsObject., must be bigger than or equal to 0.'); + } + + $this->container['distinct'] = $distinct; + + return $this; + } + + /** + * Gets synonyms + * + * @return bool|null + */ + public function getSynonyms() + { + return $this->container['synonyms'] ?? null; + } + + /** + * Sets synonyms + * + * @param bool|null $synonyms whether to take into account an index's synonyms for a particular search + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets replaceSynonymsInHighlight + * + * @return bool|null + */ + public function getReplaceSynonymsInHighlight() + { + return $this->container['replaceSynonymsInHighlight'] ?? null; + } + + /** + * Sets replaceSynonymsInHighlight + * + * @param bool|null $replaceSynonymsInHighlight whether to highlight and snippet the original word that matches the synonym or the synonym itself + * + * @return self + */ + public function setReplaceSynonymsInHighlight($replaceSynonymsInHighlight) + { + $this->container['replaceSynonymsInHighlight'] = $replaceSynonymsInHighlight; + + return $this; + } + + /** + * Gets minProximity + * + * @return int|null + */ + public function getMinProximity() + { + return $this->container['minProximity'] ?? null; + } + + /** + * Sets minProximity + * + * @param int|null $minProximity precision of the proximity ranking criterion + * + * @return self + */ + public function setMinProximity($minProximity) + { + if (!is_null($minProximity) && ($minProximity > 7)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling SearchParamsObject., must be smaller than or equal to 7.'); + } + if (!is_null($minProximity) && ($minProximity < 1)) { + throw new \InvalidArgumentException('invalid value for $minProximity when calling SearchParamsObject., must be bigger than or equal to 1.'); + } + + $this->container['minProximity'] = $minProximity; + + return $this; + } + + /** + * Gets responseFields + * + * @return string[]|null + */ + public function getResponseFields() + { + return $this->container['responseFields'] ?? null; + } + + /** + * Sets responseFields + * + * @param string[]|null $responseFields Choose which fields to return in the API response. This parameters applies to search and browse queries. + * + * @return self + */ + public function setResponseFields($responseFields) + { + $this->container['responseFields'] = $responseFields; + + return $this; + } + + /** + * Gets maxFacetHits + * + * @return int|null + */ + public function getMaxFacetHits() + { + return $this->container['maxFacetHits'] ?? null; + } + + /** + * Sets maxFacetHits + * + * @param int|null $maxFacetHits Maximum number of facet hits to return during a search for facet values. For performance reasons, the maximum allowed number of returned values is 100. + * + * @return self + */ + public function setMaxFacetHits($maxFacetHits) + { + if (!is_null($maxFacetHits) && ($maxFacetHits > 100)) { + throw new \InvalidArgumentException('invalid value for $maxFacetHits when calling SearchParamsObject., must be smaller than or equal to 100.'); + } + + $this->container['maxFacetHits'] = $maxFacetHits; + + return $this; + } + + /** + * Gets attributeCriteriaComputedByMinProximity + * + * @return bool|null + */ + public function getAttributeCriteriaComputedByMinProximity() + { + return $this->container['attributeCriteriaComputedByMinProximity'] ?? null; + } + + /** + * Sets attributeCriteriaComputedByMinProximity + * + * @param bool|null $attributeCriteriaComputedByMinProximity when attribute is ranked above proximity in your ranking formula, proximity is used to select which searchable attribute is matched in the attribute ranking stage + * + * @return self + */ + public function setAttributeCriteriaComputedByMinProximity($attributeCriteriaComputedByMinProximity) + { + $this->container['attributeCriteriaComputedByMinProximity'] = $attributeCriteriaComputedByMinProximity; + + return $this; + } + + /** + * Gets renderingContent + * + * @return object|null + */ + public function getRenderingContent() + { + return $this->container['renderingContent'] ?? null; + } + + /** + * Sets renderingContent + * + * @param object|null $renderingContent Content defining how the search interface should be rendered. Can be set via the settings for a default value and can be overridden via rules. + * + * @return self + */ + public function setRenderingContent($renderingContent) + { + $this->container['renderingContent'] = $renderingContent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchParamsString.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchParamsString.php new file mode 100644 index 0000000000..c11a6fee91 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchParamsString.php @@ -0,0 +1,207 @@ + 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'params' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'params' => 'setParams', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'params' => 'getParams', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['params'])) { + $this->container['params'] = $data['params']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets params + * + * @return string|null + */ + public function getParams() + { + return $this->container['params'] ?? null; + } + + /** + * Sets params + * + * @param string|null $params search parameters as URL-encoded query string + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchResponse.php new file mode 100644 index 0000000000..ac17d4f9d2 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchResponse.php @@ -0,0 +1,990 @@ + 'int', + 'abTestVariantID' => 'int', + 'aroundLatLng' => 'string', + 'automaticRadius' => 'string', + 'exhaustiveFacetsCount' => 'bool', + 'exhaustiveNbHits' => 'bool', + 'exhaustiveTypo' => 'bool', + 'facets' => 'array>', + 'facetsStats' => 'array', + 'hitsPerPage' => 'int', + 'index' => 'string', + 'indexUsed' => 'string', + 'message' => 'string', + 'nbHits' => 'int', + 'nbPages' => 'int', + 'nbSortedHits' => 'int', + 'page' => 'int', + 'params' => 'string', + 'parsedQuery' => 'string', + 'processingTimeMS' => 'int', + 'query' => 'string', + 'queryAfterRemoval' => 'string', + 'serverUsed' => 'string', + 'userData' => 'object', + 'hits' => '\Algolia\AlgoliaSearch\Model\Search\Hit[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'abTestID' => null, + 'abTestVariantID' => null, + 'aroundLatLng' => null, + 'automaticRadius' => null, + 'exhaustiveFacetsCount' => null, + 'exhaustiveNbHits' => null, + 'exhaustiveTypo' => null, + 'facets' => null, + 'facetsStats' => null, + 'hitsPerPage' => null, + 'index' => null, + 'indexUsed' => null, + 'message' => null, + 'nbHits' => null, + 'nbPages' => null, + 'nbSortedHits' => null, + 'page' => null, + 'params' => null, + 'parsedQuery' => null, + 'processingTimeMS' => null, + 'query' => null, + 'queryAfterRemoval' => null, + 'serverUsed' => null, + 'userData' => null, + 'hits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'abTestID' => 'setAbTestID', + 'abTestVariantID' => 'setAbTestVariantID', + 'aroundLatLng' => 'setAroundLatLng', + 'automaticRadius' => 'setAutomaticRadius', + 'exhaustiveFacetsCount' => 'setExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'setExhaustiveNbHits', + 'exhaustiveTypo' => 'setExhaustiveTypo', + 'facets' => 'setFacets', + 'facetsStats' => 'setFacetsStats', + 'hitsPerPage' => 'setHitsPerPage', + 'index' => 'setIndex', + 'indexUsed' => 'setIndexUsed', + 'message' => 'setMessage', + 'nbHits' => 'setNbHits', + 'nbPages' => 'setNbPages', + 'nbSortedHits' => 'setNbSortedHits', + 'page' => 'setPage', + 'params' => 'setParams', + 'parsedQuery' => 'setParsedQuery', + 'processingTimeMS' => 'setProcessingTimeMS', + 'query' => 'setQuery', + 'queryAfterRemoval' => 'setQueryAfterRemoval', + 'serverUsed' => 'setServerUsed', + 'userData' => 'setUserData', + 'hits' => 'setHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'abTestID' => 'getAbTestID', + 'abTestVariantID' => 'getAbTestVariantID', + 'aroundLatLng' => 'getAroundLatLng', + 'automaticRadius' => 'getAutomaticRadius', + 'exhaustiveFacetsCount' => 'getExhaustiveFacetsCount', + 'exhaustiveNbHits' => 'getExhaustiveNbHits', + 'exhaustiveTypo' => 'getExhaustiveTypo', + 'facets' => 'getFacets', + 'facetsStats' => 'getFacetsStats', + 'hitsPerPage' => 'getHitsPerPage', + 'index' => 'getIndex', + 'indexUsed' => 'getIndexUsed', + 'message' => 'getMessage', + 'nbHits' => 'getNbHits', + 'nbPages' => 'getNbPages', + 'nbSortedHits' => 'getNbSortedHits', + 'page' => 'getPage', + 'params' => 'getParams', + 'parsedQuery' => 'getParsedQuery', + 'processingTimeMS' => 'getProcessingTimeMS', + 'query' => 'getQuery', + 'queryAfterRemoval' => 'getQueryAfterRemoval', + 'serverUsed' => 'getServerUsed', + 'userData' => 'getUserData', + 'hits' => 'getHits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['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['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['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + 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['nbHits'])) { + $this->container['nbHits'] = $data['nbHits']; + } + if (isset($data['nbPages'])) { + $this->container['nbPages'] = $data['nbPages']; + } + if (isset($data['nbSortedHits'])) { + $this->container['nbSortedHits'] = $data['nbSortedHits']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['params'])) { + $this->container['params'] = $data['params']; + } + if (isset($data['parsedQuery'])) { + $this->container['parsedQuery'] = $data['parsedQuery']; + } + if (isset($data['processingTimeMS'])) { + $this->container['processingTimeMS'] = $data['processingTimeMS']; + } + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['queryAfterRemoval'])) { + $this->container['queryAfterRemoval'] = $data['queryAfterRemoval']; + } + if (isset($data['serverUsed'])) { + $this->container['serverUsed'] = $data['serverUsed']; + } + if (isset($data['userData'])) { + $this->container['userData'] = $data['userData']; + } + if (isset($data['hits'])) { + $this->container['hits'] = $data['hits']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (isset($this->container['aroundLatLng']) && !preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $this->container['aroundLatLng'])) { + $invalidProperties[] = "invalid value for 'aroundLatLng', must be conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."; + } + + if (!isset($this->container['exhaustiveNbHits']) || $this->container['exhaustiveNbHits'] === null) { + $invalidProperties[] = "'exhaustiveNbHits' can't be null"; + } + if (!isset($this->container['exhaustiveTypo']) || $this->container['exhaustiveTypo'] === null) { + $invalidProperties[] = "'exhaustiveTypo' can't be null"; + } + if (!isset($this->container['hitsPerPage']) || $this->container['hitsPerPage'] === null) { + $invalidProperties[] = "'hitsPerPage' can't be null"; + } + if (!isset($this->container['nbHits']) || $this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if (!isset($this->container['nbPages']) || $this->container['nbPages'] === null) { + $invalidProperties[] = "'nbPages' can't be null"; + } + if (!isset($this->container['page']) || $this->container['page'] === null) { + $invalidProperties[] = "'page' can't be null"; + } + if (!isset($this->container['params']) || $this->container['params'] === null) { + $invalidProperties[] = "'params' can't be null"; + } + if (!isset($this->container['processingTimeMS']) || $this->container['processingTimeMS'] === null) { + $invalidProperties[] = "'processingTimeMS' can't be null"; + } + if (!isset($this->container['query']) || $this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + if (!isset($this->container['hits']) || $this->container['hits'] === null) { + $invalidProperties[] = "'hits' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets abTestID + * + * @return int|null + */ + public function getAbTestID() + { + return $this->container['abTestID'] ?? null; + } + + /** + * Sets abTestID + * + * @param int|null $abTestID if a search encounters an index that is being A/B tested, abTestID reports the ongoing A/B test ID + * + * @return self + */ + public function setAbTestID($abTestID) + { + $this->container['abTestID'] = $abTestID; + + return $this; + } + + /** + * Gets abTestVariantID + * + * @return int|null + */ + public function getAbTestVariantID() + { + return $this->container['abTestVariantID'] ?? null; + } + + /** + * Sets abTestVariantID + * + * @param int|null $abTestVariantID if a search encounters an index that is being A/B tested, abTestVariantID reports the variant ID of the index used + * + * @return self + */ + public function setAbTestVariantID($abTestVariantID) + { + $this->container['abTestVariantID'] = $abTestVariantID; + + return $this; + } + + /** + * Gets aroundLatLng + * + * @return string|null + */ + public function getAroundLatLng() + { + return $this->container['aroundLatLng'] ?? null; + } + + /** + * Sets aroundLatLng + * + * @param string|null $aroundLatLng the computed geo location + * + * @return self + */ + public function setAroundLatLng($aroundLatLng) + { + if (!is_null($aroundLatLng) && (!preg_match('/^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/', $aroundLatLng))) { + throw new \InvalidArgumentException("invalid value for $aroundLatLng when calling SearchResponse., must conform to the pattern /^(-?\\d+(\\.\\d+)?),\\s*(-?\\d+(\\.\\d+)?)$/."); + } + + $this->container['aroundLatLng'] = $aroundLatLng; + + return $this; + } + + /** + * Gets automaticRadius + * + * @return string|null + */ + public function getAutomaticRadius() + { + return $this->container['automaticRadius'] ?? null; + } + + /** + * Sets automaticRadius + * + * @param string|null $automaticRadius The automatically computed radius. For legacy reasons, this parameter is a string and not an integer. + * + * @return self + */ + public function setAutomaticRadius($automaticRadius) + { + $this->container['automaticRadius'] = $automaticRadius; + + return $this; + } + + /** + * Gets exhaustiveFacetsCount + * + * @return bool|null + */ + public function getExhaustiveFacetsCount() + { + return $this->container['exhaustiveFacetsCount'] ?? null; + } + + /** + * Sets exhaustiveFacetsCount + * + * @param bool|null $exhaustiveFacetsCount whether the facet count is exhaustive or approximate + * + * @return self + */ + public function setExhaustiveFacetsCount($exhaustiveFacetsCount) + { + $this->container['exhaustiveFacetsCount'] = $exhaustiveFacetsCount; + + return $this; + } + + /** + * Gets exhaustiveNbHits + * + * @return bool + */ + public function getExhaustiveNbHits() + { + return $this->container['exhaustiveNbHits'] ?? null; + } + + /** + * Sets exhaustiveNbHits + * + * @param bool $exhaustiveNbHits indicate if the nbHits count was exhaustive or approximate + * + * @return self + */ + public function setExhaustiveNbHits($exhaustiveNbHits) + { + $this->container['exhaustiveNbHits'] = $exhaustiveNbHits; + + return $this; + } + + /** + * Gets exhaustiveTypo + * + * @return bool + */ + public function getExhaustiveTypo() + { + return $this->container['exhaustiveTypo'] ?? null; + } + + /** + * Sets exhaustiveTypo + * + * @param bool $exhaustiveTypo indicate if the typo-tolerence search was exhaustive or approximate (only included when typo-tolerance is enabled) + * + * @return self + */ + public function setExhaustiveTypo($exhaustiveTypo) + { + $this->container['exhaustiveTypo'] = $exhaustiveTypo; + + return $this; + } + + /** + * Gets facets + * + * @return array>|null + */ + public function getFacets() + { + return $this->container['facets'] ?? null; + } + + /** + * Sets facets + * + * @param array>|null $facets a mapping of each facet name to the corresponding facet counts + * + * @return self + */ + public function setFacets($facets) + { + $this->container['facets'] = $facets; + + return $this; + } + + /** + * Gets facetsStats + * + * @return array|null + */ + public function getFacetsStats() + { + return $this->container['facetsStats'] ?? null; + } + + /** + * Sets facetsStats + * + * @param array|null $facetsStats statistics for numerical facets + * + * @return self + */ + public function setFacetsStats($facetsStats) + { + $this->container['facetsStats'] = $facetsStats; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets index + * + * @return string|null + */ + public function getIndex() + { + return $this->container['index'] ?? null; + } + + /** + * Sets index + * + * @param string|null $index index name used for the query + * + * @return self + */ + public function setIndex($index) + { + $this->container['index'] = $index; + + return $this; + } + + /** + * Gets indexUsed + * + * @return string|null + */ + public function getIndexUsed() + { + return $this->container['indexUsed'] ?? null; + } + + /** + * Sets indexUsed + * + * @param string|null $indexUsed Index name used for the query. In the case of an A/B test, the targeted index isn't always the index used by the query. + * + * @return self + */ + public function setIndexUsed($indexUsed) + { + $this->container['indexUsed'] = $indexUsed; + + return $this; + } + + /** + * Gets message + * + * @return string|null + */ + public function getMessage() + { + return $this->container['message'] ?? null; + } + + /** + * Sets message + * + * @param string|null $message used to return warnings about the query + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits'] ?? null; + } + + /** + * Sets nbHits + * + * @param int $nbHits number of hits that the search query matched + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets nbPages + * + * @return int + */ + public function getNbPages() + { + return $this->container['nbPages'] ?? null; + } + + /** + * Sets nbPages + * + * @param int $nbPages number of pages available for the current query + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + + /** + * Gets nbSortedHits + * + * @return int|null + */ + public function getNbSortedHits() + { + return $this->container['nbSortedHits'] ?? null; + } + + /** + * Sets nbSortedHits + * + * @param int|null $nbSortedHits the number of hits selected and sorted by the relevant sort algorithm + * + * @return self + */ + public function setNbSortedHits($nbSortedHits) + { + $this->container['nbSortedHits'] = $nbSortedHits; + + return $this; + } + + /** + * Gets page + * + * @return int + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets params + * + * @return string + */ + public function getParams() + { + return $this->container['params'] ?? null; + } + + /** + * Sets params + * + * @param string $params a url-encoded string of all search parameters + * + * @return self + */ + public function setParams($params) + { + $this->container['params'] = $params; + + return $this; + } + + /** + * Gets parsedQuery + * + * @return string|null + */ + public function getParsedQuery() + { + return $this->container['parsedQuery'] ?? null; + } + + /** + * Sets parsedQuery + * + * @param string|null $parsedQuery the query string that will be searched, after normalization + * + * @return self + */ + public function setParsedQuery($parsedQuery) + { + $this->container['parsedQuery'] = $parsedQuery; + + return $this; + } + + /** + * Gets processingTimeMS + * + * @return int + */ + public function getProcessingTimeMS() + { + return $this->container['processingTimeMS'] ?? 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 query + * + * @return string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string $query the text to search in the index + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets queryAfterRemoval + * + * @return string|null + */ + public function getQueryAfterRemoval() + { + return $this->container['queryAfterRemoval'] ?? null; + } + + /** + * Sets queryAfterRemoval + * + * @param string|null $queryAfterRemoval a markup text indicating which parts of the original query have been removed in order to retrieve a non-empty result set + * + * @return self + */ + public function setQueryAfterRemoval($queryAfterRemoval) + { + $this->container['queryAfterRemoval'] = $queryAfterRemoval; + + return $this; + } + + /** + * Gets serverUsed + * + * @return string|null + */ + public function getServerUsed() + { + return $this->container['serverUsed'] ?? null; + } + + /** + * Sets serverUsed + * + * @param string|null $serverUsed actual host name of the server that processed the request + * + * @return self + */ + public function setServerUsed($serverUsed) + { + $this->container['serverUsed'] = $serverUsed; + + return $this; + } + + /** + * Gets userData + * + * @return object|null + */ + public function getUserData() + { + return $this->container['userData'] ?? null; + } + + /** + * Sets userData + * + * @param object|null $userData lets you store custom data in your indices + * + * @return self + */ + public function setUserData($userData) + { + $this->container['userData'] = $userData; + + return $this; + } + + /** + * Gets hits + * + * @return \Algolia\AlgoliaSearch\Model\Search\Hit[] + */ + public function getHits() + { + return $this->container['hits'] ?? null; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Search\Hit[] $hits hits + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchRulesParams.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchRulesParams.php new file mode 100644 index 0000000000..c63b33b270 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchRulesParams.php @@ -0,0 +1,395 @@ + 'string', + 'anchoring' => '\Algolia\AlgoliaSearch\Model\Search\Anchoring', + 'context' => 'string', + 'page' => 'int', + 'hitsPerPage' => 'int', + 'enabled' => 'bool', + 'requestOptions' => 'object[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'query' => null, + 'anchoring' => null, + 'context' => null, + 'page' => null, + 'hitsPerPage' => null, + 'enabled' => null, + 'requestOptions' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'anchoring' => 'setAnchoring', + 'context' => 'setContext', + 'page' => 'setPage', + 'hitsPerPage' => 'setHitsPerPage', + 'enabled' => 'setEnabled', + 'requestOptions' => 'setRequestOptions', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'anchoring' => 'getAnchoring', + 'context' => 'getContext', + 'page' => 'getPage', + 'hitsPerPage' => 'getHitsPerPage', + 'enabled' => 'getEnabled', + 'requestOptions' => 'getRequestOptions', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['anchoring'])) { + $this->container['anchoring'] = $data['anchoring']; + } + if (isset($data['context'])) { + $this->container['context'] = $data['context']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + if (isset($data['enabled'])) { + $this->container['enabled'] = $data['enabled']; + } + if (isset($data['requestOptions'])) { + $this->container['requestOptions'] = $data['requestOptions']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets query + * + * @return string|null + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string|null $query full text query + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets anchoring + * + * @return \Algolia\AlgoliaSearch\Model\Search\Anchoring|null + */ + public function getAnchoring() + { + return $this->container['anchoring'] ?? null; + } + + /** + * Sets anchoring + * + * @param \Algolia\AlgoliaSearch\Model\Search\Anchoring|null $anchoring anchoring + * + * @return self + */ + public function setAnchoring($anchoring) + { + $this->container['anchoring'] = $anchoring; + + return $this; + } + + /** + * Gets context + * + * @return string|null + */ + public function getContext() + { + return $this->container['context'] ?? null; + } + + /** + * Sets context + * + * @param string|null $context restricts matches to contextual rules with a specific context (exact match) + * + * @return self + */ + public function setContext($context) + { + $this->container['context'] = $context; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int|null $page requested page (zero-based) + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage Maximum number of hits in a page. Minimum is 1, maximum is 1000. + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled'] ?? null; + } + + /** + * Sets enabled + * + * @param bool|null $enabled When specified, restricts matches to rules with a specific enabled status. When absent (default), all rules are retrieved, regardless of their enabled status. + * + * @return self + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets requestOptions + * + * @return object[]|null + */ + public function getRequestOptions() + { + return $this->container['requestOptions'] ?? null; + } + + /** + * Sets requestOptions + * + * @param object[]|null $requestOptions a mapping of requestOptions to send along with the request + * + * @return self + */ + public function setRequestOptions($requestOptions) + { + $this->container['requestOptions'] = $requestOptions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchRulesResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchRulesResponse.php new file mode 100644 index 0000000000..41e878736d --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchRulesResponse.php @@ -0,0 +1,313 @@ + '\Algolia\AlgoliaSearch\Model\Search\Rule[]', + 'nbHits' => 'int', + 'page' => 'int', + 'nbPages' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'hits' => null, + 'nbHits' => null, + 'page' => null, + 'nbPages' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits', + 'nbHits' => 'setNbHits', + 'page' => 'setPage', + 'nbPages' => 'setNbPages', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits', + 'nbHits' => 'getNbHits', + 'page' => 'getPage', + 'nbPages' => 'getNbPages', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['hits'])) { + $this->container['hits'] = $data['hits']; + } + if (isset($data['nbHits'])) { + $this->container['nbHits'] = $data['nbHits']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['nbPages'])) { + $this->container['nbPages'] = $data['nbPages']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['hits']) || $this->container['hits'] === null) { + $invalidProperties[] = "'hits' can't be null"; + } + if (!isset($this->container['nbHits']) || $this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if (!isset($this->container['page']) || $this->container['page'] === null) { + $invalidProperties[] = "'page' can't be null"; + } + if (!isset($this->container['nbPages']) || $this->container['nbPages'] === null) { + $invalidProperties[] = "'nbPages' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets hits + * + * @return \Algolia\AlgoliaSearch\Model\Search\Rule[] + */ + public function getHits() + { + return $this->container['hits'] ?? null; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Search\Rule[] $hits fetched rules + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits'] ?? null; + } + + /** + * Sets nbHits + * + * @param int $nbHits number of fetched rules + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets page + * + * @return int + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int $page current page + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets nbPages + * + * @return int + */ + public function getNbPages() + { + return $this->container['nbPages'] ?? null; + } + + /** + * Sets nbPages + * + * @param int $nbPages number of pages + * + * @return self + */ + public function setNbPages($nbPages) + { + $this->container['nbPages'] = $nbPages; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchSynonymsResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchSynonymsResponse.php new file mode 100644 index 0000000000..3fb6ecabfa --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchSynonymsResponse.php @@ -0,0 +1,245 @@ + '\Algolia\AlgoliaSearch\Model\Search\SynonymHit[]', + 'nbHits' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'hits' => null, + 'nbHits' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits', + 'nbHits' => 'setNbHits', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits', + 'nbHits' => 'getNbHits', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['hits'])) { + $this->container['hits'] = $data['hits']; + } + if (isset($data['nbHits'])) { + $this->container['nbHits'] = $data['nbHits']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['hits']) || $this->container['hits'] === null) { + $invalidProperties[] = "'hits' can't be null"; + } + if (!isset($this->container['nbHits']) || $this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets hits + * + * @return \Algolia\AlgoliaSearch\Model\Search\SynonymHit[] + */ + public function getHits() + { + return $this->container['hits'] ?? null; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Search\SynonymHit[] $hits array of synonym objects + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits'] ?? null; + } + + /** + * Sets nbHits + * + * @param int $nbHits number of hits that the search query matched + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsParams.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsParams.php new file mode 100644 index 0000000000..3704f98cd9 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsParams.php @@ -0,0 +1,306 @@ + 'string', + 'clusterName' => 'string', + 'page' => 'int', + 'hitsPerPage' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'query' => null, + 'clusterName' => null, + 'page' => null, + 'hitsPerPage' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'query' => 'setQuery', + 'clusterName' => 'setClusterName', + 'page' => 'setPage', + 'hitsPerPage' => 'setHitsPerPage', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'query' => 'getQuery', + 'clusterName' => 'getClusterName', + 'page' => 'getPage', + 'hitsPerPage' => 'getHitsPerPage', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['query'])) { + $this->container['query'] = $data['query']; + } + if (isset($data['clusterName'])) { + $this->container['clusterName'] = $data['clusterName']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['query']) || $this->container['query'] === null) { + $invalidProperties[] = "'query' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets query + * + * @return string + */ + public function getQuery() + { + return $this->container['query'] ?? null; + } + + /** + * Sets query + * + * @param string $query Query to search. The search is a prefix search with typoTolerance. Use empty query to retrieve all users. + * + * @return self + */ + public function setQuery($query) + { + $this->container['query'] = $query; + + return $this; + } + + /** + * Gets clusterName + * + * @return string|null + */ + public function getClusterName() + { + return $this->container['clusterName'] ?? null; + } + + /** + * Sets clusterName + * + * @param string|null $clusterName name of the cluster + * + * @return self + */ + public function setClusterName($clusterName) + { + $this->container['clusterName'] = $clusterName; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int|null $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int|null + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int|null $hitsPerPage set the number of hits per page + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponse.php new file mode 100644 index 0000000000..a6a52c0ca6 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponse.php @@ -0,0 +1,349 @@ + '\Algolia\AlgoliaSearch\Model\Search\SearchUserIdsResponseHits[]', + 'nbHits' => 'int', + 'page' => 'int', + 'hitsPerPage' => 'int', + 'updatedAt' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'hits' => null, + 'nbHits' => null, + 'page' => null, + 'hitsPerPage' => null, + 'updatedAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hits' => 'setHits', + 'nbHits' => 'setNbHits', + 'page' => 'setPage', + 'hitsPerPage' => 'setHitsPerPage', + 'updatedAt' => 'setUpdatedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hits' => 'getHits', + 'nbHits' => 'getNbHits', + 'page' => 'getPage', + 'hitsPerPage' => 'getHitsPerPage', + 'updatedAt' => 'getUpdatedAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['hits'])) { + $this->container['hits'] = $data['hits']; + } + if (isset($data['nbHits'])) { + $this->container['nbHits'] = $data['nbHits']; + } + if (isset($data['page'])) { + $this->container['page'] = $data['page']; + } + if (isset($data['hitsPerPage'])) { + $this->container['hitsPerPage'] = $data['hitsPerPage']; + } + if (isset($data['updatedAt'])) { + $this->container['updatedAt'] = $data['updatedAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['hits']) || $this->container['hits'] === null) { + $invalidProperties[] = "'hits' can't be null"; + } + if (!isset($this->container['nbHits']) || $this->container['nbHits'] === null) { + $invalidProperties[] = "'nbHits' can't be null"; + } + if (!isset($this->container['page']) || $this->container['page'] === null) { + $invalidProperties[] = "'page' can't be null"; + } + if (!isset($this->container['hitsPerPage']) || $this->container['hitsPerPage'] === null) { + $invalidProperties[] = "'hitsPerPage' can't be null"; + } + if (!isset($this->container['updatedAt']) || $this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets hits + * + * @return \Algolia\AlgoliaSearch\Model\Search\SearchUserIdsResponseHits[] + */ + public function getHits() + { + return $this->container['hits'] ?? null; + } + + /** + * Sets hits + * + * @param \Algolia\AlgoliaSearch\Model\Search\SearchUserIdsResponseHits[] $hits list of user object matching the query + * + * @return self + */ + public function setHits($hits) + { + $this->container['hits'] = $hits; + + return $this; + } + + /** + * Gets nbHits + * + * @return int + */ + public function getNbHits() + { + return $this->container['nbHits'] ?? null; + } + + /** + * Sets nbHits + * + * @param int $nbHits number of hits that the search query matched + * + * @return self + */ + public function setNbHits($nbHits) + { + $this->container['nbHits'] = $nbHits; + + return $this; + } + + /** + * Gets page + * + * @return int + */ + public function getPage() + { + return $this->container['page'] ?? null; + } + + /** + * Sets page + * + * @param int $page specify the page to retrieve + * + * @return self + */ + public function setPage($page) + { + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets hitsPerPage + * + * @return int + */ + public function getHitsPerPage() + { + return $this->container['hitsPerPage'] ?? null; + } + + /** + * Sets hitsPerPage + * + * @param int $hitsPerPage Maximum number of hits in a page. Minimum is 1, maximum is 1000. + * + * @return self + */ + public function setHitsPerPage($hitsPerPage) + { + $this->container['hitsPerPage'] = $hitsPerPage; + + return $this; + } + + /** + * Gets updatedAt + * + * @return string + */ + public function getUpdatedAt() + { + return $this->container['updatedAt'] ?? null; + } + + /** + * Sets updatedAt + * + * @param string $updatedAt date of last update (ISO-8601 format) + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponseHighlightResult.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponseHighlightResult.php new file mode 100644 index 0000000000..fde739b937 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponseHighlightResult.php @@ -0,0 +1,245 @@ + '\Algolia\AlgoliaSearch\Model\Search\HighlightResult', + 'clusterName' => '\Algolia\AlgoliaSearch\Model\Search\HighlightResult', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'userID' => null, + 'clusterName' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userID' => 'setUserID', + 'clusterName' => 'setClusterName', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userID' => 'getUserID', + 'clusterName' => 'getClusterName', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['userID'])) { + $this->container['userID'] = $data['userID']; + } + if (isset($data['clusterName'])) { + $this->container['clusterName'] = $data['clusterName']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['userID']) || $this->container['userID'] === null) { + $invalidProperties[] = "'userID' can't be null"; + } + if (!isset($this->container['clusterName']) || $this->container['clusterName'] === null) { + $invalidProperties[] = "'clusterName' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets userID + * + * @return \Algolia\AlgoliaSearch\Model\Search\HighlightResult + */ + public function getUserID() + { + return $this->container['userID'] ?? null; + } + + /** + * Sets userID + * + * @param \Algolia\AlgoliaSearch\Model\Search\HighlightResult $userID userID + * + * @return self + */ + public function setUserID($userID) + { + $this->container['userID'] = $userID; + + return $this; + } + + /** + * Gets clusterName + * + * @return \Algolia\AlgoliaSearch\Model\Search\HighlightResult + */ + public function getClusterName() + { + return $this->container['clusterName'] ?? null; + } + + /** + * Sets clusterName + * + * @param \Algolia\AlgoliaSearch\Model\Search\HighlightResult $clusterName clusterName + * + * @return self + */ + public function setClusterName($clusterName) + { + $this->container['clusterName'] = $clusterName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponseHits.php b/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponseHits.php new file mode 100644 index 0000000000..c459e1d994 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SearchUserIdsResponseHits.php @@ -0,0 +1,389 @@ + 'string', + 'clusterName' => 'string', + 'nbRecords' => 'int', + 'dataSize' => 'int', + 'objectID' => 'string', + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\Search\SearchUserIdsResponseHighlightResult', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'userID' => null, + 'clusterName' => null, + 'nbRecords' => null, + 'dataSize' => null, + 'objectID' => null, + 'highlightResult' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userID' => 'setUserID', + 'clusterName' => 'setClusterName', + 'nbRecords' => 'setNbRecords', + 'dataSize' => 'setDataSize', + 'objectID' => 'setObjectID', + 'highlightResult' => 'setHighlightResult', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userID' => 'getUserID', + 'clusterName' => 'getClusterName', + 'nbRecords' => 'getNbRecords', + 'dataSize' => 'getDataSize', + 'objectID' => 'getObjectID', + 'highlightResult' => 'getHighlightResult', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['userID'])) { + $this->container['userID'] = $data['userID']; + } + if (isset($data['clusterName'])) { + $this->container['clusterName'] = $data['clusterName']; + } + if (isset($data['nbRecords'])) { + $this->container['nbRecords'] = $data['nbRecords']; + } + if (isset($data['dataSize'])) { + $this->container['dataSize'] = $data['dataSize']; + } + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + if (isset($data['highlightResult'])) { + $this->container['highlightResult'] = $data['highlightResult']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['userID']) || $this->container['userID'] === null) { + $invalidProperties[] = "'userID' can't be null"; + } + if (!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $this->container['userID'])) { + $invalidProperties[] = "invalid value for 'userID', must be conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."; + } + + if (!isset($this->container['clusterName']) || $this->container['clusterName'] === null) { + $invalidProperties[] = "'clusterName' can't be null"; + } + if (!isset($this->container['nbRecords']) || $this->container['nbRecords'] === null) { + $invalidProperties[] = "'nbRecords' can't be null"; + } + if (!isset($this->container['dataSize']) || $this->container['dataSize'] === null) { + $invalidProperties[] = "'dataSize' can't be null"; + } + if (!isset($this->container['objectID']) || $this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if (!isset($this->container['highlightResult']) || $this->container['highlightResult'] === null) { + $invalidProperties[] = "'highlightResult' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets userID + * + * @return string + */ + public function getUserID() + { + return $this->container['userID'] ?? null; + } + + /** + * Sets userID + * + * @param string $userID userID of the user + * + * @return self + */ + public function setUserID($userID) + { + if ((!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $userID))) { + throw new \InvalidArgumentException("invalid value for $userID when calling SearchUserIdsResponseHits., must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."); + } + + $this->container['userID'] = $userID; + + return $this; + } + + /** + * Gets clusterName + * + * @return string + */ + public function getClusterName() + { + return $this->container['clusterName'] ?? null; + } + + /** + * Sets clusterName + * + * @param string $clusterName name of the cluster + * + * @return self + */ + public function setClusterName($clusterName) + { + $this->container['clusterName'] = $clusterName; + + return $this; + } + + /** + * Gets nbRecords + * + * @return int + */ + public function getNbRecords() + { + return $this->container['nbRecords'] ?? null; + } + + /** + * Sets nbRecords + * + * @param int $nbRecords number of records in the cluster + * + * @return self + */ + public function setNbRecords($nbRecords) + { + $this->container['nbRecords'] = $nbRecords; + + return $this; + } + + /** + * Gets dataSize + * + * @return int + */ + public function getDataSize() + { + return $this->container['dataSize'] ?? null; + } + + /** + * Sets dataSize + * + * @param int $dataSize data size taken by all the users assigned to the cluster + * + * @return self + */ + public function setDataSize($dataSize) + { + $this->container['dataSize'] = $dataSize; + + return $this; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string $objectID userID of the requested user. Same as userID. + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets highlightResult + * + * @return \Algolia\AlgoliaSearch\Model\Search\SearchUserIdsResponseHighlightResult + */ + public function getHighlightResult() + { + return $this->container['highlightResult'] ?? null; + } + + /** + * Sets highlightResult + * + * @param \Algolia\AlgoliaSearch\Model\Search\SearchUserIdsResponseHighlightResult $highlightResult highlightResult + * + * @return self + */ + public function setHighlightResult($highlightResult) + { + $this->container['highlightResult'] = $highlightResult; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SnippetResult.php b/clients/algoliasearch-client-php/lib/Model/Search/SnippetResult.php new file mode 100644 index 0000000000..0192dd423a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SnippetResult.php @@ -0,0 +1,275 @@ + 'string', + 'matchLevel' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'value' => null, + 'matchLevel' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'matchLevel' => 'setMatchLevel', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'matchLevel' => 'getMatchLevel', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + const MATCH_LEVEL_NONE = 'none'; + const MATCH_LEVEL_PARTIAL = 'partial'; + const MATCH_LEVEL_FULL = 'full'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getMatchLevelAllowableValues() + { + return [ + self::MATCH_LEVEL_NONE, + self::MATCH_LEVEL_PARTIAL, + self::MATCH_LEVEL_FULL, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['value'])) { + $this->container['value'] = $data['value']; + } + if (isset($data['matchLevel'])) { + $this->container['matchLevel'] = $data['matchLevel']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getMatchLevelAllowableValues(); + if (isset($this->container['matchLevel']) && !in_array($this->container['matchLevel'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'matchLevel', must be one of '%s'", + $this->container['matchLevel'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value'] ?? null; + } + + /** + * Sets value + * + * @param string|null $value markup text with occurrences highlighted + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets matchLevel + * + * @return string|null + */ + public function getMatchLevel() + { + return $this->container['matchLevel'] ?? null; + } + + /** + * Sets matchLevel + * + * @param string|null $matchLevel indicates how well the attribute matched the search query + * + * @return self + */ + public function setMatchLevel($matchLevel) + { + $allowedValues = $this->getMatchLevelAllowableValues(); + if (!is_null($matchLevel) && !in_array($matchLevel, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'matchLevel', must be one of '%s'", + $matchLevel, + implode("', '", $allowedValues) + ) + ); + } + $this->container['matchLevel'] = $matchLevel; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/Source.php b/clients/algoliasearch-client-php/lib/Model/Search/Source.php new file mode 100644 index 0000000000..2624a7a4d4 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/Source.php @@ -0,0 +1,244 @@ + 'string', + 'description' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'source' => null, + 'description' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'source' => 'setSource', + 'description' => 'setDescription', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'source' => 'getSource', + 'description' => 'getDescription', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['source'])) { + $this->container['source'] = $data['source']; + } + if (isset($data['description'])) { + $this->container['description'] = $data['description']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['source']) || $this->container['source'] === null) { + $invalidProperties[] = "'source' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets source + * + * @return string + */ + public function getSource() + { + return $this->container['source'] ?? null; + } + + /** + * Sets source + * + * @param string $source the IP range of the source + * + * @return self + */ + public function setSource($source) + { + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description'] ?? null; + } + + /** + * Sets description + * + * @param string|null $description the description of the source + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/StandardEntries.php b/clients/algoliasearch-client-php/lib/Model/Search/StandardEntries.php new file mode 100644 index 0000000000..bee131cd13 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/StandardEntries.php @@ -0,0 +1,271 @@ + 'array', + 'stopwords' => 'array', + 'compounds' => 'array', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'plurals' => null, + 'stopwords' => null, + 'compounds' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'plurals' => 'setPlurals', + 'stopwords' => 'setStopwords', + 'compounds' => 'setCompounds', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'plurals' => 'getPlurals', + 'stopwords' => 'getStopwords', + 'compounds' => 'getCompounds', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['plurals'])) { + $this->container['plurals'] = $data['plurals']; + } + if (isset($data['stopwords'])) { + $this->container['stopwords'] = $data['stopwords']; + } + if (isset($data['compounds'])) { + $this->container['compounds'] = $data['compounds']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets plurals + * + * @return array|null + */ + public function getPlurals() + { + return $this->container['plurals'] ?? null; + } + + /** + * Sets plurals + * + * @param array|null $plurals language ISO code + * + * @return self + */ + public function setPlurals($plurals) + { + $this->container['plurals'] = $plurals; + + return $this; + } + + /** + * Gets stopwords + * + * @return array|null + */ + public function getStopwords() + { + return $this->container['stopwords'] ?? null; + } + + /** + * Sets stopwords + * + * @param array|null $stopwords language ISO code + * + * @return self + */ + public function setStopwords($stopwords) + { + $this->container['stopwords'] = $stopwords; + + return $this; + } + + /** + * Gets compounds + * + * @return array|null + */ + public function getCompounds() + { + return $this->container['compounds'] ?? null; + } + + /** + * Sets compounds + * + * @param array|null $compounds language ISO code + * + * @return self + */ + public function setCompounds($compounds) + { + $this->container['compounds'] = $compounds; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SynonymHit.php b/clients/algoliasearch-client-php/lib/Model/Search/SynonymHit.php new file mode 100644 index 0000000000..bc33925714 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SynonymHit.php @@ -0,0 +1,464 @@ + 'string', + 'type' => '\Algolia\AlgoliaSearch\Model\Search\SynonymType', + 'synonyms' => 'string[]', + 'input' => 'string', + 'word' => 'string', + 'corrections' => 'string[]', + 'placeholder' => 'string', + 'replacements' => 'string[]', + 'highlightResult' => '\Algolia\AlgoliaSearch\Model\Search\SynonymHitHighlightResult', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'objectID' => null, + 'type' => null, + 'synonyms' => null, + 'input' => null, + 'word' => null, + 'corrections' => null, + 'placeholder' => null, + 'replacements' => null, + 'highlightResult' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'type' => 'setType', + 'synonyms' => 'setSynonyms', + 'input' => 'setInput', + 'word' => 'setWord', + 'corrections' => 'setCorrections', + 'placeholder' => 'setPlaceholder', + 'replacements' => 'setReplacements', + 'highlightResult' => 'setHighlightResult', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'type' => 'getType', + 'synonyms' => 'getSynonyms', + 'input' => 'getInput', + 'word' => 'getWord', + 'corrections' => 'getCorrections', + 'placeholder' => 'getPlaceholder', + 'replacements' => 'getReplacements', + 'highlightResult' => 'getHighlightResult', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + if (isset($data['type'])) { + $this->container['type'] = $data['type']; + } + if (isset($data['synonyms'])) { + $this->container['synonyms'] = $data['synonyms']; + } + if (isset($data['input'])) { + $this->container['input'] = $data['input']; + } + if (isset($data['word'])) { + $this->container['word'] = $data['word']; + } + if (isset($data['corrections'])) { + $this->container['corrections'] = $data['corrections']; + } + if (isset($data['placeholder'])) { + $this->container['placeholder'] = $data['placeholder']; + } + if (isset($data['replacements'])) { + $this->container['replacements'] = $data['replacements']; + } + if (isset($data['highlightResult'])) { + $this->container['highlightResult'] = $data['highlightResult']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['objectID']) || $this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if (!isset($this->container['type']) || $this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string $objectID unique identifier of the synonym object to be created or updated + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets type + * + * @return \Algolia\AlgoliaSearch\Model\Search\SynonymType + */ + public function getType() + { + return $this->container['type'] ?? null; + } + + /** + * Sets type + * + * @param \Algolia\AlgoliaSearch\Model\Search\SynonymType $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets synonyms + * + * @return string[]|null + */ + public function getSynonyms() + { + return $this->container['synonyms'] ?? null; + } + + /** + * Sets synonyms + * + * @param string[]|null $synonyms words or phrases to be considered equivalent + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + + /** + * Gets input + * + * @return string|null + */ + public function getInput() + { + return $this->container['input'] ?? null; + } + + /** + * Sets input + * + * @param string|null $input word or phrase to appear in query strings (for onewaysynonym) + * + * @return self + */ + public function setInput($input) + { + $this->container['input'] = $input; + + return $this; + } + + /** + * Gets word + * + * @return string|null + */ + public function getWord() + { + return $this->container['word'] ?? null; + } + + /** + * Sets word + * + * @param string|null $word word or phrase to appear in query strings (for altcorrection1 and altcorrection2) + * + * @return self + */ + public function setWord($word) + { + $this->container['word'] = $word; + + return $this; + } + + /** + * Gets corrections + * + * @return string[]|null + */ + public function getCorrections() + { + return $this->container['corrections'] ?? null; + } + + /** + * Sets corrections + * + * @param string[]|null $corrections words to be matched in records + * + * @return self + */ + public function setCorrections($corrections) + { + $this->container['corrections'] = $corrections; + + return $this; + } + + /** + * Gets placeholder + * + * @return string|null + */ + public function getPlaceholder() + { + return $this->container['placeholder'] ?? null; + } + + /** + * Sets placeholder + * + * @param string|null $placeholder token to be put inside records + * + * @return self + */ + public function setPlaceholder($placeholder) + { + $this->container['placeholder'] = $placeholder; + + return $this; + } + + /** + * Gets replacements + * + * @return string[]|null + */ + public function getReplacements() + { + return $this->container['replacements'] ?? null; + } + + /** + * Sets replacements + * + * @param string[]|null $replacements list of query words that will match the token + * + * @return self + */ + public function setReplacements($replacements) + { + $this->container['replacements'] = $replacements; + + return $this; + } + + /** + * Gets highlightResult + * + * @return \Algolia\AlgoliaSearch\Model\Search\SynonymHitHighlightResult|null + */ + public function getHighlightResult() + { + return $this->container['highlightResult'] ?? null; + } + + /** + * Sets highlightResult + * + * @param \Algolia\AlgoliaSearch\Model\Search\SynonymHitHighlightResult|null $highlightResult highlightResult + * + * @return self + */ + public function setHighlightResult($highlightResult) + { + $this->container['highlightResult'] = $highlightResult; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SynonymHitHighlightResult.php b/clients/algoliasearch-client-php/lib/Model/Search/SynonymHitHighlightResult.php new file mode 100644 index 0000000000..6019a36921 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SynonymHitHighlightResult.php @@ -0,0 +1,240 @@ + '\Algolia\AlgoliaSearch\Model\Search\HighlightResult', + 'synonyms' => '\Algolia\AlgoliaSearch\Model\Search\HighlightResult[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'type' => null, + 'synonyms' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', + 'synonyms' => 'setSynonyms', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', + 'synonyms' => 'getSynonyms', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['type'])) { + $this->container['type'] = $data['type']; + } + if (isset($data['synonyms'])) { + $this->container['synonyms'] = $data['synonyms']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets type + * + * @return \Algolia\AlgoliaSearch\Model\Search\HighlightResult|null + */ + public function getType() + { + return $this->container['type'] ?? null; + } + + /** + * Sets type + * + * @param \Algolia\AlgoliaSearch\Model\Search\HighlightResult|null $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets synonyms + * + * @return \Algolia\AlgoliaSearch\Model\Search\HighlightResult[]|null + */ + public function getSynonyms() + { + return $this->container['synonyms'] ?? null; + } + + /** + * Sets synonyms + * + * @param \Algolia\AlgoliaSearch\Model\Search\HighlightResult[]|null $synonyms synonyms + * + * @return self + */ + public function setSynonyms($synonyms) + { + $this->container['synonyms'] = $synonyms; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/SynonymType.php b/clients/algoliasearch-client-php/lib/Model/Search/SynonymType.php new file mode 100644 index 0000000000..667b6970ef --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/SynonymType.php @@ -0,0 +1,44 @@ + 'int', + 'until' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'from' => null, + 'until' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'from' => 'setFrom', + 'until' => 'setUntil', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'from' => 'getFrom', + 'until' => 'getUntil', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['from'])) { + $this->container['from'] = $data['from']; + } + if (isset($data['until'])) { + $this->container['until'] = $data['until']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['from']) || $this->container['from'] === null) { + $invalidProperties[] = "'from' can't be null"; + } + if (!isset($this->container['until']) || $this->container['until'] === null) { + $invalidProperties[] = "'until' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets from + * + * @return int + */ + public function getFrom() + { + return $this->container['from'] ?? null; + } + + /** + * Sets from + * + * @param int $from lower bound of the time range (Unix timestamp) + * + * @return self + */ + public function setFrom($from) + { + $this->container['from'] = $from; + + return $this; + } + + /** + * Gets until + * + * @return int + */ + public function getUntil() + { + return $this->container['until'] ?? null; + } + + /** + * Sets until + * + * @param int $until upper bound of the time range (Unix timestamp) + * + * @return self + */ + public function setUntil($until) + { + $this->container['until'] = $until; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/UpdateApiKeyResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/UpdateApiKeyResponse.php new file mode 100644 index 0000000000..5f5217df8a --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/UpdateApiKeyResponse.php @@ -0,0 +1,245 @@ + 'string', + 'updatedAt' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'key' => null, + 'updatedAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'key' => 'setKey', + 'updatedAt' => 'setUpdatedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'key' => 'getKey', + 'updatedAt' => 'getUpdatedAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['key'])) { + $this->container['key'] = $data['key']; + } + if (isset($data['updatedAt'])) { + $this->container['updatedAt'] = $data['updatedAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['key']) || $this->container['key'] === null) { + $invalidProperties[] = "'key' can't be null"; + } + if (!isset($this->container['updatedAt']) || $this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets key + * + * @return string + */ + public function getKey() + { + return $this->container['key'] ?? null; + } + + /** + * Sets key + * + * @param string $key key string + * + * @return self + */ + public function setKey($key) + { + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets updatedAt + * + * @return string + */ + public function getUpdatedAt() + { + return $this->container['updatedAt'] ?? null; + } + + /** + * Sets updatedAt + * + * @param string $updatedAt date of last update (ISO-8601 format) + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/UpdatedAtResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/UpdatedAtResponse.php new file mode 100644 index 0000000000..a48a2bf505 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/UpdatedAtResponse.php @@ -0,0 +1,247 @@ + 'int', + 'updatedAt' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'taskID' => null, + 'updatedAt' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'taskID' => 'setTaskID', + 'updatedAt' => 'setUpdatedAt', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'taskID' => 'getTaskID', + 'updatedAt' => 'getUpdatedAt', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['taskID'])) { + $this->container['taskID'] = $data['taskID']; + } + if (isset($data['updatedAt'])) { + $this->container['updatedAt'] = $data['updatedAt']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['taskID']) || $this->container['taskID'] === null) { + $invalidProperties[] = "'taskID' can't be null"; + } + if (!isset($this->container['updatedAt']) || $this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets taskID + * + * @return int + */ + public function getTaskID() + { + return $this->container['taskID'] ?? null; + } + + /** + * Sets taskID + * + * @param int $taskID taskID of the task to wait for + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + + /** + * Gets updatedAt + * + * @return string + */ + public function getUpdatedAt() + { + return $this->container['updatedAt'] ?? null; + } + + /** + * Sets updatedAt + * + * @param string $updatedAt date of last update (ISO-8601 format) + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/UpdatedAtWithObjectIdResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/UpdatedAtWithObjectIdResponse.php new file mode 100644 index 0000000000..fae4de7878 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/UpdatedAtWithObjectIdResponse.php @@ -0,0 +1,271 @@ + 'int', + 'updatedAt' => 'string', + 'objectID' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'taskID' => null, + 'updatedAt' => null, + 'objectID' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'taskID' => 'setTaskID', + 'updatedAt' => 'setUpdatedAt', + 'objectID' => 'setObjectID', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'taskID' => 'getTaskID', + 'updatedAt' => 'getUpdatedAt', + 'objectID' => 'getObjectID', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['taskID'])) { + $this->container['taskID'] = $data['taskID']; + } + if (isset($data['updatedAt'])) { + $this->container['updatedAt'] = $data['updatedAt']; + } + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets taskID + * + * @return int|null + */ + public function getTaskID() + { + return $this->container['taskID'] ?? null; + } + + /** + * Sets taskID + * + * @param int|null $taskID taskID of the task to wait for + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + + /** + * Gets updatedAt + * + * @return string|null + */ + public function getUpdatedAt() + { + return $this->container['updatedAt'] ?? null; + } + + /** + * Sets updatedAt + * + * @param string|null $updatedAt date of last update (ISO-8601 format) + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + + /** + * Gets objectID + * + * @return string|null + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string|null $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/UpdatedRuleResponse.php b/clients/algoliasearch-client-php/lib/Model/Search/UpdatedRuleResponse.php new file mode 100644 index 0000000000..1876e599b0 --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/UpdatedRuleResponse.php @@ -0,0 +1,279 @@ + 'string', + 'updatedAt' => 'string', + 'taskID' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'objectID' => null, + 'updatedAt' => null, + 'taskID' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'objectID' => 'setObjectID', + 'updatedAt' => 'setUpdatedAt', + 'taskID' => 'setTaskID', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'objectID' => 'getObjectID', + 'updatedAt' => 'getUpdatedAt', + 'taskID' => 'getTaskID', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['objectID'])) { + $this->container['objectID'] = $data['objectID']; + } + if (isset($data['updatedAt'])) { + $this->container['updatedAt'] = $data['updatedAt']; + } + if (isset($data['taskID'])) { + $this->container['taskID'] = $data['taskID']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['objectID']) || $this->container['objectID'] === null) { + $invalidProperties[] = "'objectID' can't be null"; + } + if (!isset($this->container['updatedAt']) || $this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' can't be null"; + } + if (!isset($this->container['taskID']) || $this->container['taskID'] === null) { + $invalidProperties[] = "'taskID' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets objectID + * + * @return string + */ + public function getObjectID() + { + return $this->container['objectID'] ?? null; + } + + /** + * Sets objectID + * + * @param string $objectID unique identifier of the object + * + * @return self + */ + public function setObjectID($objectID) + { + $this->container['objectID'] = $objectID; + + return $this; + } + + /** + * Gets updatedAt + * + * @return string + */ + public function getUpdatedAt() + { + return $this->container['updatedAt'] ?? null; + } + + /** + * Sets updatedAt + * + * @param string $updatedAt date of last update (ISO-8601 format) + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + + /** + * Gets taskID + * + * @return int + */ + public function getTaskID() + { + return $this->container['taskID'] ?? null; + } + + /** + * Sets taskID + * + * @param int $taskID taskID of the task to wait for + * + * @return self + */ + public function setTaskID($taskID) + { + $this->container['taskID'] = $taskID; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} + diff --git a/clients/algoliasearch-client-php/lib/Model/Search/UserId.php b/clients/algoliasearch-client-php/lib/Model/Search/UserId.php new file mode 100644 index 0000000000..4a5ac4f9ed --- /dev/null +++ b/clients/algoliasearch-client-php/lib/Model/Search/UserId.php @@ -0,0 +1,323 @@ + 'string', + 'clusterName' => 'string', + 'nbRecords' => 'int', + 'dataSize' => 'int', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $modelFormats = [ + 'userID' => null, + 'clusterName' => null, + 'nbRecords' => null, + 'dataSize' => null, + ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function modelTypes() + { + return self::$modelTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function modelFormats() + { + return self::$modelFormats; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'userID' => 'setUserID', + 'clusterName' => 'setClusterName', + 'nbRecords' => 'setNbRecords', + 'dataSize' => 'setDataSize', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'userID' => 'getUserID', + 'clusterName' => 'getClusterName', + 'nbRecords' => 'getNbRecords', + 'dataSize' => 'getDataSize', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + */ + public function __construct(array $data = null) + { + if (isset($data['userID'])) { + $this->container['userID'] = $data['userID']; + } + if (isset($data['clusterName'])) { + $this->container['clusterName'] = $data['clusterName']; + } + if (isset($data['nbRecords'])) { + $this->container['nbRecords'] = $data['nbRecords']; + } + if (isset($data['dataSize'])) { + $this->container['dataSize'] = $data['dataSize']; + } + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if (!isset($this->container['userID']) || $this->container['userID'] === null) { + $invalidProperties[] = "'userID' can't be null"; + } + if (!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $this->container['userID'])) { + $invalidProperties[] = "invalid value for 'userID', must be conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."; + } + + if (!isset($this->container['clusterName']) || $this->container['clusterName'] === null) { + $invalidProperties[] = "'clusterName' can't be null"; + } + if (!isset($this->container['nbRecords']) || $this->container['nbRecords'] === null) { + $invalidProperties[] = "'nbRecords' can't be null"; + } + if (!isset($this->container['dataSize']) || $this->container['dataSize'] === null) { + $invalidProperties[] = "'dataSize' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + /** + * Gets userID + * + * @return string + */ + public function getUserID() + { + return $this->container['userID'] ?? null; + } + + /** + * Sets userID + * + * @param string $userID userID of the user + * + * @return self + */ + public function setUserID($userID) + { + if ((!preg_match('/^[a-zA-Z0-9 \\-*.]+$/', $userID))) { + throw new \InvalidArgumentException("invalid value for $userID when calling UserId., must conform to the pattern /^[a-zA-Z0-9 \\-*.]+$/."); + } + + $this->container['userID'] = $userID; + + return $this; + } + + /** + * Gets clusterName + * + * @return string + */ + public function getClusterName() + { + return $this->container['clusterName'] ?? null; + } + + /** + * Sets clusterName + * + * @param string $clusterName cluster on which the user is assigned + * + * @return self + */ + public function setClusterName($clusterName) + { + $this->container['clusterName'] = $clusterName; + + return $this; + } + + /** + * Gets nbRecords + * + * @return int + */ + public function getNbRecords() + { + return $this->container['nbRecords'] ?? null; + } + + /** + * Sets nbRecords + * + * @param int $nbRecords number of records belonging to the user + * + * @return self + */ + public function setNbRecords($nbRecords) + { + $this->container['nbRecords'] = $nbRecords; + + return $this; + } + + /** + * Gets dataSize + * + * @return int + */ + public function getDataSize() + { + return $this->container['dataSize'] ?? null; + } + + /** + * Sets dataSize + * + * @param int $dataSize data size used by the user + * + * @return self + */ + public function setDataSize($dataSize) + { + $this->container['dataSize'] = $dataSize; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +} +